diff --git a/src/apps/deskbar/BarApp.cpp b/src/apps/deskbar/BarApp.cpp
index 532e1bc..7640f43 100644
a
|
b
|
All rights reserved.
|
60 | 60 | #include "PublicCommands.h" |
61 | 61 | #include "ResourceSet.h" |
62 | 62 | #include "Switcher.h" |
63 | | #include "TeamMenu.h" |
64 | | #include "WindowMenuItem.h" |
65 | 63 | |
66 | 64 | |
67 | 65 | BLocker TBarApp::sSubscriberLock; |
… |
… |
BList TBarApp::sSubscribers;
|
72 | 70 | const uint32 kShowBeMenu = 'BeMn'; |
73 | 71 | const uint32 kShowTeamMenu = 'TmMn'; |
74 | 72 | |
75 | | const BRect kIconSize(0.0f, 0.0f, 15.0f, 15.0f); |
76 | 73 | |
| 74 | const BRect kIconRect(0.0f, 0.0f, 15.0f, 15.0f); |
77 | 75 | static const color_space kIconFormat = B_RGBA32; |
78 | 76 | |
79 | 77 | |
… |
… |
TBarApp::TBarApp()
|
119 | 117 | fBarWindow = new TBarWindow(); |
120 | 118 | fBarWindow->Show(); |
121 | 119 | |
| 120 | fBarView = static_cast<TBarApp*>(be_app)->BarView(); |
| 121 | |
122 | 122 | // this messenger now targets the barview instead of the |
123 | 123 | // statusview so that all additions to the tray |
124 | 124 | // follow the same path |
… |
… |
TBarApp::InitSettings()
|
313 | 313 | void |
314 | 314 | TBarApp::MessageReceived(BMessage* message) |
315 | 315 | { |
316 | | int32 count; |
317 | | bool enabled; |
318 | 316 | switch (message->what) { |
319 | 317 | case 'gloc': |
320 | 318 | case 'sloc': |
… |
… |
TBarApp::MessageReceived(BMessage* message)
|
349 | 347 | break; |
350 | 348 | |
351 | 349 | case kUpdateRecentCounts: |
| 350 | int32 count; |
| 351 | bool enabled; |
| 352 | |
352 | 353 | if (message->FindInt32("applications", &count) == B_OK) |
353 | 354 | fSettings.recentAppsCount = count; |
354 | 355 | if (message->FindBool("applicationsEnabled", &enabled) == B_OK) |
… |
… |
TBarApp::MessageReceived(BMessage* message)
|
419 | 420 | { |
420 | 421 | fSettings.autoRaise = !fSettings.autoRaise; |
421 | 422 | |
422 | | TBarView* barView = static_cast<TBarApp*>(be_app)->BarView(); |
423 | 423 | fBarWindow->Lock(); |
424 | | barView->UpdateAutoRaise(); |
| 424 | fBarView->UpdateAutoRaise(); |
425 | 425 | fBarWindow->Unlock(); |
426 | 426 | break; |
427 | 427 | } |
… |
… |
TBarApp::MessageReceived(BMessage* message)
|
430 | 430 | { |
431 | 431 | fSettings.trackerAlwaysFirst = !fSettings.trackerAlwaysFirst; |
432 | 432 | |
433 | | TBarView* barView = static_cast<TBarApp*>(be_app)->BarView(); |
434 | 433 | fBarWindow->Lock(); |
435 | | barView->UpdatePlacement(); |
| 434 | fBarView->UpdatePlacement(); |
436 | 435 | fBarWindow->Unlock(); |
437 | 436 | break; |
438 | 437 | } |
… |
… |
TBarApp::MessageReceived(BMessage* message)
|
441 | 440 | { |
442 | 441 | fSettings.sortRunningApps = !fSettings.sortRunningApps; |
443 | 442 | |
444 | | TBarView* barView = static_cast<TBarApp*>(be_app)->BarView(); |
445 | 443 | fBarWindow->Lock(); |
446 | | barView->UpdatePlacement(); |
| 444 | fBarView->UpdatePlacement(); |
447 | 445 | fBarWindow->Unlock(); |
448 | 446 | break; |
449 | 447 | } |
… |
… |
TBarApp::MessageReceived(BMessage* message)
|
460 | 458 | { |
461 | 459 | fSettings.superExpando = !fSettings.superExpando; |
462 | 460 | |
463 | | TBarView* barView = static_cast<TBarApp*>(be_app)->BarView(); |
464 | 461 | fBarWindow->Lock(); |
465 | | barView->UpdatePlacement(); |
| 462 | fBarView->UpdatePlacement(); |
466 | 463 | fBarWindow->Unlock(); |
467 | 464 | break; |
468 | 465 | } |
… |
… |
TBarApp::MessageReceived(BMessage* message)
|
471 | 468 | { |
472 | 469 | fSettings.expandNewTeams = !fSettings.expandNewTeams; |
473 | 470 | |
474 | | TBarView* barView = static_cast<TBarApp*>(be_app)->BarView(); |
475 | 471 | fBarWindow->Lock(); |
476 | | barView->UpdatePlacement(); |
| 472 | fBarView->UpdatePlacement(); |
477 | 473 | fBarWindow->Unlock(); |
478 | 474 | break; |
479 | 475 | } |
… |
… |
TBarApp::AddTeam(team_id team, uint32 flags, const char* sig, entry_ref* ref)
|
632 | 628 | BAppFileInfo appMime(&file); |
633 | 629 | |
634 | 630 | BarTeamInfo* barInfo = new BarTeamInfo(new BList(), flags, strdup(sig), |
635 | | new BBitmap(kIconSize, kIconFormat), strdup(ref->name)); |
| 631 | new BBitmap(kIconRect, kIconFormat), strdup(ref->name)); |
636 | 632 | |
637 | 633 | barInfo->teams->AddItem((void*)team); |
638 | 634 | if (appMime.GetIcon(barInfo->icon, B_MINI_ICON) != B_OK) |
diff --git a/src/apps/deskbar/BarApp.h b/src/apps/deskbar/BarApp.h
index 6f15838..55bf6e1 100644
a
|
b
|
class TBarApp : public BApplication {
|
150 | 150 | void ShowPreferencesWindow(); |
151 | 151 | |
152 | 152 | TBarWindow* fBarWindow; |
| 153 | TBarView* fBarView; |
153 | 154 | BMessenger fSwitcherMessenger; |
154 | 155 | BMessenger fStatusViewMessenger; |
155 | 156 | BFile* fSettingsFile; |
diff --git a/src/apps/deskbar/BarMenuTitle.h b/src/apps/deskbar/BarMenuTitle.h
index be7aa99..870c6f7 100644
a
|
b
|
class BMenu;
|
46 | 46 | |
47 | 47 | class TBarMenuTitle : public BMenuItem { |
48 | 48 | public: |
49 | | TBarMenuTitle(float width,float height, const BBitmap* icon, |
| 49 | TBarMenuTitle(float width, float height, const BBitmap* icon, |
50 | 50 | BMenu* menu, bool inexpando = false); |
51 | 51 | virtual ~TBarMenuTitle(); |
52 | 52 | |
diff --git a/src/apps/deskbar/BarView.cpp b/src/apps/deskbar/BarView.cpp
index f113e6a..fd753d3 100644
a
|
b
|
TBarView::UpdateAutoRaise()
|
424 | 424 | void |
425 | 425 | TBarView::UpdatePlacement() |
426 | 426 | { |
427 | | ChangeState(fState, fVertical, fLeft, fTop); |
| 427 | ChangeState(fState, fVertical, fLeft, fTop); |
428 | 428 | } |
429 | 429 | |
430 | 430 | |
… |
… |
TBarView::DragStart()
|
628 | 628 | if (item == fLastDragItem) |
629 | 629 | return B_OK; |
630 | 630 | |
631 | | fLastDragItem = item; |
632 | | } |
| 631 | fLastDragItem = item; |
| 632 | } |
633 | 633 | } |
634 | 634 | |
635 | 635 | return B_OK; |
diff --git a/src/apps/deskbar/BarWindow.cpp b/src/apps/deskbar/BarWindow.cpp
index 98dc43a..a5027a5 100644
a
|
b
|
TBarWindow::ShowBeMenu()
|
312 | 312 | if (menuBar == NULL) |
313 | 313 | return; |
314 | 314 | |
315 | | BMenuBar_StartMenuBar_Hack(menuBar,0,true,true,NULL); |
| 315 | BMenuBar_StartMenuBar_Hack(menuBar, 0, true, true, NULL); |
316 | 316 | } |
317 | 317 | |
318 | 318 | |
… |
… |
TBarWindow::ShowTeamMenu()
|
326 | 326 | if (KeyMenuBar() == NULL) |
327 | 327 | return; |
328 | 328 | |
329 | | BMenuBar_StartMenuBar_Hack(KeyMenuBar(),index,true,true,NULL); |
| 329 | BMenuBar_StartMenuBar_Hack(KeyMenuBar(), index, true, true, NULL); |
330 | 330 | } |
331 | 331 | |
332 | 332 | |
diff --git a/src/apps/deskbar/ExpandoMenuBar.cpp b/src/apps/deskbar/ExpandoMenuBar.cpp
index b390f06..eb869e9 100644
a
|
b
|
void
|
713 | 713 | TExpandoMenuBar::CheckForSizeOverrun() |
714 | 714 | { |
715 | 715 | BRect screenFrame = (BScreen(Window())).Frame(); |
716 | | if (fVertical) |
717 | | fIsScrolling = Window()->Frame().bottom > screenFrame.bottom; |
718 | | else |
719 | | fIsScrolling = false; |
| 716 | |
| 717 | fIsScrolling = fVertical ? Window()->Frame().bottom > screenFrame.bottom |
| 718 | : false; |
720 | 719 | } |
721 | 720 | |
722 | 721 | |
… |
… |
TExpandoMenuBar::monitor_team_windows(void* arg)
|
744 | 743 | // Set all WindowMenuItems to require an update. |
745 | 744 | TWindowMenuItem* item = NULL; |
746 | 745 | for (int32 i = 0; i < totalItems; i++) { |
747 | | if (!teamMenu->SubmenuAt(i)){ |
| 746 | if (!teamMenu->SubmenuAt(i)) { |
748 | 747 | item = static_cast<TWindowMenuItem*>(teamMenu->ItemAt(i)); |
749 | 748 | item->SetRequireUpdate(); |
750 | 749 | } |
… |
… |
TExpandoMenuBar::monitor_team_windows(void* arg)
|
814 | 813 | |
815 | 814 | // Remove any remaining items which require an update. |
816 | 815 | for (int32 i = 0; i < totalItems; i++) { |
817 | | if (!teamMenu->SubmenuAt(i)){ |
| 816 | if (!teamMenu->SubmenuAt(i)) { |
818 | 817 | item = static_cast<TWindowMenuItem*>(teamMenu->ItemAt(i)); |
819 | 818 | if (item && item->RequiresUpdate()) { |
820 | 819 | item = static_cast<TWindowMenuItem*> |
diff --git a/src/apps/deskbar/PreferencesWindow.cpp b/src/apps/deskbar/PreferencesWindow.cpp
index e8fdf07..c7e6daa 100644
a
|
b
|
PreferencesWindow::PreferencesWindow(BRect frame)
|
83 | 83 | |
84 | 84 | // Values |
85 | 85 | TBarApp* barApp = static_cast<TBarApp*>(be_app); |
86 | | desk_settings* appSettings = barApp->Settings();; |
| 86 | desk_settings* appSettings = barApp->Settings(); |
87 | 87 | |
88 | 88 | fAppsSort->SetValue(appSettings->sortRunningApps); |
89 | 89 | fAppsSortTrackerFirst->SetValue(appSettings->trackerAlwaysFirst); |
diff --git a/src/apps/deskbar/Switcher.cpp b/src/apps/deskbar/Switcher.cpp
index 86df52d..30eaaa0 100644
a
|
b
|
TIconView::CacheIcons(TTeamGroup* teamGroup)
|
1893 | 1893 | void |
1894 | 1894 | TIconView::AnimateIcon(BBitmap* startIcon, BBitmap* endIcon) |
1895 | 1895 | { |
1896 | | BRect centerRect(kCenterSlot*kSlotSize, 0, |
| 1896 | BRect centerRect(kCenterSlot * kSlotSize, 0, |
1897 | 1897 | (kCenterSlot + 1) * kSlotSize - 1, kSlotSize - 1); |
1898 | 1898 | BRect startIconBounds = startIcon->Bounds(); |
1899 | 1899 | BRect bounds = Bounds(); |
diff --git a/src/apps/deskbar/TeamMenuItem.cpp b/src/apps/deskbar/TeamMenuItem.cpp
index cbd669f..1610105 100644
a
|
b
|
TTeamMenuItem::TTeamMenuItem(BList* team, BBitmap* icon, char* name, char* sig,
|
71 | 71 | } |
72 | 72 | |
73 | 73 | |
74 | | TTeamMenuItem::TTeamMenuItem(float width,float height,bool vertical) |
| 74 | TTeamMenuItem::TTeamMenuItem(float width, float height, bool vertical) |
75 | 75 | : BMenuItem("", NULL) |
76 | 76 | { |
77 | 77 | InitData(NULL, NULL, strdup(""), strdup(""), width, height, false, vertical); |
… |
… |
void
|
491 | 491 | TTeamMenuItem::ToggleExpandState(bool resizeWindow) |
492 | 492 | { |
493 | 493 | fExpanded = !fExpanded; |
494 | | |
| 494 | |
495 | 495 | if (fExpanded) { |
496 | 496 | // Populate Menu() with the stuff from SubMenu(). |
497 | 497 | TWindowMenu* sub = (static_cast<TWindowMenu*>(Submenu())); |
… |
… |
TTeamMenuItem::ToggleExpandState(bool resizeWindow)
|
503 | 503 | if (locked) |
504 | 504 | sub->UnlockLooper(); |
505 | 505 | |
506 | | if (sub->CountItems() > 1){ |
| 506 | if (sub->CountItems() > 1) { |
507 | 507 | TExpandoMenuBar* parent = static_cast<TExpandoMenuBar*>(Menu()); |
508 | 508 | int myindex = parent->IndexOf(this) + 1; |
509 | 509 | |