From e4eecdb5c047873433d6b1b76458210285c84b3b Mon Sep 17 00:00:00 2001 From: Markus Himmel Date: Sun, 26 Jul 2015 11:21:30 +0000 Subject: [PATCH] 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. Signed-off-by: Augustin Cavalier --- 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 e15a930a5b..c80552f22b 100644 --- a/src/apps/screenshot/ScreenshotWindow.cpp +++ b/src/apps/screenshot/ScreenshotWindow.cpp @@ -239,7 +239,6 @@ ScreenshotWindow::ScreenshotWindow(const Utility& utility, bool silent, saveScreenshot->MakeDefault(true); - Layout(false); _UpdatePreviewPanel(); _UpdateFilenameSelection(); @@ -440,6 +439,11 @@ ScreenshotWindow::_NewScreenshot(bool silent, bool clipboard) void ScreenshotWindow::_UpdatePreviewPanel() { + // Set the height of fPreview to what the layout suggests + fPreview->SetExplicitMinSize(BSize()); + fPreview->SetExplicitMaxSize(BSize()); + Layout(false); + float height = fPreview->Bounds().Height(); float width = (fScreenshot->Bounds().Width() / fScreenshot->Bounds().Height()) * height;