|
|
@ -45,7 +45,6 @@
|
|
|
|
TastyMenu::TastyMenu(const TQString& configFile, Type type, int actions, TQWidget *parent, const char *name)
|
|
|
|
TastyMenu::TastyMenu(const TQString& configFile, Type type, int actions, TQWidget *parent, const char *name)
|
|
|
|
: KPanelApplet(configFile, type, actions, parent, name), numNewApplications(0)
|
|
|
|
: KPanelApplet(configFile, type, actions, parent, name), numNewApplications(0)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
// Get the current application configuration handle
|
|
|
|
// Get the current application configuration handle
|
|
|
|
kConfig = sharedConfig();
|
|
|
|
kConfig = sharedConfig();
|
|
|
|
prefSkel = new Prefs(kConfig);
|
|
|
|
prefSkel = new Prefs(kConfig);
|
|
|
@ -113,10 +112,10 @@ void TastyMenu::loadMenuButtonIcon()
|
|
|
|
//the tooltip has the same icon as the button
|
|
|
|
//the tooltip has the same icon as the button
|
|
|
|
menuTip->loadIcon( _menuButtonIcon );
|
|
|
|
menuTip->loadIcon( _menuButtonIcon );
|
|
|
|
|
|
|
|
|
|
|
|
if( prefSkel->menuButtonIconType()
|
|
|
|
if( prefSkel->menuButtonIconType() != Prefs::EnumMenuButtonIconType::Icon )
|
|
|
|
== Prefs::EnumMenuButtonIconType::IconNone )
|
|
|
|
|
|
|
|
{
|
|
|
|
{
|
|
|
|
button->setIconSet(TQIconSet());
|
|
|
|
button->setIconSet(TQIconSet());
|
|
|
|
|
|
|
|
_iconsize = 0;
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -354,13 +353,13 @@ void TastyMenu::setNewApplicationsMessage( int number )
|
|
|
|
|
|
|
|
|
|
|
|
int TastyMenu::widthForHeight(int height) const
|
|
|
|
int TastyMenu::widthForHeight(int height) const
|
|
|
|
{
|
|
|
|
{
|
|
|
|
int buttonWidth = width();
|
|
|
|
int buttonWidth = minimumWidth();
|
|
|
|
if( position() == pTop || position() == pBottom )
|
|
|
|
if( position() == pTop || position() == pBottom )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
button -> setTextPosition(TQToolButton::BesideIcon);
|
|
|
|
if( prefSkel->menuButtonLabelType() != Prefs::EnumMenuButtonLabelType::MenuButtonNone ) {
|
|
|
|
if( prefSkel->menuButtonLabelType()
|
|
|
|
button -> setTextPosition(TQToolButton::BesideIcon);
|
|
|
|
!= Prefs::EnumMenuButtonLabelType::MenuButtonNone )
|
|
|
|
|
|
|
|
return ((button->fontMetrics()).width(button->textLabel())) + _iconsize + 10;
|
|
|
|
return ((button->fontMetrics()).width(button->textLabel())) + _iconsize + 10;
|
|
|
|
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
return height;
|
|
|
|
return height;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -370,11 +369,10 @@ int TastyMenu::widthForHeight(int height) const
|
|
|
|
|
|
|
|
|
|
|
|
int TastyMenu::heightForWidth(int width) const
|
|
|
|
int TastyMenu::heightForWidth(int width) const
|
|
|
|
{
|
|
|
|
{
|
|
|
|
int buttonHeight = height();
|
|
|
|
int buttonHeight = minimumHeight();
|
|
|
|
if( position() == pLeft || position() == pRight )
|
|
|
|
if( position() == pLeft || position() == pRight )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if( prefSkel->menuButtonLabelType()
|
|
|
|
if( prefSkel->menuButtonLabelType() != Prefs::EnumMenuButtonLabelType::MenuButtonNone )
|
|
|
|
!= Prefs::EnumMenuButtonLabelType::MenuButtonNone )
|
|
|
|
|
|
|
|
{
|
|
|
|
{
|
|
|
|
button -> setTextPosition(TQToolButton::BelowIcon);
|
|
|
|
button -> setTextPosition(TQToolButton::BelowIcon);
|
|
|
|
return ((button->fontMetrics()).height()) + _iconsize + 10;
|
|
|
|
return ((button->fontMetrics()).height()) + _iconsize + 10;
|
|
|
|