]> git.sesse.net Git - vlc/blobdiff - modules/gui/beos/MediaControlView.cpp
fixed the incorrect window size limits for the interface window
[vlc] / modules / gui / beos / MediaControlView.cpp
index 481c59b5ac432770fe638f8602390f6d4df99785..faf901389360e8515fda38b0dfc1fb5800cfe937 100644 (file)
@@ -2,7 +2,7 @@
  * MediaControlView.cpp: beos interface
  *****************************************************************************
  * Copyright (C) 1999, 2000, 2001 VideoLAN
- * $Id: MediaControlView.cpp,v 1.21 2003/12/28 01:49:12 titer Exp $
+ * $Id$
  *
  * Authors: Tony Castley <tony@castley.net>
  *          Stephan Aßmus <stippi@yellowbites.com>
@@ -203,8 +203,18 @@ MediaControlView::AttachedToWindow()
        fVolumeSlider->SetTarget(Window());
 
        BRect r(_MinFrame());
-       if (BMenuBar* menuBar = Window()->KeyMenuBar())
-               r.bottom += menuBar->Bounds().Height();
+       if (BMenuBar* menuBar = Window()->KeyMenuBar()) {
+               float width, height;
+               menuBar->GetPreferredSize(&width, &height);
+//             r.bottom += menuBar->Bounds().Height();
+               r.bottom += height;
+               // see that our calculated minimal width is not smaller than what
+               // the menubar can be
+printf("preferred: width: %f, height: %f - width: %f\n", width, height, r.Width());
+               width -= r.Width();
+               if (width > 0.0)
+                       r.right += width;
+       }
 
        Window()->SetSizeLimits(r.Width(), r.Width() * 1.8, r.Height(), r.Height() * 1.3);
        if (!Window()->Bounds().Contains(r))