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 1 year 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();
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")));
}

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

Loading…
Cancel
Save