summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMavridis Philippe <mavridisf@gmail.com>2023-11-21 15:05:20 +0200
committerMavridis Philippe <mavridisf@gmail.com>2023-11-21 15:05:20 +0200
commite6830cb5db0dc537fb1b0944a33bfd7eebc2c022 (patch)
tree0b1a03311f6c9bcf881b673b579d0c45a1065465
parentdcfb02cce1c025df28f1f8a2c1c485be12788946 (diff)
downloadtastymenu-feat/minor-improvements.tar.gz
tastymenu-feat/minor-improvements.zip
TastyMenu: fixes to previous commitsfeat/minor-improvements
Signed-off-by: Mavridis Philippe <mavridisf@gmail.com>
-rw-r--r--src/menuhandler.cpp9
-rw-r--r--src/tastymenu.cpp18
2 files changed, 16 insertions, 11 deletions
diff --git a/src/menuhandler.cpp b/src/menuhandler.cpp
index 1728439..4894a0a 100644
--- a/src/menuhandler.cpp
+++ b/src/menuhandler.cpp
@@ -30,7 +30,6 @@
#include <tqcursor.h>
#include <tqsplitter.h>
#include <tdepopupmenu.h>
-#include <tqobjectlist.h>
#include <kdebug.h>
#include <tqlabel.h>
#include <time.h>
@@ -482,6 +481,13 @@ void MenuHandler::updateConfig()
KServiceGroup::Ptr service = KServiceGroup::root();
menu->rootList->clear();
populateList( service, menu->rootList, NULL, false );
+
+ TQListViewItemIterator it(menu->childList);
+ while (it.current()) {
+ TastyListViewItem *listItem = static_cast<TastyListViewItem *>(it.current());
+ listItem->setDisplaySubText(_displaySubText);
+ ++it;
+ }
}
@@ -1676,6 +1682,7 @@ void MenuHandler::setBackground()
rootPix->stop();
delete rootPix;
rootPix = nullptr;
+ menu->unsetPalette();
}
if (isTransparent()) {
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;