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:
@@ -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;
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user