Since the time preflet is now layout-aware, scrolling the zone list to
the current time zone must be done after layouting has been done, else the view doesn't have a valid size to work with yet. Resolves #7681. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42106 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -130,6 +130,7 @@ TTimeWindow::_InitWindow()
|
|||||||
.Add(fBaseView)
|
.Add(fBaseView)
|
||||||
.Add(fRevertButton)
|
.Add(fRevertButton)
|
||||||
.SetInsets(5, 5, 5, 5);
|
.SetInsets(5, 5, 5, 5);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -109,25 +109,24 @@ TimeZoneView::AttachedToWindow()
|
|||||||
BView::AttachedToWindow();
|
BView::AttachedToWindow();
|
||||||
if (Parent())
|
if (Parent())
|
||||||
SetViewColor(Parent()->ViewColor());
|
SetViewColor(Parent()->ViewColor());
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void
|
|
||||||
TimeZoneView::AllAttached()
|
|
||||||
{
|
|
||||||
BView::AllAttached();
|
|
||||||
if (!fInitialized) {
|
if (!fInitialized) {
|
||||||
fInitialized = true;
|
fInitialized = true;
|
||||||
|
|
||||||
fSetZone->SetTarget(this);
|
fSetZone->SetTarget(this);
|
||||||
fZoneList->SetTarget(this);
|
fZoneList->SetTarget(this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// update displays
|
|
||||||
if (fCurrentZoneItem != NULL) {
|
void
|
||||||
fZoneList->Select(fZoneList->IndexOf(fCurrentZoneItem));
|
TimeZoneView::DoLayout()
|
||||||
fCurrent->SetText(fCurrentZoneItem->Text());
|
{
|
||||||
fZoneList->ScrollToSelection();
|
BView::DoLayout();
|
||||||
}
|
if (fCurrentZoneItem != NULL) {
|
||||||
|
fZoneList->Select(fZoneList->IndexOf(fCurrentZoneItem));
|
||||||
|
fCurrent->SetText(fCurrentZoneItem->Text());
|
||||||
|
fZoneList->ScrollToSelection();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -31,12 +31,12 @@ public:
|
|||||||
virtual ~TimeZoneView();
|
virtual ~TimeZoneView();
|
||||||
|
|
||||||
virtual void AttachedToWindow();
|
virtual void AttachedToWindow();
|
||||||
virtual void AllAttached();
|
|
||||||
virtual void MessageReceived(BMessage* message);
|
virtual void MessageReceived(BMessage* message);
|
||||||
bool CheckCanRevert();
|
bool CheckCanRevert();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual bool GetToolTipAt(BPoint point, BToolTip** _tip);
|
virtual bool GetToolTipAt(BPoint point, BToolTip** _tip);
|
||||||
|
virtual void DoLayout();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void _UpdateDateTime(BMessage* message);
|
void _UpdateDateTime(BMessage* message);
|
||||||
|
|||||||
Reference in New Issue
Block a user