aboutsummaryrefslogtreecommitdiff
path: root/src-qt5/core/lumina-desktop-unified/src-desktop/src-widgets/Plugin.h
diff options
context:
space:
mode:
authorKen Moore <ken@ixsystems.com>2018-05-13 05:35:48 -0400
committerKen Moore <ken@ixsystems.com>2018-05-13 05:40:00 -0400
commit0cabdf5e3a44a21e6561d345bc5149de1a68457b (patch)
treea886759e71e4d7f21f08be78745b465ec4fe0d8d /src-qt5/core/lumina-desktop-unified/src-desktop/src-widgets/Plugin.h
parentUpdate the fallback icon used for Pandora radio in lumina-mediaplayer (diff)
downloadlumina-0cabdf5e3a44a21e6561d345bc5149de1a68457b.tar.gz
lumina-0cabdf5e3a44a21e6561d345bc5149de1a68457b.tar.bz2
lumina-0cabdf5e3a44a21e6561d345bc5149de1a68457b.zip
Get the screen reservation work finished up and committed.
Also finish up the Plugin base-classes for use when writing the various panel/desktop plugins.
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.h18
1 files changed, 13 insertions, 5 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
index 0934374f..4a81d79b 100644
--- 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
@@ -15,18 +15,25 @@
class Plugin : public QWidget{
Q_OBJECT
private:
- bool isPanelPlugin;
- bool isVertical; //only used for panel plugins
QString _id;
signals:
void orientationChanged();
public:
+ QBoxLayout *boxLayout;
+ bool isPanelPlugin;
+ bool isVertical; //only used for panel plugins
+
Plugin(QWidget *parent, QString id, bool panelplug = false) : QWidget(parent){
isPanelPlugin = panelplug;
isVertical = false;
_id = id;
+ boxLayout = new QBoxLayout(QBoxLayout::LeftToRight);
+ this->setLayout( boxLayout );
+ boxLayout->setContentsMargins(0,0,0,0);
+ updateLayoutOrientation();
+ connect(this, SIGNAL(orientationChanged()), this, SLOT(updateLayoutOrientation()) );
}
void setVertical(bool set){
@@ -36,7 +43,9 @@ public:
QString id(){ return _id; }
private slots:
-
+ void updateLayoutOrientation(){
+ boxLayout->setDirection( this->isVertical ? QBoxLayout::TopToBottom : QBoxLayout::LeftToRight );
+ }
};
//Special subclass for a button-based plugin
@@ -48,11 +57,10 @@ private:
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
bgstack15