diff --git a/src/apps/deskbar/StatusView.cpp b/src/apps/deskbar/StatusView.cpp index 947773f531..b25c7af420 100644 --- a/src/apps/deskbar/StatusView.cpp +++ b/src/apps/deskbar/StatusView.cpp @@ -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; diff --git a/src/apps/deskbar/TimeView.cpp b/src/apps/deskbar/TimeView.cpp index 02e7162017..18217ebbe5 100644 --- a/src/apps/deskbar/TimeView.cpp +++ b/src/apps/deskbar/TimeView.cpp @@ -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 diff --git a/src/apps/deskbar/TimeView.h b/src/apps/deskbar/TimeView.h index 9f28a1ca04..ba823dda06 100644 --- a/src/apps/deskbar/TimeView.h +++ b/src/apps/deskbar/TimeView.h @@ -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);