aboutsummaryrefslogtreecommitdiff
path: root/src-qt5/core/lumina-desktop/panel-plugins/systemdashboard/LSysDashboard.h
diff options
context:
space:
mode:
authorKen Moore <moorekou@gmail.com>2016-04-25 13:08:12 -0400
committerKen Moore <moorekou@gmail.com>2016-04-25 13:08:12 -0400
commited5ecf7ea7a482b4649e66ecb35fbc60af680684 (patch)
treeacc0fa17d228259e847f55c678db9fb0a9b50f0c /src-qt5/core/lumina-desktop/panel-plugins/systemdashboard/LSysDashboard.h
parentMerge branch 'master' of github.com:pcbsd/lumina (diff)
downloadlumina-ed5ecf7ea7a482b4649e66ecb35fbc60af680684.tar.gz
lumina-ed5ecf7ea7a482b4649e66ecb35fbc60af680684.tar.bz2
lumina-ed5ecf7ea7a482b4649e66ecb35fbc60af680684.zip
Rearrange the Lumina source tree quite a bit:
Now the utilites are arranged by category (core, core-utils, desktop-utils), so all the -utils may be excluded by a package system (or turned into separate packages) as needed.
Diffstat (limited to 'src-qt5/core/lumina-desktop/panel-plugins/systemdashboard/LSysDashboard.h')
-rw-r--r--src-qt5/core/lumina-desktop/panel-plugins/systemdashboard/LSysDashboard.h76
1 files changed, 76 insertions, 0 deletions
diff --git a/src-qt5/core/lumina-desktop/panel-plugins/systemdashboard/LSysDashboard.h b/src-qt5/core/lumina-desktop/panel-plugins/systemdashboard/LSysDashboard.h
new file mode 100644
index 00000000..782fc4e6
--- /dev/null
+++ b/src-qt5/core/lumina-desktop/panel-plugins/systemdashboard/LSysDashboard.h
@@ -0,0 +1,76 @@
+//===========================================
+// Lumina-DE source code
+// Copyright (c) 2014, Ken Moore
+// Available under the 3-clause BSD license
+// See the LICENSE file for full details
+//===========================================
+// This panel plugin allows the user to control different system settings
+// For example: screen brightness, audio volume, workspace, and battery
+//===========================================
+#ifndef _LUMINA_DESKTOP_SYSTEM_DASHBOARD_H
+#define _LUMINA_DESKTOP_SYSTEM_DASHBOARD_H
+
+//Qt includes
+
+#include <QHBoxLayout>
+#include <QDebug>
+#include <QCoreApplication>
+#include <QPainter>
+#include <QPixmap>
+#include <QWidgetAction>
+#include <QMenu>
+#include <QTimer>
+#include <QToolButton>
+
+//libLumina includes
+#include <LuminaOS.h>
+#include <LuminaXDG.h>
+
+//Local includes
+#include "../LPPlugin.h"
+#include "SysMenuQuick.h"
+
+class LSysDashboard : public LPPlugin{
+ Q_OBJECT
+public:
+ LSysDashboard(QWidget *parent = 0, QString id="systemdashboard", bool horizontal=true);
+ ~LSysDashboard();
+
+private:
+ QMenu *menu;
+ QWidgetAction *mact;
+ LSysMenuQuick *sysmenu;
+ QToolButton *button;
+ QTimer *upTimer;
+
+private slots:
+ void updateIcon(bool force = false);
+ void resetIcon();
+ void openMenu();
+ void closeMenu();
+
+public slots:
+ void LocaleChange(){
+ updateIcon(true);
+ sysmenu->UpdateMenu();
+ }
+
+ void ThemeChange(){
+ updateIcon(true);
+ sysmenu->UpdateMenu();
+ }
+
+ void OrientationChange(){
+ if(this->layout()->direction()==QBoxLayout::LeftToRight){
+ this->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::MinimumExpanding);
+ button->setIconSize( QSize(this->height(), this->height()) );
+ }else{
+ this->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Preferred);
+ button->setIconSize( QSize(this->width(), this->width()) );
+ }
+ updateIcon(true); //force icon refresh
+ this->layout()->update();
+ }
+};
+
+#endif
bgstack15