From 9b13c4181cd61217dbfc6be1a7c03d2b51c99d51 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20A=C3=9Fmus?= Date: Fri, 8 Apr 2011 12:21:53 +0000 Subject: [PATCH] Compute window size limits at least with the minimum menu bar and tool bar width taken into account. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41199 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/apps/showimage/ShowImageWindow.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/apps/showimage/ShowImageWindow.cpp b/src/apps/showimage/ShowImageWindow.cpp index 385006d2f3..39da5f093a 100644 --- a/src/apps/showimage/ShowImageWindow.cpp +++ b/src/apps/showimage/ShowImageWindow.cpp @@ -11,6 +11,7 @@ * yellowTAB GmbH * Bernd Korz * Axel Dörfler, axeld@pinc-software.de + * Stephan Aßmus */ @@ -236,7 +237,13 @@ ShowImageWindow::ShowImageWindow(BRect frame, const entry_ref& ref, 0, 150, B_VERTICAL); AddChild(fVerticalScrollBar); - SetSizeLimits(250, 100000, 100, 100000); + // Update minimum window size + float menuBarMinWidth; + fBar->GetPreferredSize(&menuBarMinWidth, NULL); + float toolBarMinWidth; + fToolBarView->GetPreferredSize(&toolBarMinWidth, NULL); + SetSizeLimits(std::max(menuBarMinWidth, toolBarMinWidth), 100000, 100, + 100000); // finish creating the window if (_LoadImage() != B_OK) {