Skip to content

Commit

Permalink
Status view: Also hide barberpole after some time.
Browse files Browse the repository at this point in the history
Remove unused member variable
  • Loading branch information
jackburton79 committed Dec 17, 2024
1 parent 9d3097c commit 7df9c2e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
11 changes: 7 additions & 4 deletions src/ui/GlobalStatusView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@ GlobalStatusView::GlobalStatusView()
BView("global_status_view", B_WILL_DRAW),
fBarberPole(nullptr),
fStringView(nullptr),
fLastStatusChange(system_time()),
fDontHideText(false)
fLastStatusChange(system_time())
{
fBarberPole = new BarberPole("barber pole");
//fBarberPole->SetExplicitMinSize(BSize(100, B_SIZE_UNLIMITED));
Expand All @@ -41,6 +40,8 @@ GlobalStatusView::GlobalStatusView()
fStringView->SetExplicitMinSize(BSize(200, B_SIZE_UNSET));
fStringView->SetExplicitAlignment(BAlignment(B_ALIGN_LEFT, B_ALIGN_VERTICAL_UNSET));

fBarberPole->Hide();

BLayoutBuilder::Group<>(this, B_HORIZONTAL)
.SetInsets(2, 0)
.AddGlue()
Expand Down Expand Up @@ -88,6 +89,7 @@ GlobalStatusView::MessageReceived(BMessage *message)
switch (message->what) {
case kHideText:
fStringView->SetText("");
fBarberPole->Hide();
break;
case B_OBSERVER_NOTICE_CHANGE:
{
Expand All @@ -96,6 +98,9 @@ GlobalStatusView::MessageReceived(BMessage *message)
switch (what) {
case MSG_NOTIFY_BUILDING_PHASE:
{
if (fBarberPole->IsHidden())
fBarberPole->Show();

// TODO: Instead of doing this here, put the string into the message
// from the caller and just retrieve it and display it here
bool building = message->GetBool("building", false);
Expand All @@ -108,7 +113,6 @@ GlobalStatusView::MessageReceived(BMessage *message)
text = B_TRANSLATE("Building project '\"%project%\"'" B_UTF8_ELLIPSIS);
else if (cmdType.Compare("clean") == 0)
text = B_TRANSLATE("Cleaning project '\"%project%\"'" B_UTF8_ELLIPSIS);
fDontHideText = true;
fBarberPole->Start();
} else {
if (cmdType.Compare("build") == 0) {
Expand All @@ -122,7 +126,6 @@ GlobalStatusView::MessageReceived(BMessage *message)
else
text = B_TRANSLATE("Failed cleaning project '\"%project%\"'");
}
fDontHideText = false;
fBarberPole->Stop();
BMessenger messenger(this);
BMessageRunner::StartSending(messenger, new BMessage(kHideText),
Expand Down
1 change: 0 additions & 1 deletion src/ui/GlobalStatusView.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,4 @@ class GlobalStatusView : public BView {
BarberPole* fBarberPole;
BStringView* fStringView;
bigtime_t fLastStatusChange;
bool fDontHideText;
};

0 comments on commit 7df9c2e

Please sign in to comment.