diff options
author | Kris Moore <kris@pcbsd.org> | 2014-09-04 11:42:13 -0400 |
---|---|---|
committer | Kris Moore <kris@pcbsd.org> | 2014-09-04 11:42:13 -0400 |
commit | 71737f70949bd25f9aa8bc4e7d03039ba83c6cb1 (patch) | |
tree | ab29e864d1ae59d10cc6875af9541e3ad306b2fb /lumina-desktop/panel-plugins/userbutton/LUserButton.h | |
parent | Initial commit (diff) | |
download | lumina-71737f70949bd25f9aa8bc4e7d03039ba83c6cb1.tar.gz lumina-71737f70949bd25f9aa8bc4e7d03039ba83c6cb1.tar.bz2 lumina-71737f70949bd25f9aa8bc4e7d03039ba83c6cb1.zip |
Initial import of the lumina code from pcbsd git repo
Diffstat (limited to 'lumina-desktop/panel-plugins/userbutton/LUserButton.h')
-rw-r--r-- | lumina-desktop/panel-plugins/userbutton/LUserButton.h | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/lumina-desktop/panel-plugins/userbutton/LUserButton.h b/lumina-desktop/panel-plugins/userbutton/LUserButton.h new file mode 100644 index 00000000..e6a1830d --- /dev/null +++ b/lumina-desktop/panel-plugins/userbutton/LUserButton.h @@ -0,0 +1,64 @@ +//=========================================== +// 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 is the main button that allow the user to run +// applications or logout of the desktop +//=========================================== +#ifndef _LUMINA_DESKTOP_USER_MENU_PLUGIN_H +#define _LUMINA_DESKTOP_USER_MENU_PLUGIN_H + +// Qt includes +#include <QMenu> +#include <QWidgetAction> +#include <QToolButton> +#include <QString> +#include <QWidget> + + +// Lumina-desktop includes +#include "../../Globals.h" +#include "../LPPlugin.h" //main plugin widget + +// libLumina includes +#include "LuminaXDG.h" + +#include "UserWidget.h" + +// PANEL PLUGIN BUTTON +class LUserButtonPlugin : public LPPlugin{ + Q_OBJECT + +public: + LUserButtonPlugin(QWidget *parent = 0, QString id = "userbutton", bool horizontal=true); + ~LUserButtonPlugin(); + +private: + QMenu *menu; + QWidgetAction *mact; + UserWidget *usermenu; + QToolButton *button; + + + +private slots: + void openMenu(); + void closeMenu(); + +public slots: + 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()) ); + } + button->setIcon( LXDG::findIcon("user-identity", ":/images/default-user.png") ); //force icon refresh + this->layout()->update(); + } +}; + +#endif
\ No newline at end of file |