summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonathan Bauer2018-10-31 14:47:37 +0100
committerJonathan Bauer2018-10-31 14:47:37 +0100
commit57d416a2b4dd45831ecaddd9732e6f7e62b626ee (patch)
treec9df9ca56d768fb566c035f87ae676f33c877e0f
parentSimplify Settings (diff)
downloadslxgreeter-57d416a2b4dd45831ecaddd9732e6f7e62b626ee.tar.gz
slxgreeter-57d416a2b4dd45831ecaddd9732e6f7e62b626ee.tar.xz
slxgreeter-57d416a2b4dd45831ecaddd9732e6f7e62b626ee.zip
[loginform] configurable icon for login form
with 'loginform-mini-icon' in config file
-rw-r--r--qt-lightdm-greeter.conf11
-rw-r--r--src/loginform.cpp6
2 files changed, 13 insertions, 4 deletions
diff --git a/qt-lightdm-greeter.conf b/qt-lightdm-greeter.conf
index 703d2dc..d658d70 100644
--- a/qt-lightdm-greeter.conf
+++ b/qt-lightdm-greeter.conf
@@ -2,18 +2,21 @@
;
; General configuration
;
-; greeter-icon-theme = name of icon theme to use for the greeter
+; greeter-icon-theme = name of icon theme to use for the greeter
;
-; greeter-background = /path/to/background/image to set a background image for the login screen
+; greeter-background = /path/to/background/image to set a background image for the login screen
;
-; loginform-offset-x = how far from the left edge of the screen should the loginform be placed.
+; loginform-offset-x = how far from the left edge of the screen should the loginform be placed.
; Can be given in pixels, e.g. loginform-offset-x=60px, or in percentage of screen width, e.g. loginform-offset-x=20%.
;
-; loginform-offset-y = how far from the left edge of the screen should the loginform be placed.
+; loginform-offset-y = how far from the left edge of the screen should the loginform be placed.
; Can be given in pixels, e.g. loginform-offset-y=60px, or in percentage of screen width, e.g. loginform-offset-y=20%.
+; loginform-mini-icon = /path/to/loginform/icon to use as a top-right icon inside the login form
+;
[General]
;greeter-icon-theme=oxygen
;greeter-background-image=/path/to/background/image.png
;loginform-offset-x=50%
;loginform-offset-y=50%
+;loginform-mini-icon=/path/to/loginform/icon.png
diff --git a/src/loginform.cpp b/src/loginform.cpp
index 6e58d94..69015f7 100644
--- a/src/loginform.cpp
+++ b/src/loginform.cpp
@@ -49,7 +49,13 @@ void LoginForm::setFocus(Qt::FocusReason reason)
void LoginForm::initialize()
{
+ // fallback to built-in bwlp logo
QPixmap icon(":/resources/bwlp.svg"); // This project came from Razor-qt
+ if (!Settings::miniIconPath().isNull() && !Settings::miniIconPath().isEmpty()) {
+ QPixmap configuredIcon(Settings::miniIconPath());
+ if (!configuredIcon.isNull())
+ icon = configuredIcon;
+ }
ui->iconLabel->setPixmap(icon.scaled(ui->iconLabel->size(), Qt::KeepAspectRatio, Qt::SmoothTransformation));
ui->leaveComboBox->setView(new QListView()); // This is required to get the stylesheet to apply