From fe624b3937dc8b7a4551dbc66b5e5c81dfb468d6 Mon Sep 17 00:00:00 2001 From: John Scipione Date: Sun, 14 Apr 2013 01:53:03 -0400 Subject: [PATCH] Style fixes only Most indentation and newlines with a few comment updates --- src/apps/deskbar/BarApp.cpp | 32 +++++++++++++++++-------------- src/apps/deskbar/BarMenuBar.cpp | 5 +++-- src/apps/deskbar/BarMenuTitle.cpp | 13 +++++++------ src/apps/deskbar/BarMenuTitle.h | 2 +- src/apps/deskbar/BarView.cpp | 2 +- src/apps/deskbar/BarView.h | 2 +- src/apps/deskbar/BarWindow.cpp | 1 + src/apps/deskbar/DeskbarMenu.cpp | 3 ++- src/apps/deskbar/TeamMenuItem.cpp | 2 ++ 9 files changed, 36 insertions(+), 26 deletions(-) diff --git a/src/apps/deskbar/BarApp.cpp b/src/apps/deskbar/BarApp.cpp index 9838653891..f6c604ea6a 100644 --- a/src/apps/deskbar/BarApp.cpp +++ b/src/apps/deskbar/BarApp.cpp @@ -92,10 +92,11 @@ main() TBarApp::TBarApp() - : BApplication(kDeskbarSignature), - fSettingsFile(NULL), - fClockSettingsFile(NULL), - fPreferencesWindow(NULL) + : + BApplication(kDeskbarSignature), + fSettingsFile(NULL), + fClockSettingsFile(NULL), + fPreferencesWindow(NULL) { InitSettings(); InitIconPreloader(); @@ -585,6 +586,7 @@ TBarApp::MessageReceived(BMessage* message) if (fPreferencesWindow != NULL) fPreferencesWindow->PostMessage(kUpdatePreferences); + break; } @@ -952,22 +954,24 @@ TBarApp::IconRect() BarTeamInfo::BarTeamInfo(BList* teams, uint32 flags, char* sig, BBitmap* icon, char* name) - : teams(teams), - flags(flags), - sig(sig), - icon(icon), - name(name) + : + teams(teams), + flags(flags), + sig(sig), + icon(icon), + name(name) { _Init(); } BarTeamInfo::BarTeamInfo(const BarTeamInfo &info) - : teams(new BList(*info.teams)), - flags(info.flags), - sig(strdup(info.sig)), - icon(new BBitmap(*info.icon)), - name(strdup(info.name)) + : + teams(new BList(*info.teams)), + flags(info.flags), + sig(strdup(info.sig)), + icon(new BBitmap(*info.icon)), + name(strdup(info.name)) { _Init(); } diff --git a/src/apps/deskbar/BarMenuBar.cpp b/src/apps/deskbar/BarMenuBar.cpp index 1383bd68e2..8725863ca6 100644 --- a/src/apps/deskbar/BarMenuBar.cpp +++ b/src/apps/deskbar/BarMenuBar.cpp @@ -221,14 +221,15 @@ TBarMenuBar::MouseMoved(BPoint where, uint32 code, const BMessage* message) BPoint loc; uint32 buttons; GetMouse(&loc, &buttons); - // attempt to start DnD tracking - if (message && buttons != 0) { + if (message != NULL && buttons != 0) { + // attempt to start DnD tracking fBarView->CacheDragData(const_cast(message)); MouseDown(loc); } break; } } + BMenuBar::MouseMoved(where, code, message); } diff --git a/src/apps/deskbar/BarMenuTitle.cpp b/src/apps/deskbar/BarMenuTitle.cpp index cf877a1fb6..36877d4783 100644 --- a/src/apps/deskbar/BarMenuTitle.cpp +++ b/src/apps/deskbar/BarMenuTitle.cpp @@ -47,12 +47,13 @@ All rights reserved. TBarMenuTitle::TBarMenuTitle(float width, float height, const BBitmap* icon, - BMenu* menu, bool inexpando) - : BMenuItem(menu, new BMessage(B_REFS_RECEIVED)), - fWidth(width), - fHeight(height), - fInExpando(inexpando), - fIcon(icon) + BMenu* menu, bool expando) + : + BMenuItem(menu, new BMessage(B_REFS_RECEIVED)), + fWidth(width), + fHeight(height), + fInExpando(expando), + fIcon(icon) { } diff --git a/src/apps/deskbar/BarMenuTitle.h b/src/apps/deskbar/BarMenuTitle.h index 0a4a9f6b40..94caceb26c 100644 --- a/src/apps/deskbar/BarMenuTitle.h +++ b/src/apps/deskbar/BarMenuTitle.h @@ -70,4 +70,4 @@ private: }; -#endif /* BARMENUTITLE_H */ +#endif // BARMENUTITLE_H diff --git a/src/apps/deskbar/BarView.cpp b/src/apps/deskbar/BarView.cpp index 8969a0d652..1702e5f13c 100644 --- a/src/apps/deskbar/BarView.cpp +++ b/src/apps/deskbar/BarView.cpp @@ -519,7 +519,7 @@ TBarView::PlaceApplicationBar() SizeWindow(screenFrame); PositionWindow(screenFrame); fExpandoMenuBar->DoLayout(); - // force menu to autosize + // force menu to resize CheckForScrolling(); Window()->UpdateIfNeeded(); Invalidate(); diff --git a/src/apps/deskbar/BarView.h b/src/apps/deskbar/BarView.h index 3f9b1445b6..d6f53900ec 100644 --- a/src/apps/deskbar/BarView.h +++ b/src/apps/deskbar/BarView.h @@ -234,4 +234,4 @@ TBarView::CachedTypesList() const } -#endif /* BARVIEW_H */ +#endif // BARVIEW_H diff --git a/src/apps/deskbar/BarWindow.cpp b/src/apps/deskbar/BarWindow.cpp index addf402f8e..08adad8aef 100644 --- a/src/apps/deskbar/BarWindow.cpp +++ b/src/apps/deskbar/BarWindow.cpp @@ -100,6 +100,7 @@ TBarWindow::TBarWindow() desk_settings* settings = ((TBarApp*)be_app)->Settings(); if (settings->alwaysOnTop) SetFeel(B_FLOATING_ALL_WINDOW_FEEL); + fBarView = new TBarView(Bounds(), settings->vertical, settings->left, settings->top, settings->state, settings->width); AddChild(fBarView); diff --git a/src/apps/deskbar/DeskbarMenu.cpp b/src/apps/deskbar/DeskbarMenu.cpp index 24d526505b..60d7567f34 100644 --- a/src/apps/deskbar/DeskbarMenu.cpp +++ b/src/apps/deskbar/DeskbarMenu.cpp @@ -88,7 +88,8 @@ using namespace BPrivate; TDeskbarMenu::TDeskbarMenu(TBarView* barView) - : BNavMenu("DeskbarMenu", B_REFS_RECEIVED, DefaultTarget()), + : + BNavMenu("DeskbarMenu", B_REFS_RECEIVED, DefaultTarget()), fAddState(kStart), fBarView(barView) { diff --git a/src/apps/deskbar/TeamMenuItem.cpp b/src/apps/deskbar/TeamMenuItem.cpp index 76d20f09e4..7c393cd594 100644 --- a/src/apps/deskbar/TeamMenuItem.cpp +++ b/src/apps/deskbar/TeamMenuItem.cpp @@ -190,6 +190,7 @@ TTeamMenuItem::Draw() { BRect frame(Frame()); BMenu* menu = Menu(); + menu->PushState(); rgb_color menuColor = menu->LowColor(); @@ -224,6 +225,7 @@ TTeamMenuItem::Draw() menu->MovePenTo(ContentLocation()); DrawContent(); + menu->PopState(); }