@ -1,4 +1,3 @@
/***************************************************************************
* Copyright ( C ) 2006 - 2007 by Marco Martin *
* notmart @ gmail . com *
@ -30,14 +29,16 @@
# include <tqfile.h>
# include <tqcursor.h>
# include <tdepopupmenu.h>
# include <tqobjectlist.h>
# include <kdebug.h>
# include <tqlabel.h>
# include <time.h>
# include "menuhandler.h"
# include "buttons.h"
MenuHandler : : MenuHandler ( TQWidget * parent , Prefs * prefs , char * name , WFlags fl )
: TQFrame ( parent , name , fl ) , searchMode ( false )
: TQFrame ( parent , name , fl ) , searchMode ( false ) , rootPix ( nullptr )
{
prefSkel = prefs ;
@ -82,6 +83,7 @@ MenuHandler::MenuHandler( TQWidget *parent, Prefs *prefs, char *name, WFlags fl)
readConfig ( ) ;
setupColumns ( ) ;
updateWindowType ( ) ;
setBackground ( ) ;
//Searchline...
iconLoader = TDEGlobal : : iconLoader ( ) ;
@ -139,6 +141,7 @@ MenuHandler::MenuHandler( TQWidget *parent, Prefs *prefs, char *name, WFlags fl)
sessionsMenu = new TQPopupMenu ( ) ;
menu - > switchButton - > setPopup ( sessionsMenu ) ;
menu - > allAppsFrame - > setPaletteBackgroundColor ( colorGroup ( ) . background ( ) ) ;
initializeRecentlyUsed ( ) ;
@ -490,6 +493,7 @@ void MenuHandler::updateConfig()
{
readConfig ( ) ;
updateWindowType ( ) ;
setBackground ( ) ;
menu - > dynamicList - > setActionIconSize ( _actionIconSize ) ;
menu - > rootList - > setActionIconSize ( _actionIconSize ) ;
@ -501,7 +505,7 @@ void MenuHandler::updateConfig()
menuModeChanged ( _menuMode ) ;
KServiceGroup : : Ptr service = KServiceGroup : : root ( ) ;
menu - > rootList - > clear ( ) ;
populateList ( service , menu - > rootList , NULL , false ) ;
populateList ( service , menu - > rootList , NULL , false ) ;
}
@ -518,10 +522,8 @@ void MenuHandler::mousePressEvent( TQMouseEvent *e)
}
}
void MenuHandler : : closeEvent ( TQCloseEvent * e )
void MenuHandler : : closeEvent ( TQCloseEvent * e )
{
e = e ;
if ( _isNormalWindow )
{
prefSkel - > setNormalWindowWidth ( width ( ) ) ;
@ -1697,5 +1699,29 @@ void MenuHandler::switchWindowMode()
menu - > detachButton - > setIconSet ( TQPixmap ( uic_findImage ( _isNormalWindow ? " attach.png " : " detach.png " ) ) ) ;
}
void MenuHandler : : setBackground ( )
{
if ( rootPix ) {
rootPix - > stop ( ) ;
delete rootPix ;
rootPix = nullptr ;
}
if ( prefSkel - > transparent ( ) ) {
rootPix = new KRootPixmap ( this ) ;
rootPix - > setCustomPainting ( true ) ;
rootPix - > setBlurEffect ( 0.0 , prefSkel - > blurBackground ( ) ? 4.0 : 0.0 ) ;
connect ( rootPix , TQT_SIGNAL ( backgroundUpdated ( const TQPixmap & ) ) ,
TQT_SLOT ( updateBackground ( const TQPixmap & ) ) ) ;
rootPix - > start ( ) ;
}
}
void MenuHandler : : updateBackground ( const TQPixmap & pix )
{
menu - > setPaletteBackgroundPixmap ( pix ) ;
}
# include "menuhandler.moc"
//EOF