diff options
Diffstat (limited to 'src/tastymenu.cpp')
| -rw-r--r-- | src/tastymenu.cpp | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/src/tastymenu.cpp b/src/tastymenu.cpp index 25c17db..652efa1 100644 --- a/src/tastymenu.cpp +++ b/src/tastymenu.cpp @@ -45,7 +45,6 @@ TastyMenu::TastyMenu(const TQString& configFile, Type type, int actions, TQWidget *parent, const char *name) : KPanelApplet(configFile, type, actions, parent, name), numNewApplications(0) { - // Get the current application configuration handle kConfig = sharedConfig(); prefSkel = new Prefs(kConfig); @@ -113,10 +112,10 @@ void TastyMenu::loadMenuButtonIcon() //the tooltip has the same icon as the button menuTip->loadIcon( _menuButtonIcon ); - if( prefSkel->menuButtonIconType() - == Prefs::EnumMenuButtonIconType::IconNone ) + if( prefSkel->menuButtonIconType() != Prefs::EnumMenuButtonIconType::Icon ) { button->setIconSet(TQIconSet()); + _iconsize = 0; return; } @@ -354,13 +353,13 @@ void TastyMenu::setNewApplicationsMessage( int number ) int TastyMenu::widthForHeight(int height) const { - int buttonWidth = width(); + int buttonWidth = minimumWidth(); if( position() == pTop || position() == pBottom ) { - button -> setTextPosition(TQToolButton::BesideIcon); - if( prefSkel->menuButtonLabelType() - != Prefs::EnumMenuButtonLabelType::MenuButtonNone ) + if( prefSkel->menuButtonLabelType() != Prefs::EnumMenuButtonLabelType::MenuButtonNone ) { + button -> setTextPosition(TQToolButton::BesideIcon); return ((button->fontMetrics()).width(button->textLabel())) + _iconsize + 10; + } else return height; } @@ -370,11 +369,10 @@ int TastyMenu::widthForHeight(int height) const int TastyMenu::heightForWidth(int width) const { - int buttonHeight = height(); + int buttonHeight = minimumHeight(); if( position() == pLeft || position() == pRight ) { - if( prefSkel->menuButtonLabelType() - != Prefs::EnumMenuButtonLabelType::MenuButtonNone ) + if( prefSkel->menuButtonLabelType() != Prefs::EnumMenuButtonLabelType::MenuButtonNone ) { button -> setTextPosition(TQToolButton::BelowIcon); return ((button->fontMetrics()).height()) + _iconsize + 10; |
