* The SeekSlider had the wrong follow mode. If the window was resized in such
a way that the transport group did not need to re-layout, then the seek slider would not be at the correct position. * Layout the transport controls with a fixed maximum width in order to prevent spreading them too much. * Fix "About" and "MediaPlayer" missing a space. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25733 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -892,7 +892,7 @@ MainWin::_CreateMenu()
|
||||
fPlaylistMenu->Superitem()->SetMessage(new BMessage(M_FILE_PLAYLIST));
|
||||
|
||||
fFileMenu->AddSeparatorItem();
|
||||
fFileMenu->AddItem(new BMenuItem("About" NAME B_UTF8_ELLIPSIS,
|
||||
fFileMenu->AddItem(new BMenuItem("About " NAME B_UTF8_ELLIPSIS,
|
||||
new BMessage(B_ABOUT_REQUESTED)));
|
||||
fFileMenu->AddSeparatorItem();
|
||||
fFileMenu->AddItem(new BMenuItem("Close", new BMessage(M_FILE_CLOSE), 'W'));
|
||||
@@ -1195,7 +1195,7 @@ MainWin::_ShowContextMenu(const BPoint &screen_point)
|
||||
item->SetMarked(fAlwaysOnTop);
|
||||
|
||||
menu->AddSeparatorItem();
|
||||
menu->AddItem(new BMenuItem("About" NAME B_UTF8_ELLIPSIS,
|
||||
menu->AddItem(new BMenuItem("About " NAME B_UTF8_ELLIPSIS,
|
||||
new BMessage(B_ABOUT_REQUESTED)));
|
||||
menu->AddSeparatorItem();
|
||||
menu->AddItem(new BMenuItem("Quit", new BMessage(M_FILE_QUIT), 'Q'));
|
||||
|
||||
@@ -474,6 +474,10 @@ TransportControlGroup::_LayoutControls(BRect frame) const
|
||||
r.bottom = r.top + fSeekSlider->Bounds().Height();
|
||||
_LayoutControl(fSeekSlider, r, true);
|
||||
|
||||
// prevent spreading the controls too much
|
||||
if (frame.Width() > minWidth * 2.0)
|
||||
frame.right = frame.left + ceilf(minWidth * 2.0);
|
||||
|
||||
float currentWidth = frame.Width();
|
||||
float space = (currentWidth - minWidth) / 6.0;
|
||||
// apply weighting
|
||||
@@ -554,14 +558,14 @@ TransportControlGroup::_MinFrame() const
|
||||
// _LayoutControl
|
||||
void
|
||||
TransportControlGroup::_LayoutControl(BView* view, BRect frame,
|
||||
bool resizeWidth, bool resizeHeight) const
|
||||
bool resizeWidth, bool resizeHeight) const
|
||||
{
|
||||
if (!resizeHeight)
|
||||
// center vertically
|
||||
frame.top = (frame.top + frame.bottom) / 2.0 - view->Bounds().Height() / 2.0;
|
||||
frame.top = (frame.top + frame.bottom - view->Bounds().Height()) / 2.0;
|
||||
if (!resizeWidth)
|
||||
// center horizontally
|
||||
frame.left = (frame.left + frame.right) / 2.0 - view->Bounds().Width() / 2.0;
|
||||
frame.left = (frame.left + frame.right - view->Bounds().Width()) / 2.0;
|
||||
view->MoveTo(frame.LeftTop());
|
||||
float width = resizeWidth ? frame.Width() : view->Bounds().Width();
|
||||
float height = resizeHeight ? frame.Height() : view->Bounds().Height();
|
||||
|
||||
@@ -31,7 +31,7 @@ const char* kDisabledSeekMessage = "Drop files to play";
|
||||
|
||||
SeekSlider::SeekSlider(BRect frame, const char* name, BMessage* message,
|
||||
int32 minValue, int32 maxValue)
|
||||
: BControl(frame, name, NULL, message, B_FOLLOW_NONE,
|
||||
: BControl(frame, name, NULL, message, B_FOLLOW_LEFT | B_FOLLOW_TOP,
|
||||
B_WILL_DRAW | B_FULL_UPDATE_ON_RESIZE)
|
||||
, fTracking(false)
|
||||
, fLastTrackTime(0)
|
||||
|
||||
Reference in New Issue
Block a user