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,
|
239 | 239 | |
240 | 240 | saveScreenshot->MakeDefault(true); |
241 | 241 | |
242 | | Layout(false); |
243 | 242 | _UpdatePreviewPanel(); |
244 | 243 | _UpdateFilenameSelection(); |
245 | 244 | |
… |
… |
ScreenshotWindow::_NewScreenshot(bool silent, bool clipboard)
|
440 | 439 | void |
441 | 440 | ScreenshotWindow::_UpdatePreviewPanel() |
442 | 441 | { |
| 442 | // Set the height of fPreview to what the layout suggests |
| 443 | fPreview->SetExplicitMinSize(BSize()); |
| 444 | fPreview->SetExplicitMaxSize(BSize()); |
| 445 | Layout(false); |
| 446 | |
443 | 447 | float height = fPreview->Bounds().Height(); |
444 | 448 | float width = (fScreenshot->Bounds().Width() |
445 | 449 | / fScreenshot->Bounds().Height()) * height; |