Ticket #11644: 0001-Screenshot-Correctly-show-normal-sized-preview-after.patch

File 0001-Screenshot-Correctly-show-normal-sized-preview-after.patch, 1.4 KB (added by TwoFx, 9 years ago)

Fix for the fix

  • src/apps/screenshot/ScreenshotWindow.cpp

    From 90870c095271df153b36d6c2cb0fac2b217403b0 Mon Sep 17 00:00:00 2001
    From: Markus Himmel <markus@himmel-villmar.de>
    Date: Sun, 26 Jul 2015 11:21:30 +0000
    Subject: [PATCH] [Screenshot] Correctly show normal-sized preview after
     returning from a very wide one
    
    If the height had been reduced due to a very wide window being shown,
    it was not reset to its full value when switching back to a more
    narrow preview. Fix this by relayouting the window.
    ---
     src/apps/screenshot/ScreenshotWindow.cpp | 6 +++++-
     1 file changed, 5 insertions(+), 1 deletion(-)
    
    diff --git a/src/apps/screenshot/ScreenshotWindow.cpp b/src/apps/screenshot/ScreenshotWindow.cpp
    index e15a930..c80552f 100644
    a b ScreenshotWindow::ScreenshotWindow(const Utility& utility, bool silent,  
    239239
    240240    saveScreenshot->MakeDefault(true);
    241241
    242     Layout(false);
    243242    _UpdatePreviewPanel();
    244243    _UpdateFilenameSelection();
    245244
    ScreenshotWindow::_NewScreenshot(bool silent, bool clipboard)  
    440439void
    441440ScreenshotWindow::_UpdatePreviewPanel()
    442441{
     442    // Set the height of fPreview to what the layout suggests
     443    fPreview->SetExplicitMinSize(BSize());
     444    fPreview->SetExplicitMaxSize(BSize());
     445    Layout(false);
     446
    443447    float height = fPreview->Bounds().Height();
    444448    float width = (fScreenshot->Bounds().Width()
    445449        / fScreenshot->Bounds().Height()) * height;