aboutsummaryrefslogtreecommitdiff
path: root/lumina-desktop/panel-plugins
diff options
context:
space:
mode:
authorKen Moore <ken@pcbsd.org>2015-01-19 09:45:41 -0500
committerKen Moore <ken@pcbsd.org>2015-01-19 09:45:41 -0500
commit11200604f5448bb78cbf717f910ee474052e46cf (patch)
tree4b508e504ec529ff706780bc76b89506c8ea65b4 /lumina-desktop/panel-plugins
parentOops, missed resetting one of the lock flags in the desktop. (diff)
downloadlumina-11200604f5448bb78cbf717f910ee474052e46cf.tar.gz
lumina-11200604f5448bb78cbf717f910ee474052e46cf.tar.bz2
lumina-11200604f5448bb78cbf717f910ee474052e46cf.zip
Update the user button to recognize the existance of a customized user icon for PCDM and use that for the icon instead (~/.loginIcon.png)
Diffstat (limited to 'lumina-desktop/panel-plugins')
-rw-r--r--lumina-desktop/panel-plugins/userbutton/LUserButton.cpp13
-rw-r--r--lumina-desktop/panel-plugins/userbutton/LUserButton.h12
2 files changed, 21 insertions, 4 deletions
diff --git a/lumina-desktop/panel-plugins/userbutton/LUserButton.cpp b/lumina-desktop/panel-plugins/userbutton/LUserButton.cpp
index 74509920..1100f37a 100644
--- a/lumina-desktop/panel-plugins/userbutton/LUserButton.cpp
+++ b/lumina-desktop/panel-plugins/userbutton/LUserButton.cpp
@@ -11,8 +11,7 @@ LUserButtonPlugin::LUserButtonPlugin(QWidget *parent, QString id, bool horizonta
button = new QToolButton(this);
button->setAutoRaise(true);
button->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
- button->setToolTip(QString("Quickly launch applications or open files"));
- button->setText( SYSTEM::user() );
+
connect(button, SIGNAL(clicked()), this, SLOT(openMenu()));
this->layout()->setContentsMargins(0,0,0,0);
this->layout()->addWidget(button);
@@ -31,6 +30,16 @@ LUserButtonPlugin::~LUserButtonPlugin(){
}
+void LUserButtonPlugin::updateButtonVisuals(){
+ button->setToolTip(QString("Quickly launch applications or open files"));
+ button->setText( SYSTEM::user() );
+ if( QFile::exists(QDir::homePath()+"/.loginIcon.png") ){
+ button->setIcon( QIcon(QDir::homePath()+"/.loginIcon.png") );
+ }else{
+ button->setIcon( LXDG::findIcon("user-identity", ":/images/default-user.png") ); //force icon refresh
+ }
+}
+
// ========================
// PRIVATE FUNCTIONS
// ========================
diff --git a/lumina-desktop/panel-plugins/userbutton/LUserButton.h b/lumina-desktop/panel-plugins/userbutton/LUserButton.h
index e6a1830d..4d5f59b4 100644
--- a/lumina-desktop/panel-plugins/userbutton/LUserButton.h
+++ b/lumina-desktop/panel-plugins/userbutton/LUserButton.h
@@ -41,8 +41,8 @@ private:
UserWidget *usermenu;
QToolButton *button;
+ void updateButtonVisuals();
-
private slots:
void openMenu();
void closeMenu();
@@ -56,8 +56,16 @@ public slots:
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();
+ updateButtonVisuals();
+ }
+
+ void LocaleChange(){
+ updateButtonVisuals();
+ }
+
+ void ThemeChange(){
+ updateButtonVisuals();
}
};
bgstack15