* Notify the TimeView in Deskbar when a locale change occurs, so it can update its size.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37677 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -516,6 +516,11 @@ TBarApp::MessageReceived(BMessage* message)
|
|||||||
case B_LOCALE_CHANGED:
|
case B_LOCALE_CHANGED:
|
||||||
{
|
{
|
||||||
be_locale_roster->UpdateSettings(message);
|
be_locale_roster->UpdateSettings(message);
|
||||||
|
|
||||||
|
BMessenger(fBarWindow->FindView("_deskbar_tv_")).SendMessage(
|
||||||
|
message);
|
||||||
|
// Notify the TimeView that the format has changed and it should
|
||||||
|
// recompute its size
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ enum {
|
|||||||
TTimeView::TTimeView(float maxWidth, float height, bool showSeconds,
|
TTimeView::TTimeView(float maxWidth, float height, bool showSeconds,
|
||||||
bool fullDate, bool)
|
bool fullDate, bool)
|
||||||
:
|
:
|
||||||
BView(BRect(-100,-100,-90,-90), "_deskbar_tv_",
|
BView(BRect(-100, -100, -90, -90), "_deskbar_tv_",
|
||||||
B_FOLLOW_RIGHT | B_FOLLOW_TOP,
|
B_FOLLOW_RIGHT | B_FOLLOW_TOP,
|
||||||
B_WILL_DRAW | B_PULSE_NEEDED | B_FRAME_EVENTS),
|
B_WILL_DRAW | B_PULSE_NEEDED | B_FRAME_EVENTS),
|
||||||
fParent(NULL),
|
fParent(NULL),
|
||||||
@@ -215,6 +215,10 @@ TTimeView::MessageReceived(BMessage* message)
|
|||||||
ShowSeconds(!ShowingSeconds());
|
ShowSeconds(!ShowingSeconds());
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case B_LOCALE_CHANGED:
|
||||||
|
Update();
|
||||||
|
break;
|
||||||
|
|
||||||
case kChangeClock:
|
case kChangeClock:
|
||||||
// launch the time prefs app
|
// launch the time prefs app
|
||||||
be_roster->Launch("application/x-vnd.Haiku-Time");
|
be_roster->Launch("application/x-vnd.Haiku-Time");
|
||||||
@@ -502,8 +506,8 @@ TTimeView::CalculateTextPlacement()
|
|||||||
font.GetBoundingBoxesForStrings(stringArray, 1, B_SCREEN_METRIC, &delta,
|
font.GetBoundingBoxesForStrings(stringArray, 1, B_SCREEN_METRIC, &delta,
|
||||||
rectArray);
|
rectArray);
|
||||||
|
|
||||||
fTimeLocation.y = fDateLocation.y = ceilf((bounds.Height() -
|
fTimeLocation.y = fDateLocation.y = ceilf((bounds.Height()
|
||||||
rectArray[0].Height() + 1.0) / 2.0 - rectArray[0].top);
|
- rectArray[0].Height() + 1.0) / 2.0 - rectArray[0].top);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user