Ticket #7052: Deskbar_WindowMenu_cpp_style_fix.diff

File Deskbar_WindowMenu_cpp_style_fix.diff, 4.3 KB (added by jscipione, 13 years ago)
  • src/apps/deskbar/WindowMenu.cpp

    diff --git a/src/apps/deskbar/WindowMenu.cpp b/src/apps/deskbar/WindowMenu.cpp
    index 895b890..59e31fc 100644
    a b Except as contained in this notice, the name of Be Incorporated shall not be  
    2626used in advertising or otherwise to promote the sale, use or other dealings in
    2727this Software without prior written authorization from Be Incorporated.
    2828
    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.
     29Tracker(TM), Be(R), BeOS(R), and BeIA(TM) are trademarks or registered
     30trademarks of Be Incorporated in the United States and other countries. Other
     31brand product names are registered trademarks or trademarks of their respective
     32holders.
    3233All rights reserved.
    3334*/
    3435
    void  
    8889TWindowMenu::AttachedToWindow()
    8990{
    9091    SetFont(be_plain_font);
    91 
    9292    RemoveItems(0, CountItems(), true);
    93 
    9493    int32 miniCount = 0;
    9594
    9695    bool dragging = false;
    9796    TBarView* barview =(static_cast<TBarApp*>(be_app))->BarView();
    9897    if (barview && barview->LockLooper()) {
    99         //  'dragging' mode set in BarView::CacheDragData
    100         //      invoke in MouseEnter in ExpandoMenuBar
     98        // 'dragging' mode set in BarView::CacheDragData
     99        // invoke in MouseEnter in ExpandoMenuBar
    101100        dragging = barview->Dragging();
    102101        if (dragging) {
    103102            // We don't want to show the menu when dragging, but it's not
    TWindowMenu::AttachedToWindow()  
    105104            // Don't call BMenu::Hide(), it causes the menu to pop up every now
    106105            // and then.
    107106            Window()->Hide();
    108             //  if in expando (horizontal or vertical)
     107            // if in expando (horizontal or vertical)
    109108            if (barview->Expando()) {
    110109                SetTrackingHook(barview->MenuTrackingHook,
    111110                    barview->GetTrackingHookData());
    TWindowMenu::AttachedToWindow()  
    177176
    178177    int32 itemCount = CountItems() + parentMenuItems;
    179178    if (itemCount < 1) {
    180         TWindowMenuItem* noWindowsItem =
    181             new TWindowMenuItem(B_TRANSLATE("No windows"), -1, false, false);
     179        TWindowMenuItem* noWindowsItem
     180            = new TWindowMenuItem(B_TRANSLATE("No windows"), -1, false, false);
    182181
    183182        noWindowsItem->SetEnabled(false);
    184183
    TWindowMenu::AttachedToWindow()  
    186185
    187186        // if an application has no windows, this feature makes it easy to quit
    188187        // it. (but we only add this option if the application is not Tracker.)
    189         if (fApplicationSignature.ICompare(kTrackerSignature) != 0) {
     188        if (fApplicationSignature.ICompare(kTrackerSignature) != 0) {
    190189            AddSeparatorItem();
    191190            AddItem(new TShowHideMenuItem(B_TRANSLATE("Quit application"),
    192191                fTeam, B_QUIT_REQUESTED));
    193         }
     192        }
    194193    } else {
    195         //  if we are in drag mode, then don't add the window controls
    196         //  to the menu
     194        // if we are in drag mode, then don't add the window controls
     195        // to the menu
    197196        if (!dragging) {
    198             TShowHideMenuItem* hide =
    199                 new TShowHideMenuItem(B_TRANSLATE("Hide all"), fTeam,
     197            TShowHideMenuItem* hide
     198                = new TShowHideMenuItem(B_TRANSLATE("Hide all"), fTeam,
    200199                    B_MINIMIZE_WINDOW);
    201             TShowHideMenuItem* show =
    202                 new TShowHideMenuItem(B_TRANSLATE("Show all"), fTeam,
     200            TShowHideMenuItem* show
     201                = new TShowHideMenuItem(B_TRANSLATE("Show all"), fTeam,
    203202                    B_BRING_TO_FRONT);
    204             TShowHideMenuItem* close =
    205                 new TShowHideMenuItem(B_TRANSLATE("Close all"), fTeam,
     203            TShowHideMenuItem* close
     204                = new TShowHideMenuItem(B_TRANSLATE("Close all"), fTeam,
    206205                    B_QUIT_REQUESTED);
    207206
    208207            if (miniCount == itemCount)
    TWindowMenu::AttachedToWindow()  
    212211
    213212            if (!parentMenuItems)
    214213                AddSeparatorItem();
     214
    215215            AddItem(hide);
    216216            AddItem(show);
    217217            AddItem(close);
    TWindowMenu::AttachedToWindow()  
    225225void
    226226TWindowMenu::DetachedFromWindow()
    227227{
    228     // in expando mode the teammenu will not call DragStop,
    229     // thus, it needs to be called from here
     228    // in expando mode the teammenu will not call DragStop, thus, it needs to
     229    // be called from here
    230230    TBarView* barview = (dynamic_cast<TBarApp*>(be_app))->BarView();
    231231    if (barview && barview->Expando() && barview->Dragging()
    232232        && barview->LockLooper()) {
    233         // We changed the show level in AttachedToWindow().  Undo it.
     233        // We changed the show level in AttachedToWindow(). Undo it.
    234234        Window()->Show();
    235235        barview->DragStop();
    236236        barview->UnlockLooper();