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 <[email protected]>
This commit is contained in:
committed by
Augustin Cavalier
parent
d682f9fc9c
commit
e4eecdb5c0
@@ -239,7 +239,6 @@ ScreenshotWindow::ScreenshotWindow(const Utility& utility, bool silent,
|
|||||||
|
|
||||||
saveScreenshot->MakeDefault(true);
|
saveScreenshot->MakeDefault(true);
|
||||||
|
|
||||||
Layout(false);
|
|
||||||
_UpdatePreviewPanel();
|
_UpdatePreviewPanel();
|
||||||
_UpdateFilenameSelection();
|
_UpdateFilenameSelection();
|
||||||
|
|
||||||
@@ -440,6 +439,11 @@ ScreenshotWindow::_NewScreenshot(bool silent, bool clipboard)
|
|||||||
void
|
void
|
||||||
ScreenshotWindow::_UpdatePreviewPanel()
|
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 height = fPreview->Bounds().Height();
|
||||||
float width = (fScreenshot->Bounds().Width()
|
float width = (fScreenshot->Bounds().Width()
|
||||||
/ fScreenshot->Bounds().Height()) * height;
|
/ fScreenshot->Bounds().Height()) * height;
|
||||||
|
|||||||
Reference in New Issue
Block a user