diff options
author | Mavridis Philippe <mavridisf@gmail.com> | 2023-10-29 14:29:38 +0200 |
---|---|---|
committer | Mavridis Philippe <mavridisf@gmail.com> | 2023-10-29 15:12:37 +0200 |
commit | a524c4c5c678bce1849428515d41ac5fe3a45ee3 (patch) | |
tree | 2146ef8fa4237c88f5ada54bfa79e40f5c9e503f | |
parent | 6d92006da35d74aa4aa72c5ca679aec5db125de8 (diff) | |
download | tastymenu-a524c4c5c678bce1849428515d41ac5fe3a45ee3.tar.gz tastymenu-a524c4c5c678bce1849428515d41ac5fe3a45ee3.zip |
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>
-rw-r--r-- | src/menuhandler.cpp | 21 | ||||
-rw-r--r-- | src/tastymenu.cpp | 2 |
2 files changed, 9 insertions, 14 deletions
diff --git a/src/menuhandler.cpp b/src/menuhandler.cpp index e0c226f..1899029 100644 --- a/src/menuhandler.cpp +++ b/src/menuhandler.cpp @@ -82,7 +82,6 @@ MenuHandler::MenuHandler( TQWidget *parent, Prefs *prefs, char *name, WFlags fl) readConfig(); setupColumns(); - updateWindowType(); setBackground(); //Searchline... @@ -492,8 +491,8 @@ void MenuHandler::readConfig() void MenuHandler::updateConfig() { readConfig(); - updateWindowType(); setBackground(); + updateWindowType(); menu->dynamicList->setActionIconSize( _actionIconSize ); menu->rootList->setActionIconSize( _actionIconSize ); @@ -572,12 +571,9 @@ void MenuHandler::popup(TQPoint pos) else move(prefSkel->normalWindowX(), prefSkel->normalWindowY()); + updateWindowType(); resize(w,h); - - if (prefSkel->startFullScreen()) - showFullScreen(); - else - showNormal(); + show(); } void MenuHandler::initOldInstalledApps(KServiceGroup::Ptr group) @@ -1670,6 +1666,8 @@ void MenuHandler::menuModeChanged( int index ) void MenuHandler::updateWindowType() { auto parentWidget = static_cast<TQWidget *>(parent()); + hide(); + setWindowState(TQt::WindowNoState); if (_isNormalWindow) { reparent(parentWidget, TQt::WType_Dialog, pos()); @@ -1677,9 +1675,10 @@ void MenuHandler::updateWindowType() else { if (prefSkel->startFullScreen()) { reparent(parentWidget, TQt::WType_TopLevel, pos()); + setWindowState(TQt::WindowFullScreen); } else { - reparent(parentWidget, TQt::WType_Popup | TQt::WNoAutoErase, pos()); + reparent(parentWidget, TQt::WType_Popup, pos()); } } } @@ -1690,12 +1689,8 @@ void MenuHandler::switchWindowMode() _isNormalWindow = !_isNormalWindow; prefSkel->setIsNormalWindow(_isNormalWindow); prefSkel->writeConfig(); - updateWindowType(); - if (prefSkel->startFullScreen()) - showFullScreen(); - else - showNormal(); + show(); menu->detachButton->setIconSet(TQPixmap(uic_findImage(_isNormalWindow ? "attach.png" : "detach.png"))); } diff --git a/src/tastymenu.cpp b/src/tastymenu.cpp index 2b8520c..25c17db 100644 --- a/src/tastymenu.cpp +++ b/src/tastymenu.cpp @@ -56,7 +56,7 @@ TastyMenu::TastyMenu(const TQString& configFile, Type type, int actions, TQWidge _showBigToolTip = kickerConf->readBoolEntry("EnableIconZoom", true); 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 (menuHandler, SIGNAL(hidden()), this, SLOT(setButtonUp())); |