Improve fullscreen mode

Solves a bug with menu not starting in full screen mode after the config has been updated.

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

@ -82,7 +82,6 @@ MenuHandler::MenuHandler( TQWidget *parent, Prefs *prefs, char *name, WFlags fl)
readConfig(); readConfig();
setupColumns(); setupColumns();
updateWindowType();
setBackground(); setBackground();
//Searchline... //Searchline...
@ -492,8 +491,8 @@ void MenuHandler::readConfig()
void MenuHandler::updateConfig() void MenuHandler::updateConfig()
{ {
readConfig(); readConfig();
updateWindowType();
setBackground(); setBackground();
updateWindowType();
menu->dynamicList->setActionIconSize( _actionIconSize ); menu->dynamicList->setActionIconSize( _actionIconSize );
menu->rootList->setActionIconSize( _actionIconSize ); menu->rootList->setActionIconSize( _actionIconSize );
@ -572,12 +571,9 @@ void MenuHandler::popup(TQPoint pos)
else else
move(prefSkel->normalWindowX(), prefSkel->normalWindowY()); move(prefSkel->normalWindowX(), prefSkel->normalWindowY());
updateWindowType();
resize(w,h); resize(w,h);
show();
if (prefSkel->startFullScreen())
showFullScreen();
else
showNormal();
} }
void MenuHandler::initOldInstalledApps(KServiceGroup::Ptr group) void MenuHandler::initOldInstalledApps(KServiceGroup::Ptr group)
@ -1670,6 +1666,8 @@ void MenuHandler::menuModeChanged( int index )
void MenuHandler::updateWindowType() void MenuHandler::updateWindowType()
{ {
auto parentWidget = static_cast<TQWidget *>(parent()); auto parentWidget = static_cast<TQWidget *>(parent());
hide();
setWindowState(TQt::WindowNoState);
if (_isNormalWindow) { if (_isNormalWindow) {
reparent(parentWidget, TQt::WType_Dialog, pos()); reparent(parentWidget, TQt::WType_Dialog, pos());
@ -1677,9 +1675,10 @@ void MenuHandler::updateWindowType()
else { else {
if (prefSkel->startFullScreen()) { if (prefSkel->startFullScreen()) {
reparent(parentWidget, TQt::WType_TopLevel, pos()); reparent(parentWidget, TQt::WType_TopLevel, pos());
setWindowState(TQt::WindowFullScreen);
} }
else { else {
reparent(parentWidget, TQt::WType_Popup | TQt::WNoAutoErase, pos()); reparent(parentWidget, TQt::WType_Popup, pos());
} }
} }
} }
@ -1690,12 +1689,8 @@ void MenuHandler::switchWindowMode()
_isNormalWindow = !_isNormalWindow; _isNormalWindow = !_isNormalWindow;
prefSkel->setIsNormalWindow(_isNormalWindow); prefSkel->setIsNormalWindow(_isNormalWindow);
prefSkel->writeConfig(); prefSkel->writeConfig();
updateWindowType(); updateWindowType();
if (prefSkel->startFullScreen()) show();
showFullScreen();
else
showNormal();
menu->detachButton->setIconSet(TQPixmap(uic_findImage(_isNormalWindow ? "attach.png" : "detach.png"))); menu->detachButton->setIconSet(TQPixmap(uic_findImage(_isNormalWindow ? "attach.png" : "detach.png")));
} }

@ -56,7 +56,7 @@ TastyMenu::TastyMenu(const TQString& configFile, Type type, int actions, TQWidge
_showBigToolTip = kickerConf->readBoolEntry("EnableIconZoom", true); _showBigToolTip = kickerConf->readBoolEntry("EnableIconZoom", true);
button = new TastyButton(this); button = new TastyButton(this);
menuHandler = new MenuHandler(this, prefSkel, "MenuHandler", 0); menuHandler = new MenuHandler(this, prefSkel, "MenuHandler", WType_TopLevel);
connect (button, SIGNAL (pressed()), this, SLOT (clickSlot ())); connect (button, SIGNAL (pressed()), this, SLOT (clickSlot ()));
connect (menuHandler, SIGNAL(hidden()), this, SLOT(setButtonUp())); connect (menuHandler, SIGNAL(hidden()), this, SLOT(setButtonUp()));

Loading…
Cancel
Save