Ticket #7052: Deskbar_ExpandoMenuBar_cpp_style_fix.diff

File Deskbar_ExpandoMenuBar_cpp_style_fix.diff, 3.9 KB (added by jscipione, 13 years ago)
  • src/apps/deskbar/ExpandoMenuBar.cpp

    diff --git a/src/apps/deskbar/ExpandoMenuBar.cpp b/src/apps/deskbar/ExpandoMenuBar.cpp
    index 0fd4483..1622b67 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
    TExpandoMenuBar::AttachedToWindow()  
    118119            R_BeLogoIcon);
    119120        if (logoBitmap != NULL)
    120121            fBeMenuWidth = logoBitmap->Bounds().Width() + 16;
    121         fBeMenuItem = new TBarMenuTitle(fBeMenuWidth, Frame().Height(),
    122             logoBitmap, beMenu, true);
     122        fBeMenuItem = new TBarMenuTitle(fBeMenuWidth, Frame().Height(),
     123            logoBitmap, beMenu, true);
    123124        AddItem(fBeMenuItem);
    124125
    125126        fSeparatorItem = new TTeamMenuItem(kSepItemWidth, height, fVertical);
    TExpandoMenuBar::RemoveTeam(team_id team, bool partial)  
    584585                RemoveItem(i);
    585586
    586587                if (fVertical) {
    587                     //  instead of resizing the window here and there in the
    588                     //  code the resize method will be centered in one place
    589                     //  thus, the same behavior (good or bad) will be used
    590                     //  whereever window sizing is done
     588                    // instead of resizing the window here and there in the
     589                    // code the resize method will be centered in one place
     590                    // thus, the same behavior (good or bad) will be used
     591                    // whereever window sizing is done
    591592                    fBarView->SizeWindow(BScreen(Window()).Frame());
    592593                } else
    593594                    CheckItemSizes(-1);
    TExpandoMenuBar::CheckItemSizes(int32 delta)  
    613614
    614615    if (!fBarView->Vertical()) {
    615616        // in this case there are 2 extra items:
    616         //      The Be Menu
    617         //      The little separator item
     617        //   - The Be Menu
     618        //   - The little separator item
    618619        fullWidth = fullWidth - (sMinimumWindowWidth * 2)
    619620            + (fBeMenuWidth + kSepItemWidth);
    620621        width -= (fBeMenuWidth + kSepItemWidth);
    TExpandoMenuBar::CheckItemSizes(int32 delta)  
    624625    if (delta >= 0 && fullWidth > width) {
    625626        fOverflow = true;
    626627        reset = true;
    627         newWidth = floorf(width/count);
     628        newWidth = floorf(width / count);
    628629    } else if (delta < 0 && fOverflow) {
    629630        reset = true;
    630631        if (fullWidth > width)
    631             newWidth = floorf(width/count);
     632            newWidth = floorf(width / count);
    632633        else
    633634            newWidth = sMinimumWindowWidth;
    634635    }
    void  
    713714TExpandoMenuBar::CheckForSizeOverrun()
    714715{
    715716    BRect screenFrame = (BScreen(Window())).Frame();
    716     if (fVertical)
    717         fIsScrolling = Window()->Frame().bottom > screenFrame.bottom;
    718     else
    719         fIsScrolling = false;
     717
     718    fIsScrolling = fVertical ? Window()->Frame().bottom > screenFrame.bottom
     719        : false;
    720720}
    721721
    722722
    TExpandoMenuBar::monitor_team_windows(void* arg)  
    744744            // Set all WindowMenuItems to require an update.
    745745            TWindowMenuItem* item = NULL;
    746746            for (int32 i = 0; i < totalItems; i++) {
    747                 if (!teamMenu->SubmenuAt(i)){
     747                if (!teamMenu->SubmenuAt(i)) {
    748748                    item = static_cast<TWindowMenuItem*>(teamMenu->ItemAt(i));
    749749                    item->SetRequireUpdate();
    750750                }
    TExpandoMenuBar::monitor_team_windows(void* arg)  
    814814
    815815            // Remove any remaining items which require an update.
    816816            for (int32 i = 0; i < totalItems; i++) {
    817                 if (!teamMenu->SubmenuAt(i)){
     817                if (!teamMenu->SubmenuAt(i)) {
    818818                    item = static_cast<TWindowMenuItem*>(teamMenu->ItemAt(i));
    819819                    if (item && item->RequiresUpdate()) {
    820820                        item = static_cast<TWindowMenuItem*>