Author: stippi Date: 2011-04-08 14:21:53 +0200 (Fri, 08 Apr 2011) New Revision: 41199 Changeset: https://dev.haiku-os.org/changeset/41199 Modified: haiku/trunk/src/apps/showimage/ShowImageWindow.cpp Log: Compute window size limits at least with the minimum menu bar and tool bar width taken into account. Modified: haiku/trunk/src/apps/showimage/ShowImageWindow.cpp =================================================================== --- haiku/trunk/src/apps/showimage/ShowImageWindow.cpp 2011-04-08 12:08:39 UTC (rev 41198) +++ haiku/trunk/src/apps/showimage/ShowImageWindow.cpp 2011-04-08 12:21:53 UTC (rev 41199) @@ -11,6 +11,7 @@ * yellowTAB GmbH * Bernd Korz * Axel Dörfler, axeld@xxxxxxxxxxxxxxxx + * Stephan Aßmus <superstippi@xxxxxx> */ @@ -236,7 +237,13 @@ 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) {