diff options
author | Ken Moore <moorekou@gmail.com> | 2015-10-08 13:51:32 -0400 |
---|---|---|
committer | Ken Moore <moorekou@gmail.com> | 2015-10-08 13:51:32 -0400 |
commit | fcfd54ecadd459b6a055688ad84c28a211f7d439 (patch) | |
tree | a756073cf11778a7794460f5eb43c9b00371899a /lumina-desktop/panel-plugins/systemstart/LStartButton.cpp | |
parent | Add a new panel plugin: "line" (diff) | |
download | lumina-fcfd54ecadd459b6a055688ad84c28a211f7d439.tar.gz lumina-fcfd54ecadd459b6a055688ad84c28a211f7d439.tar.bz2 lumina-fcfd54ecadd459b6a055688ad84c28a211f7d439.zip |
Update the new ResizeMenu and startmenu a bit: Now it better performes resizing and the startmenu savees it's size between sessions.
Diffstat (limited to 'lumina-desktop/panel-plugins/systemstart/LStartButton.cpp')
-rw-r--r-- | lumina-desktop/panel-plugins/systemstart/LStartButton.cpp | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/lumina-desktop/panel-plugins/systemstart/LStartButton.cpp b/lumina-desktop/panel-plugins/systemstart/LStartButton.cpp index 3e644803..cf37cf88 100644 --- a/lumina-desktop/panel-plugins/systemstart/LStartButton.cpp +++ b/lumina-desktop/panel-plugins/systemstart/LStartButton.cpp @@ -8,7 +8,7 @@ #include "../../LSession.h" #include <LuminaXDG.h> -#include <LuminaUtils.h> +#include <LuminaUtils.h> //This contains the "ResizeMenu" class LStartButtonPlugin::LStartButtonPlugin(QWidget *parent, QString id, bool horizontal) : LPPlugin(parent, id, horizontal){ button = new QToolButton(this); @@ -21,14 +21,14 @@ LStartButtonPlugin::LStartButtonPlugin(QWidget *parent, QString id, bool horizon menu = new ResizeMenu(this); menu->setContentsMargins(1,1,1,1); connect(menu, SIGNAL(aboutToHide()), this, SIGNAL(MenuClosed())); + connect(menu, SIGNAL(MenuResized(QSize)), this, SLOT(SaveMenuSize(QSize)) ); startmenu = new StartMenu(this); connect(startmenu, SIGNAL(CloseMenu()), this, SLOT(closeMenu()) ); connect(startmenu, SIGNAL(UpdateQuickLaunch(QStringList)), this, SLOT(updateQuickLaunch(QStringList))); menu->setContents(startmenu); - /*mact = new QWidgetAction(this); - mact->setDefaultWidget(startmenu); - menu->addAction(mact);*/ - + QSize saved = LSession::handle()->DesktopPluginSettings()->value("panelPlugs/"+this->type()+"/MenuSize", QSize(0,0)).toSize(); + if(!saved.isNull()){ startmenu->setFixedSize(saved); } //re-load the previously saved value + button->setMenu(menu); connect(menu, SIGNAL(aboutToHide()), this, SLOT(updateButtonVisuals()) ); QTimer::singleShot(0,this, SLOT(OrientationChange())); //Update icons/sizes @@ -100,10 +100,16 @@ void LStartButtonPlugin::RemoveQuick(QString file){ } } +void LStartButtonPlugin::SaveMenuSize(QSize sz){ + //Save this size for the menu + LSession::handle()->DesktopPluginSettings()->setValue("panelPlugs/"+this->type()+"/MenuSize", sz); +} + // ======================== // PRIVATE FUNCTIONS // ======================== void LStartButtonPlugin::openMenu(){ + if(menu->isVisible()){ return; } //don't re-show it - already open startmenu->UpdateMenu(); button->showMenu(); } |