* 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));
|
fPlaylistMenu->Superitem()->SetMessage(new BMessage(M_FILE_PLAYLIST));
|
||||||
|
|
||||||
fFileMenu->AddSeparatorItem();
|
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)));
|
new BMessage(B_ABOUT_REQUESTED)));
|
||||||
fFileMenu->AddSeparatorItem();
|
fFileMenu->AddSeparatorItem();
|
||||||
fFileMenu->AddItem(new BMenuItem("Close", new BMessage(M_FILE_CLOSE), 'W'));
|
fFileMenu->AddItem(new BMenuItem("Close", new BMessage(M_FILE_CLOSE), 'W'));
|
||||||
@@ -1195,7 +1195,7 @@ MainWin::_ShowContextMenu(const BPoint &screen_point)
|
|||||||
item->SetMarked(fAlwaysOnTop);
|
item->SetMarked(fAlwaysOnTop);
|
||||||
|
|
||||||
menu->AddSeparatorItem();
|
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)));
|
new BMessage(B_ABOUT_REQUESTED)));
|
||||||
menu->AddSeparatorItem();
|
menu->AddSeparatorItem();
|
||||||
menu->AddItem(new BMenuItem("Quit", new BMessage(M_FILE_QUIT), 'Q'));
|
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();
|
r.bottom = r.top + fSeekSlider->Bounds().Height();
|
||||||
_LayoutControl(fSeekSlider, r, true);
|
_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 currentWidth = frame.Width();
|
||||||
float space = (currentWidth - minWidth) / 6.0;
|
float space = (currentWidth - minWidth) / 6.0;
|
||||||
// apply weighting
|
// apply weighting
|
||||||
@@ -554,14 +558,14 @@ TransportControlGroup::_MinFrame() const
|
|||||||
// _LayoutControl
|
// _LayoutControl
|
||||||
void
|
void
|
||||||
TransportControlGroup::_LayoutControl(BView* view, BRect frame,
|
TransportControlGroup::_LayoutControl(BView* view, BRect frame,
|
||||||
bool resizeWidth, bool resizeHeight) const
|
bool resizeWidth, bool resizeHeight) const
|
||||||
{
|
{
|
||||||
if (!resizeHeight)
|
if (!resizeHeight)
|
||||||
// center vertically
|
// 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)
|
if (!resizeWidth)
|
||||||
// center horizontally
|
// 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());
|
view->MoveTo(frame.LeftTop());
|
||||||
float width = resizeWidth ? frame.Width() : view->Bounds().Width();
|
float width = resizeWidth ? frame.Width() : view->Bounds().Width();
|
||||||
float height = resizeHeight ? frame.Height() : view->Bounds().Height();
|
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,
|
SeekSlider::SeekSlider(BRect frame, const char* name, BMessage* message,
|
||||||
int32 minValue, int32 maxValue)
|
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)
|
B_WILL_DRAW | B_FULL_UPDATE_ON_RESIZE)
|
||||||
, fTracking(false)
|
, fTracking(false)
|
||||||
, fLastTrackTime(0)
|
, fLastTrackTime(0)
|
||||||
|
|||||||
Reference in New Issue
Block a user