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
|
void
|
||||||
TTimeWindow::_AlignWindow()
|
TTimeWindow::_AlignWindow()
|
||||||
{
|
{
|
||||||
BPoint pt = TimeSettings().LeftTop();
|
MoveTo(TimeSettings().LeftTop());
|
||||||
MoveTo(pt);
|
MoveOnScreen();
|
||||||
|
|
||||||
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);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -213,7 +213,8 @@ TimeZoneView::_InitView()
|
|||||||
_BuildZoneMenu();
|
_BuildZoneMenu();
|
||||||
BScrollView* scrollList = new BScrollView("scrollList", fZoneList,
|
BScrollView* scrollList = new BScrollView("scrollList", fZoneList,
|
||||||
B_FRAME_EVENTS | B_WILL_DRAW, false, true);
|
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:"));
|
fCurrent = new TTZDisplay("currentTime", B_TRANSLATE("Current time:"));
|
||||||
fPreview = new TTZDisplay("previewTime", B_TRANSLATE("Preview time:"));
|
fPreview = new TTZDisplay("previewTime", B_TRANSLATE("Preview time:"));
|
||||||
|
|||||||
Reference in New Issue
Block a user