diff options
author | ZackaryWelch <welch.zackary@gmail.com> | 2018-04-18 11:37:51 -0400 |
---|---|---|
committer | ZackaryWelch <welch.zackary@gmail.com> | 2018-04-18 11:37:51 -0400 |
commit | 727a1a17ecf0b534b7d6132326849b9efb760c07 (patch) | |
tree | f210f19bad2f19420fbbe175e1b886fdb64b8d9f /src-qt5/core/lumina-desktop-unified/src-desktop/src-widgets/Plugin.h | |
parent | Muted unused variable warnings in the Poppler backend (diff) | |
parent | Clean up the default fluxbox key bindings: (diff) | |
download | lumina-727a1a17ecf0b534b7d6132326849b9efb760c07.tar.gz lumina-727a1a17ecf0b534b7d6132326849b9efb760c07.tar.bz2 lumina-727a1a17ecf0b534b7d6132326849b9efb760c07.zip |
Merge branch 'master' of http://github.com/trueos/lumina
Diffstat (limited to 'src-qt5/core/lumina-desktop-unified/src-desktop/src-widgets/Plugin.h')
-rw-r--r-- | src-qt5/core/lumina-desktop-unified/src-desktop/src-widgets/Plugin.h | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/src-qt5/core/lumina-desktop-unified/src-desktop/src-widgets/Plugin.h b/src-qt5/core/lumina-desktop-unified/src-desktop/src-widgets/Plugin.h new file mode 100644 index 00000000..0934374f --- /dev/null +++ b/src-qt5/core/lumina-desktop-unified/src-desktop/src-widgets/Plugin.h @@ -0,0 +1,58 @@ +//=========================================== +// Lumina-desktop source code +// Copyright (c) 2018, Ken Moore +// Available under the 3-clause BSD license +// See the LICENSE file for full details +//=========================================== +// This is the Widgets version of a generic plugin +//=========================================== +#ifndef _DESKTOP_WIDGETS_GENERIC_PLUGIN_H +#define _DESKTOP_WIDGETS_GENERIC_PLUGIN_H + +#include <global-includes.h> + +//Base plugin type for a canvas/widget +class Plugin : public QWidget{ + Q_OBJECT +private: + bool isPanelPlugin; + bool isVertical; //only used for panel plugins + QString _id; + +signals: + void orientationChanged(); + +public: + Plugin(QWidget *parent, QString id, bool panelplug = false) : QWidget(parent){ + isPanelPlugin = panelplug; + isVertical = false; + _id = id; + } + + void setVertical(bool set){ + if(set!=isVertical){ isVertical = set; emit orientationChanged(); } + } + + QString id(){ return _id; } + +private slots: + +}; + +//Special subclass for a button-based plugin +class PluginButton : public Plugin{ + Q_OBJECT +private: + QToolButton *button; + +public: + PluginButton(QWidget *parent, QString id, bool panelplug=false) : Plugin(parent, id, panelplug) { + button = new QToolButton(this); + this->setLayout( new QBoxLayout(QBoxLayout::LeftToRight) ); + this->layout()->setContentsMargins(0,0,0,0); + this->layout()->addWidget(button); + } + + ~PluginButton(){} +}; +#endif |