diff --git a/src/apps/deskbar/BarApp.cpp b/src/apps/deskbar/BarApp.cpp
index 2647068..856a5f9 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::InitSettings()
|
313 | 311 | void |
314 | 312 | TBarApp::MessageReceived(BMessage* message) |
315 | 313 | { |
316 | | int32 count; |
317 | | bool enabled; |
318 | 314 | switch (message->what) { |
319 | 315 | case 'gloc': |
320 | 316 | case 'sloc': |
… |
… |
TBarApp::MessageReceived(BMessage* message)
|
353 | 349 | break; |
354 | 350 | |
355 | 351 | case kUpdateRecentCounts: |
| 352 | int32 count; |
| 353 | bool enabled; |
| 354 | |
356 | 355 | if (message->FindInt32("applications", &count) == B_OK) |
357 | 356 | fSettings.recentAppsCount = count; |
358 | 357 | if (message->FindBool("applicationsEnabled", &enabled) == B_OK) |
… |
… |
TBarApp::MessageReceived(BMessage* message)
|
423 | 422 | { |
424 | 423 | fSettings.autoRaise = !fSettings.autoRaise; |
425 | 424 | |
426 | | TBarView* barView = static_cast<TBarApp*>(be_app)->BarView(); |
427 | 425 | fBarWindow->Lock(); |
428 | | barView->UpdateAutoRaise(); |
| 426 | BarView()->UpdateAutoRaise(); |
429 | 427 | fBarWindow->Unlock(); |
430 | 428 | break; |
431 | 429 | } |
… |
… |
TBarApp::MessageReceived(BMessage* message)
|
434 | 432 | { |
435 | 433 | fSettings.trackerAlwaysFirst = !fSettings.trackerAlwaysFirst; |
436 | 434 | |
437 | | TBarView* barView = static_cast<TBarApp*>(be_app)->BarView(); |
438 | 435 | fBarWindow->Lock(); |
439 | | barView->UpdatePlacement(); |
| 436 | BarView()->UpdatePlacement(); |
440 | 437 | fBarWindow->Unlock(); |
441 | 438 | break; |
442 | 439 | } |
… |
… |
TBarApp::MessageReceived(BMessage* message)
|
445 | 442 | { |
446 | 443 | fSettings.sortRunningApps = !fSettings.sortRunningApps; |
447 | 444 | |
448 | | TBarView* barView = static_cast<TBarApp*>(be_app)->BarView(); |
449 | 445 | fBarWindow->Lock(); |
450 | | barView->UpdatePlacement(); |
| 446 | BarView()->UpdatePlacement(); |
451 | 447 | fBarWindow->Unlock(); |
452 | 448 | break; |
453 | 449 | } |
… |
… |
TBarApp::MessageReceived(BMessage* message)
|
464 | 460 | { |
465 | 461 | fSettings.superExpando = !fSettings.superExpando; |
466 | 462 | |
467 | | TBarView* barView = static_cast<TBarApp*>(be_app)->BarView(); |
468 | 463 | fBarWindow->Lock(); |
469 | | barView->UpdatePlacement(); |
| 464 | BarView()->UpdatePlacement(); |
470 | 465 | fBarWindow->Unlock(); |
471 | 466 | break; |
472 | 467 | } |
… |
… |
TBarApp::MessageReceived(BMessage* message)
|
475 | 470 | { |
476 | 471 | fSettings.expandNewTeams = !fSettings.expandNewTeams; |
477 | 472 | |
478 | | TBarView* barView = static_cast<TBarApp*>(be_app)->BarView(); |
479 | 473 | fBarWindow->Lock(); |
480 | | barView->UpdatePlacement(); |
| 474 | BarView()->UpdatePlacement(); |
481 | 475 | fBarWindow->Unlock(); |
482 | 476 | break; |
483 | 477 | } |
… |
… |
TBarApp::AddTeam(team_id team, uint32 flags, const char* sig, entry_ref* ref)
|
636 | 630 | BAppFileInfo appMime(&file); |
637 | 631 | |
638 | 632 | BarTeamInfo* barInfo = new BarTeamInfo(new BList(), flags, strdup(sig), |
639 | | new BBitmap(kIconSize, kIconFormat), strdup(ref->name)); |
| 633 | new BBitmap(kIconRect, kIconFormat), strdup(ref->name)); |
640 | 634 | |
641 | 635 | barInfo->teams->AddItem((void*)team); |
642 | 636 | if (appMime.GetIcon(barInfo->icon, B_MINI_ICON) != B_OK) |
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 53dfeec..73f269c 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()
|
634 | 634 | if (item == fLastDragItem) |
635 | 635 | return B_OK; |
636 | 636 | |
637 | | fLastDragItem = item; |
638 | | } |
| 637 | fLastDragItem = item; |
| 638 | } |
639 | 639 | } |
640 | 640 | |
641 | 641 | return B_OK; |
diff --git a/src/apps/deskbar/BarWindow.cpp b/src/apps/deskbar/BarWindow.cpp
index 26b02b7..756bfc6 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 0fd4483..e686078 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 aecbba7..ed3dea1 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 | |