diff --git a/src/apps/deskbar/BarApp.cpp b/src/apps/deskbar/BarApp.cpp
index 2647068..ffc1398 100644
a
|
b
|
Except as contained in this notice, the name of Be Incorporated shall not be
|
26 | 26 | used in advertising or otherwise to promote the sale, use or other dealings in |
27 | 27 | this Software without prior written authorization from Be Incorporated. |
28 | 28 | |
29 | | Tracker(TM), Be(R), BeOS(R), and BeIA(TM) are trademarks or registered trademarks |
30 | | of Be Incorporated in the United States and other countries. Other brand product |
31 | | names are registered trademarks or trademarks of their respective holders. |
| 29 | Tracker(TM), Be(R), BeOS(R), and BeIA(TM) are trademarks or registered |
| 30 | trademarks of Be Incorporated in the United States and other countries. Other |
| 31 | brand product names are registered trademarks or trademarks of their respective |
| 32 | holders. |
32 | 33 | All rights reserved. |
33 | 34 | */ |
34 | 35 | |
… |
… |
All rights reserved.
|
60 | 61 | #include "PublicCommands.h" |
61 | 62 | #include "ResourceSet.h" |
62 | 63 | #include "Switcher.h" |
63 | | #include "TeamMenu.h" |
64 | | #include "WindowMenuItem.h" |
65 | 64 | |
66 | 65 | |
67 | 66 | BLocker TBarApp::sSubscriberLock; |
… |
… |
BList TBarApp::sSubscribers;
|
72 | 71 | const uint32 kShowBeMenu = 'BeMn'; |
73 | 72 | const uint32 kShowTeamMenu = 'TmMn'; |
74 | 73 | |
75 | | const BRect kIconSize(0.0f, 0.0f, 15.0f, 15.0f); |
76 | 74 | |
| 75 | const BRect kIconRect(0.0f, 0.0f, 15.0f, 15.0f); |
77 | 76 | static const color_space kIconFormat = B_RGBA32; |
78 | 77 | |
79 | 78 | |
… |
… |
TBarApp::SaveSettings()
|
190 | 189 | storedSettings.AddFloat("width", fSettings.width); |
191 | 190 | storedSettings.AddBool("showTime", fSettings.showTime); |
192 | 191 | storedSettings.AddPoint("switcherLoc", fSettings.switcherLoc); |
193 | | storedSettings.AddInt32("recentAppsCount", |
194 | | fSettings.recentAppsCount); |
195 | | storedSettings.AddInt32("recentDocsCount", |
196 | | fSettings.recentDocsCount); |
197 | | storedSettings.AddBool("timeShowSeconds", |
198 | | fSettings.timeShowSeconds); |
| 192 | storedSettings.AddInt32("recentAppsCount", fSettings.recentAppsCount); |
| 193 | storedSettings.AddInt32("recentDocsCount", fSettings.recentDocsCount); |
| 194 | storedSettings.AddBool("timeShowSeconds", fSettings.timeShowSeconds); |
199 | 195 | storedSettings.AddInt32("recentFoldersCount", |
200 | 196 | fSettings.recentFoldersCount); |
201 | 197 | storedSettings.AddBool("alwaysOnTop", fSettings.alwaysOnTop); |
202 | 198 | storedSettings.AddBool("timeFullDate", fSettings.timeFullDate); |
203 | 199 | storedSettings.AddBool("trackerAlwaysFirst", |
204 | 200 | fSettings.trackerAlwaysFirst); |
205 | | storedSettings.AddBool("sortRunningApps", |
206 | | fSettings.sortRunningApps); |
207 | | storedSettings.AddBool("superExpando", |
208 | | fSettings.superExpando); |
209 | | storedSettings.AddBool("expandNewTeams", |
210 | | fSettings.expandNewTeams); |
211 | | storedSettings.AddBool("autoRaise", |
212 | | fSettings.autoRaise); |
| 201 | storedSettings.AddBool("sortRunningApps", fSettings.sortRunningApps); |
| 202 | storedSettings.AddBool("superExpando", fSettings.superExpando); |
| 203 | storedSettings.AddBool("expandNewTeams", fSettings.expandNewTeams); |
| 204 | storedSettings.AddBool("autoRaise", fSettings.autoRaise); |
213 | 205 | storedSettings.AddBool("recentAppsEnabled", |
214 | 206 | fSettings.recentAppsEnabled); |
215 | 207 | storedSettings.AddBool("recentDocsEnabled", |
… |
… |
TBarApp::InitSettings()
|
291 | 283 | &settings.trackerAlwaysFirst); |
292 | 284 | storedSettings.FindBool("sortRunningApps", |
293 | 285 | &settings.sortRunningApps); |
294 | | storedSettings.FindBool("superExpando", |
295 | | &settings.superExpando); |
296 | | storedSettings.FindBool("expandNewTeams", |
297 | | &settings.expandNewTeams); |
298 | | storedSettings.FindBool("autoRaise", |
299 | | &settings.autoRaise); |
| 286 | storedSettings.FindBool("superExpando", &settings.superExpando); |
| 287 | storedSettings.FindBool("expandNewTeams", &settings.expandNewTeams); |
| 288 | storedSettings.FindBool("autoRaise", &settings.autoRaise); |
300 | 289 | storedSettings.FindBool("recentAppsEnabled", |
301 | 290 | &settings.recentAppsEnabled); |
302 | 291 | storedSettings.FindBool("recentDocsEnabled", |
… |
… |
TBarApp::InitSettings()
|
313 | 302 | void |
314 | 303 | TBarApp::MessageReceived(BMessage* message) |
315 | 304 | { |
316 | | int32 count; |
317 | | bool enabled; |
318 | 305 | switch (message->what) { |
319 | 306 | case 'gloc': |
320 | 307 | case 'sloc': |
… |
… |
TBarApp::MessageReceived(BMessage* message)
|
353 | 340 | break; |
354 | 341 | |
355 | 342 | case kUpdateRecentCounts: |
| 343 | int32 count; |
| 344 | bool enabled; |
| 345 | |
356 | 346 | if (message->FindInt32("applications", &count) == B_OK) |
357 | 347 | fSettings.recentAppsCount = count; |
358 | 348 | if (message->FindBool("applicationsEnabled", &enabled) == B_OK) |
… |
… |
TBarApp::MessageReceived(BMessage* message)
|
413 | 403 | break; |
414 | 404 | |
415 | 405 | case kAlwaysTop: |
416 | | fSettings.alwaysOnTop = !fSettings.alwaysOnTop; |
| 406 | fSettings.alwaysOnTop = !fSettings.alwaysOnTop; |
417 | 407 | |
418 | | fBarWindow->SetFeel(fSettings.alwaysOnTop ? |
419 | | B_FLOATING_ALL_WINDOW_FEEL : B_NORMAL_WINDOW_FEEL); |
420 | | break; |
| 408 | fBarWindow->SetFeel(fSettings.alwaysOnTop ? |
| 409 | B_FLOATING_ALL_WINDOW_FEEL : B_NORMAL_WINDOW_FEEL); |
| 410 | break; |
421 | 411 | |
422 | 412 | case kAutoRaise: |
423 | | { |
424 | 413 | fSettings.autoRaise = !fSettings.autoRaise; |
425 | 414 | |
426 | | TBarView* barView = static_cast<TBarApp*>(be_app)->BarView(); |
427 | 415 | fBarWindow->Lock(); |
428 | | barView->UpdateAutoRaise(); |
| 416 | BarView()->UpdateAutoRaise(); |
429 | 417 | fBarWindow->Unlock(); |
430 | 418 | break; |
431 | | } |
432 | 419 | |
433 | 420 | case kTrackerFirst: |
434 | | { |
435 | 421 | fSettings.trackerAlwaysFirst = !fSettings.trackerAlwaysFirst; |
436 | 422 | |
437 | | TBarView* barView = static_cast<TBarApp*>(be_app)->BarView(); |
438 | 423 | fBarWindow->Lock(); |
439 | | barView->UpdatePlacement(); |
| 424 | BarView()->UpdatePlacement(); |
440 | 425 | fBarWindow->Unlock(); |
441 | 426 | break; |
442 | | } |
443 | 427 | |
444 | 428 | case kSortRunningApps: |
445 | | { |
446 | 429 | fSettings.sortRunningApps = !fSettings.sortRunningApps; |
447 | 430 | |
448 | | TBarView* barView = static_cast<TBarApp*>(be_app)->BarView(); |
449 | 431 | fBarWindow->Lock(); |
450 | | barView->UpdatePlacement(); |
| 432 | BarView()->UpdatePlacement(); |
451 | 433 | fBarWindow->Unlock(); |
452 | 434 | break; |
453 | | } |
454 | 435 | |
455 | 436 | case kUnsubscribe: |
456 | 437 | { |
… |
… |
TBarApp::MessageReceived(BMessage* message)
|
461 | 442 | } |
462 | 443 | |
463 | 444 | case kSuperExpando: |
464 | | { |
465 | 445 | fSettings.superExpando = !fSettings.superExpando; |
466 | 446 | |
467 | | TBarView* barView = static_cast<TBarApp*>(be_app)->BarView(); |
468 | 447 | fBarWindow->Lock(); |
469 | | barView->UpdatePlacement(); |
| 448 | BarView()->UpdatePlacement(); |
470 | 449 | fBarWindow->Unlock(); |
471 | 450 | break; |
472 | | } |
473 | 451 | |
474 | 452 | case kExpandNewTeams: |
475 | | { |
476 | 453 | fSettings.expandNewTeams = !fSettings.expandNewTeams; |
477 | 454 | |
478 | | TBarView* barView = static_cast<TBarApp*>(be_app)->BarView(); |
479 | 455 | fBarWindow->Lock(); |
480 | | barView->UpdatePlacement(); |
| 456 | BarView()->UpdatePlacement(); |
481 | 457 | fBarWindow->Unlock(); |
482 | 458 | break; |
483 | | } |
484 | 459 | |
485 | 460 | case 'TASK': |
486 | 461 | fSwitcherMessenger.SendMessage(message); |
… |
… |
TBarApp::AddTeam(team_id team, uint32 flags, const char* sig, entry_ref* ref)
|
636 | 611 | BAppFileInfo appMime(&file); |
637 | 612 | |
638 | 613 | BarTeamInfo* barInfo = new BarTeamInfo(new BList(), flags, strdup(sig), |
639 | | new BBitmap(kIconSize, kIconFormat), strdup(ref->name)); |
| 614 | new BBitmap(kIconRect, kIconFormat), strdup(ref->name)); |
640 | 615 | |
641 | 616 | barInfo->teams->AddItem((void*)team); |
642 | 617 | if (appMime.GetIcon(barInfo->icon, B_MINI_ICON) != B_OK) |
… |
… |
TBarApp::RemoveTeam(team_id team)
|
682 | 657 | int32 subsCount = sSubscribers.CountItems(); |
683 | 658 | if (subsCount > 0) { |
684 | 659 | BMessage message((barInfo->teams->CountItems() == 1) ? |
685 | | B_SOME_APP_QUIT : kRemoveTeam); |
| 660 | B_SOME_APP_QUIT : kRemoveTeam); |
686 | 661 | |
687 | 662 | message.AddInt32("team", team); |
688 | 663 | for (int32 i = 0; i < subsCount; i++) { |
… |
… |
TBarApp::ShowPreferencesWindow()
|
706 | 681 | { |
707 | 682 | if (fPreferencesWindow) |
708 | 683 | fPreferencesWindow->Activate(); |
709 | | else { |
| 684 | else { |
710 | 685 | fPreferencesWindow = new PreferencesWindow(BRect(0, 0, 320, 240)); |
711 | 686 | fPreferencesWindow->Show(); |
712 | 687 | } |