diff --git a/src/apps/deskbar/BarView.cpp b/src/apps/deskbar/BarView.cpp
index 53dfeec..cac3472 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 | |
… |
… |
TBarView::Draw(BRect)
|
135 | 136 | rgb_color light = tint_color(ViewColor(), B_LIGHTEN_2_TINT); |
136 | 137 | |
137 | 138 | SetHighColor(hilite); |
138 | | if (AcrossTop()) |
| 139 | if (AcrossTop()) |
139 | 140 | StrokeLine(bounds.LeftBottom(), bounds.RightBottom()); |
140 | | else if (AcrossBottom()) |
| 141 | else if (AcrossBottom()) |
141 | 142 | StrokeLine(bounds.LeftTop(), bounds.RightTop()); |
142 | 143 | |
143 | 144 | if (Vertical() && Expando()) { |
… |
… |
TBarView::MessageReceived(BMessage* message)
|
166 | 167 | // so that I can follow the common pathway |
167 | 168 | // for adding icons to the tray |
168 | 169 | int32 id; |
169 | | AddItem(new BMessage(*message), B_DESKBAR_TRAY, &id); |
| 170 | AddItem(new BMessage(*message), B_DESKBAR_TRAY, &id); |
170 | 171 | break; |
171 | 172 | } |
172 | 173 | |
… |
… |
TBarView::PlaceBeMenu()
|
206 | 207 | fBarMenuBar = NULL; |
207 | 208 | } |
208 | 209 | |
209 | | // top or bottom expando mode has Be menu built in for tracking |
210 | | // only for vertical mini or expanded |
211 | | // mini mode will have team menu added as part of BarMenuBar |
| 210 | // top or bottom expando mode has Be menu built in for tracking |
| 211 | // only for vertical mini or expanded |
| 212 | // mini mode will have team menu added as part of BarMenuBar |
212 | 213 | if (fVertical && !fBarMenuBar) { |
213 | 214 | // create the Be menu |
214 | 215 | BRect mbarFrame(Bounds()); |
… |
… |
TBarView::PlaceBeMenu()
|
217 | 218 | AddChild(fBarMenuBar); |
218 | 219 | } |
219 | 220 | |
220 | | // if there isn't a bemenu at this point, |
221 | | // DB should be in top/bottom mode, else error |
| 221 | // if there isn't a bemenu at this point, |
| 222 | // DB should be in top/bottom mode, else error |
222 | 223 | if (!fBarMenuBar) |
223 | 224 | return; |
224 | | |
| 225 | |
225 | 226 | float width = sMinimumWindowWidth; |
226 | 227 | BPoint loc(B_ORIGIN); |
227 | 228 | BRect menuFrame(fBarMenuBar->Frame()); |
… |
… |
TBarView::PlaceBeMenu()
|
237 | 238 | else |
238 | 239 | width = floorf(width) / 2; |
239 | 240 | loc = Bounds().LeftTop(); |
240 | | } else |
| 241 | } else { |
241 | 242 | // mini mode, BeMenu next to team menu |
242 | 243 | fBarMenuBar->AddTeamMenu(); |
| 244 | } |
243 | 245 | |
244 | 246 | fBarMenuBar->SmartResize(width, menuFrame.Height()); |
245 | 247 | fBarMenuBar->MoveTo(loc); |
… |
… |
TBarView::PlaceTray(bool, bool, BRect screenFrame)
|
257 | 259 | fDragRegion->MoveTo(statusLoc); |
258 | 260 | |
259 | 261 | if (!fReplicantTray->IsHidden()) |
260 | | fReplicantTray->Hide(); |
| 262 | fReplicantTray->Hide(); |
261 | 263 | |
262 | 264 | return; |
263 | 265 | } |
264 | 266 | |
265 | 267 | if (fReplicantTray->IsHidden()) |
266 | | fReplicantTray->Show(); |
| 268 | fReplicantTray->Show(); |
267 | 269 | |
268 | 270 | if (fTrayLocation != 0) { |
269 | 271 | fReplicantTray->SetMultiRow(fVertical); |
… |
… |
TBarView::GetPreferredWindowSize(BRect screenFrame, float* width, float* height)
|
347 | 349 | } |
348 | 350 | } else { |
349 | 351 | // four corners |
350 | | if (fTrayLocation != 0) |
| 352 | if (fTrayLocation != 0) |
351 | 353 | windowHeight = fDragRegion->Frame().bottom; |
352 | 354 | else |
353 | 355 | windowHeight = fBarMenuBar->Frame().bottom; |
… |
… |
TBarView::SaveSettings()
|
404 | 406 | settings->state = (uint32)State(); |
405 | 407 | settings->width = 0; |
406 | 408 | settings->showTime = ShowingClock(); |
407 | | |
| 409 | |
408 | 410 | fReplicantTray->RememberClockSettings(); |
409 | | settings->alwaysOnTop = (Window()->Feel() & B_FLOATING_ALL_WINDOW_FEEL) |
410 | | != 0; |
| 411 | settings->alwaysOnTop |
| 412 | = (Window()->Feel() & B_FLOATING_ALL_WINDOW_FEEL) != 0; |
411 | 413 | } |
412 | 414 | |
413 | 415 | |
… |
… |
TBarView::UpdateAutoRaise()
|
424 | 426 | void |
425 | 427 | TBarView::UpdatePlacement() |
426 | 428 | { |
427 | | ChangeState(fState, fVertical, fLeft, fTop); |
| 429 | ChangeState(fState, fVertical, fLeft, fTop); |
428 | 430 | } |
429 | 431 | |
430 | 432 | |
… |
… |
TBarView::ChangeState(int32 state, bool vertical, bool left, bool top)
|
455 | 457 | BString* signature = NULL; |
456 | 458 | if (fVertical && Expando() |
457 | 459 | && static_cast<TBarApp*>(be_app)->Settings()->superExpando) { |
458 | | // Get a list of the signatures of expanded apps. Can't use |
| 460 | // Get a list of the signatures of expanded apps. Can't use |
459 | 461 | // team_id because there can be more than one team per application |
460 | 462 | if (fVertical && Expando() && vertical && fExpando) { |
461 | 463 | for (int index = 0; index < fExpando->CountItems(); index++) { |
… |
… |
TBarView::ChangeState(int32 state, bool vertical, bool left, bool top)
|
469 | 471 | } |
470 | 472 | } |
471 | 473 | |
472 | | PlaceApplicationBar(screenFrame); |
473 | | SizeWindow(screenFrame); |
474 | | PositionWindow(screenFrame); |
475 | | Window()->UpdateIfNeeded(); |
| 474 | PlaceApplicationBar(screenFrame); |
| 475 | SizeWindow(screenFrame); |
| 476 | PositionWindow(screenFrame); |
| 477 | Window()->UpdateIfNeeded(); |
476 | 478 | |
477 | 479 | // Re-expand those apps. |
478 | 480 | if (expandedItems.CountItems() > 0) { |
… |
… |
TBarView::ChangeState(int32 state, bool vertical, bool left, bool top)
|
505 | 507 | } |
506 | 508 | |
507 | 509 | |
508 | | // window placement functions |
| 510 | // window placement functions |
509 | 511 | |
510 | 512 | bool |
511 | 513 | TBarView::Vertical() const |
… |
… |
TBarView::State() const
|
558 | 560 | |
559 | 561 | // optional functionality functions |
560 | 562 | |
561 | | bool |
| 563 | bool |
562 | 564 | TBarView::MilTime() const |
563 | 565 | { |
564 | 566 | return fShowInterval; |
… |
… |
void
|
586 | 588 | TBarView::CacheDragData(const BMessage* incoming) |
587 | 589 | { |
588 | 590 | if (!incoming) |
589 | | return; |
| 591 | return; |
590 | 592 | |
591 | 593 | if (Dragging() && SpringLoadedFolderCompareMessages(incoming, fDragMessage)) |
592 | 594 | return; |
… |
… |
init_tracking_hook(BMenuItem* item,
|
614 | 616 | |
615 | 617 | status_t |
616 | 618 | TBarView::DragStart() |
617 | | { |
| 619 | { |
618 | 620 | if (!Dragging()) |
619 | 621 | return B_OK; |
620 | 622 | |
… |
… |
TBarView::DragStart()
|
624 | 626 | |
625 | 627 | if (fExpando && fExpando->Frame().Contains(loc)) { |
626 | 628 | ConvertToScreen(&loc); |
627 | | BPoint expandoLocation = fExpando->ConvertFromScreen(loc); |
| 629 | BPoint expandoLocation = fExpando->ConvertFromScreen(loc); |
628 | 630 | TTeamMenuItem* item = fExpando->TeamItemAtPoint(expandoLocation); |
629 | 631 | |
630 | 632 | if (fLastDragItem) |
… |
… |
TBarView::DragStart()
|
634 | 636 | if (item == fLastDragItem) |
635 | 637 | return B_OK; |
636 | 638 | |
637 | | fLastDragItem = item; |
638 | | } |
| 639 | fLastDragItem = item; |
| 640 | } |
639 | 641 | } |
640 | 642 | |
641 | 643 | return B_OK; |
… |
… |
TBarView::MenuTrackingHook(BMenu* menu, void* castToThis)
|
676 | 678 | |
677 | 679 | if (bemenu && bemenu->LockLooper()) { |
678 | 680 | bemenu->ConvertFromScreen(&location); |
679 | | if (bemenu->Frame().Contains(location)) |
| 681 | if (bemenu->Frame().Contains(location)) |
680 | 682 | endMenu = false; |
681 | 683 | |
682 | 684 | bemenu->UnlockLooper(); |
… |
… |
TBarView::MenuTrackingHook(BMenu* menu, void* castToThis)
|
685 | 687 | if (endMenu && expando) { |
686 | 688 | expando->ConvertFromScreen(&location); |
687 | 689 | BMenuItem* item = expando->TeamItemAtPoint(location); |
688 | | if (item) |
| 690 | if (item) |
689 | 691 | endMenu = false; |
690 | 692 | } |
691 | 693 | barview->UnlockLooper(); |
… |
… |
TBarView::AppCanHandleTypes(const char* signature)
|
757 | 759 | if (appmime.GetAppHint(&hintref) != B_OK) |
758 | 760 | return false; |
759 | 761 | |
760 | | // an app was found, now see if it supports any of |
| 762 | // an app was found, now see if it supports any of |
761 | 763 | // the refs in the message |
762 | 764 | BFile file(&hintref, O_RDONLY); |
763 | 765 | BAppFileInfo fileinfo(&file); |
… |
… |
TBarView::AppCanHandleTypes(const char* signature)
|
768 | 770 | |
769 | 771 | int32 count = fCachedTypesList->CountItems(); |
770 | 772 | for (int32 i = 0 ; i < count ; i++) { |
771 | | if (fileinfo.IsSupportedType(fCachedTypesList->ItemAt(i)->String())) |
| 773 | if (fileinfo.IsSupportedType(fCachedTypesList->ItemAt(i)->String())) |
772 | 774 | return true; |
773 | 775 | } |
774 | 776 | |
… |
… |
TBarView::ItemExists(const char* name, DeskbarShelf)
|
910 | 912 | |
911 | 913 | int32 |
912 | 914 | TBarView::CountItems(DeskbarShelf) |
913 | | { |
914 | | return fReplicantTray->IconCount(); |
915 | | } |
| 915 | { |
| 916 | return fReplicantTray->IconCount(); |
| 917 | } |
916 | 918 | |
917 | 919 | |
918 | 920 | status_t |