diff options
author | Ken Moore <moorekou@gmail.com> | 2015-10-07 17:07:13 -0400 |
---|---|---|
committer | Ken Moore <moorekou@gmail.com> | 2015-10-07 17:07:13 -0400 |
commit | 9fd1372203ef8da796b370e063959c9bab344b1e (patch) | |
tree | 3a6c7a5f818487ea4cb1d6e6a8693ade33786ab3 /libLumina/LuminaUtils.h | |
parent | Reverse the order of items in the startmenu logout page - now they start at t... (diff) | |
download | lumina-9fd1372203ef8da796b370e063959c9bab344b1e.tar.gz lumina-9fd1372203ef8da796b370e063959c9bab344b1e.tar.bz2 lumina-9fd1372203ef8da796b370e063959c9bab344b1e.zip |
Another batch of small fixes:
1) Add a new ResizeMenu() class to the LuminaUtils library - this class allows the resulting menu to be resizable by the user clicking on an edge and dragging.
2) In the systemstart panel plugin, reverse the location of the shutdown options on the leave page (put them at the bottom next to where the leave button is in the first place)
3) Setup the systemstart plugin to use the new ResizeMenu. It currently does not save the new size to be used for later sessions, but per-session resizing works fine.
4) Quick adjustment to the systemtray icon sizes
5) Quick fix to the detection of a desktop file removal.
Diffstat (limited to 'libLumina/LuminaUtils.h')
-rw-r--r-- | libLumina/LuminaUtils.h | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/libLumina/LuminaUtils.h b/libLumina/LuminaUtils.h index 3ab741a0..bbb40c38 100644 --- a/libLumina/LuminaUtils.h +++ b/libLumina/LuminaUtils.h @@ -19,6 +19,10 @@ #include <QObject> #include <QTranslator> #include <QApplication> +#include <QMenu> +#include <QMouseEvent> +#include <QSize> +#include <QWidgetAction> class LUtils{ public: @@ -87,4 +91,36 @@ public: }; +//Special subclass for a menu which the user can grab the edges and resize as necessary +// Note: Make sure that you don't set 0pixel contents margins on this menu +// - it needs at least 1 pixel margins for the user to be able to grab it +class ResizeMenu : public QMenu{ + Q_OBJECT +public: + ResizeMenu(QWidget *parent = 0); + virtual ~ResizeMenu(); + + void setContents(QWidget *con); + +private: + enum SideFlag{NONE, TOP, BOTTOM, LEFT, RIGHT}; + SideFlag resizeSide; + QWidget *contents; + QWidgetAction *cAct; + +private slots: + void clearFlags(){ + resizeSide=NONE; + } + +protected: + virtual void mouseMoveEvent(QMouseEvent *ev); + virtual void mousePressEvent(QMouseEvent *ev); + virtual void mouseReleaseEvent(QMouseEvent *ev); + +signals: + void MenuResized(QSize); //Emitted when the menu is manually resized by the user + +}; + #endif |