TastyMenu: fixes to previous commits

Signed-off-by: Mavridis Philippe <mavridisf@gmail.com>
feat/minor-improvements
Mavridis Philippe 5 months ago
parent dcfb02cce1
commit e6830cb5db
No known key found for this signature in database
GPG Key ID: 93F66F98F906147D

@ -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()) {

@ -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;

Loading…
Cancel
Save