From c9d2a320a332f0a218d9da0a60f1782b63f97585 Mon Sep 17 00:00:00 2001 From: John Scipione Date: Mon, 6 Jan 2014 23:42:38 -0500 Subject: [PATCH] Deskbar: TTeamMenuItem changes * Add Icon() and SetIcon() methods. * Remove HasLabel() and SetHasLabel() methods, ExpandoMenuBar now gets this information from the settings file directly, rather than storing and syncing this information with the TTeamMenuItem class. * Move SetOverrideWidth(), SetOverrideHeight(), and SetArrowDirection() implementations to header. --- src/apps/deskbar/TeamMenuItem.cpp | 27 +++------------------------ src/apps/deskbar/TeamMenuItem.h | 16 ++++++++++------ 2 files changed, 13 insertions(+), 30 deletions(-) diff --git a/src/apps/deskbar/TeamMenuItem.cpp b/src/apps/deskbar/TeamMenuItem.cpp index 8567e87b75..660cd9d81b 100644 --- a/src/apps/deskbar/TeamMenuItem.cpp +++ b/src/apps/deskbar/TeamMenuItem.cpp @@ -116,20 +116,6 @@ TTeamMenuItem::Invoke(BMessage* message) } -void -TTeamMenuItem::SetOverrideWidth(float width) -{ - fOverrideWidth = width; -} - - -void -TTeamMenuItem::SetOverrideHeight(float height) -{ - fOverrideHeight = height; -} - - void TTeamMenuItem::SetOverrideSelected(bool selected) { @@ -139,16 +125,9 @@ TTeamMenuItem::SetOverrideSelected(bool selected) void -TTeamMenuItem::SetArrowDirection(int32 direction) -{ - fArrowDirection = direction; -} - - -void -TTeamMenuItem::SetHasLabel(bool drawLabel) -{ - fDrawLabel = drawLabel; +TTeamMenuItem::SetIcon(BBitmap* icon) { + delete fIcon; + fIcon = icon; } diff --git a/src/apps/deskbar/TeamMenuItem.h b/src/apps/deskbar/TeamMenuItem.h index 25559762bc..000ba201eb 100644 --- a/src/apps/deskbar/TeamMenuItem.h +++ b/src/apps/deskbar/TeamMenuItem.h @@ -60,15 +60,19 @@ public: status_t Invoke(BMessage* msg = NULL); - void SetOverrideWidth(float width); - void SetOverrideHeight(float height); + void SetOverrideWidth(float width) + { fOverrideWidth = width; }; + void SetOverrideHeight(float height) + { fOverrideHeight = height; }; void SetOverrideSelected(bool selected); - int32 ArrowDirection() const { return fArrowDirection; }; - void SetArrowDirection(int32 direction); + int32 ArrowDirection() const + { return fArrowDirection; }; + void SetArrowDirection(int32 direction) + { fArrowDirection = direction; }; - bool HasLabel() const { return fDrawLabel; }; - void SetHasLabel(bool drawLabel); + BBitmap* Icon() const { return fIcon; }; + void SetIcon(BBitmap* icon); bool IsExpanded() const { return fExpanded; }; void ToggleExpandState(bool resizeWindow);