Skip to content

Commit

Permalink
Correctly show normal-sized preview after returning from a very wide one
Browse files Browse the repository at this point in the history
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 <waddlesplash@gmail.com>
  • Loading branch information
TwoFX authored and waddlesplash committed Jul 28, 2015
1 parent d682f9f commit e4eecdb
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/apps/screenshot/ScreenshotWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,6 @@ ScreenshotWindow::ScreenshotWindow(const Utility& utility, bool silent,

saveScreenshot->MakeDefault(true);

Layout(false);
_UpdatePreviewPanel();
_UpdateFilenameSelection();

Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit e4eecdb

Please sign in to comment.