Time: properly center the window.
* The previous code was broken, and did not take the actual window size into account; it's now using BWindow::MoveOnScreen(). * Also, make the width of the time zone list relative to the font size.
This commit is contained in:
@@ -149,18 +149,8 @@ TTimeWindow::_InitWindow()
|
||||
void
|
||||
TTimeWindow::_AlignWindow()
|
||||
{
|
||||
BPoint pt = TimeSettings().LeftTop();
|
||||
MoveTo(pt);
|
||||
|
||||
BRect frame = Frame();
|
||||
BRect screen = BScreen().Frame();
|
||||
if (!frame.Intersects(screen.InsetByCopy(50.0, 50.0))) {
|
||||
BRect bounds(Bounds());
|
||||
BPoint leftTop((screen.Width() - bounds.Width()) / 2.0,
|
||||
(screen.Height() - bounds.Height()) / 2.0);
|
||||
|
||||
MoveTo(leftTop);
|
||||
}
|
||||
MoveTo(TimeSettings().LeftTop());
|
||||
MoveOnScreen();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -213,7 +213,8 @@ TimeZoneView::_InitView()
|
||||
_BuildZoneMenu();
|
||||
BScrollView* scrollList = new BScrollView("scrollList", fZoneList,
|
||||
B_FRAME_EVENTS | B_WILL_DRAW, false, true);
|
||||
scrollList->SetExplicitMinSize(BSize(200, 0));
|
||||
scrollList->SetExplicitMinSize(
|
||||
BSize(200 * be_plain_font->Size() / 12.0f, 0));
|
||||
|
||||
fCurrent = new TTZDisplay("currentTime", B_TRANSLATE("Current time:"));
|
||||
fPreview = new TTZDisplay("previewTime", B_TRANSLATE("Preview time:"));
|
||||
|
||||
Reference in New Issue
Block a user