Fix #9469 again in a better way.

Pass fTime into the IsHidden() method to check the hidden state from
the point of view of fTime which will ignore the hidden state. of the
window. Remove the Hide(), Show(), and IsHidden() overrides in
TimeView as they are no longer needed.

Thanks Stippi and Axel.
This commit is contained in:
John Scipione
2013-02-25 11:57:18 -05:00
parent 733be65954
commit 2a5c1f12b9
3 changed files with 5 additions and 27 deletions
+5 -2
View File
@@ -433,7 +433,9 @@ TReplicantTray::ShowHideTime()
if (fTime == NULL)
return;
if (fTime->IsHidden())
// Check from the point of view of fTime because we need to ignore
// whether or not the parent window is hidden.
if (fTime->IsHidden(fTime))
fTime->Show();
else
fTime->Hide();
@@ -441,7 +443,8 @@ TReplicantTray::ShowHideTime()
RealignReplicants();
AdjustPlacement();
bool showClock = !fTime->IsHidden();
// Check from the point of view of fTime ignoring parent's state.
bool showClock = !fTime->IsHidden(fTime);
// Update showClock setting that gets saved to disk on quit
((TBarApp*)be_app)->Settings()->showClock = showClock;
-22
View File
@@ -187,17 +187,6 @@ TTimeView::GetPreferredSize(float* width, float* height)
}
void
TTimeView::Hide()
{
// Prevent overflow
if (fShowLevel < INT16_MAX)
++fShowLevel;
BView::Hide();
}
void
TTimeView::MessageReceived(BMessage* message)
{
@@ -307,17 +296,6 @@ TTimeView::ResizeToPreferred()
}
void
TTimeView::Show()
{
// Prevent underflow
if (fShowLevel > INT16_MIN)
--fShowLevel;
BView::Show();
}
// # pragma mark - Public methods
-3
View File
@@ -88,13 +88,10 @@ public:
void Draw(BRect update);
void FrameMoved(BPoint);
void GetPreferredSize(float* width, float* height);
void Hide();
bool IsHidden() const { return fShowLevel > 0; };
void MessageReceived(BMessage*);
void MouseDown(BPoint where);
void Pulse();
void ResizeToPreferred();
void Show();
bool Orientation() const;
void SetOrientation(bool o);