diff options
author | Simon Rettberg | 2017-11-13 13:41:39 +0100 |
---|---|---|
committer | Simon Rettberg | 2017-11-13 13:41:39 +0100 |
commit | cacd16116201eb578e09d29a889785c19e99caf5 (patch) | |
tree | cd2821655699d390451427f648f52c72b37b9477 | |
parent | Increase font size in text fields a bit (diff) | |
download | slxgreeter-cacd16116201eb578e09d29a889785c19e99caf5.tar.gz slxgreeter-cacd16116201eb578e09d29a889785c19e99caf5.tar.xz slxgreeter-cacd16116201eb578e09d29a889785c19e99caf5.zip |
Improve style a bit: Pull b-l-logo down, a bit smaller, better dropdown style
-rw-r--r-- | src/loginform.cpp | 2 | ||||
-rw-r--r-- | src/loginform.ui | 25 | ||||
-rw-r--r-- | src/mainwindow.cpp | 7 |
3 files changed, 24 insertions, 10 deletions
diff --git a/src/loginform.cpp b/src/loginform.cpp index 0a65bdd..2fb09df 100644 --- a/src/loginform.cpp +++ b/src/loginform.cpp @@ -12,6 +12,7 @@ #include <QPixmap> #include <QMessageBox> #include <QMenu> +#include <QListView> #include <iostream> @@ -63,6 +64,7 @@ void LoginForm::initialize() QPixmap icon(":/resources/bwlp.svg"); // This project came from Razor-qt ui->iconLabel->setPixmap(icon.scaled(ui->iconLabel->size(), Qt::KeepAspectRatio, Qt::SmoothTransformation)); + ui->leaveComboBox->setView(new QListView()); //addLeaveEntry(power->canHibernate(), "system-suspend-hibernate", tr("Hibernate"), "hibernate"); //addLeaveEntry(power->canSuspend(), "system-suspend", tr("Suspend"), "suspend"); diff --git a/src/loginform.ui b/src/loginform.ui index e409737..5589223 100644 --- a/src/loginform.ui +++ b/src/loginform.ui @@ -7,7 +7,7 @@ <x>0</x> <y>0</y> <width>350</width> - <height>354</height> + <height>270</height> </rect> </property> <property name="font"> @@ -49,6 +49,17 @@ QComboBox::drop-down { QComboBox::down-arrow { image: url(:/resources/dropdown.svg); } + +QComboBox QListView { + border: none; + background-color: rgb(200, 200, 200); + border-radius: 0; + font-size: 12pt; +} + +QComboBox QAbstractItemView::item { + padding: 4px; +} </string> </property> <layout class="QVBoxLayout" name="verticalLayout"> @@ -61,12 +72,12 @@ QComboBox::down-arrow { </sizepolicy> </property> <layout class="QGridLayout" name="gridLayout"> - <property name="bottomMargin"> - <number>25</number> - </property> <property name="verticalSpacing"> <number>8</number> </property> + <property name="bottomMargin"> + <number>9</number> + </property> <item row="0" column="0"> <widget class="QLabel" name="hostnameLabel"> <property name="minimumSize"> @@ -109,13 +120,13 @@ QComboBox::down-arrow { <property name="minimumSize"> <size> <width>80</width> - <height>60</height> + <height>30</height> </size> </property> <property name="maximumSize"> <size> <width>80</width> - <height>60</height> + <height>30</height> </size> </property> <item> @@ -229,7 +240,7 @@ QComboBox::down-arrow { </property> </widget> </item> - <item row="6" column="0" rowspan="2" colspan="2"> + <item row="5" column="0"> <widget class="QLabel" name="messageLabel"> <property name="minimumSize"> <size> diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 404feb1..3307ef8 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -82,8 +82,9 @@ MainWindow::MainWindow(bool primary, int screen, const QRect &screenRect, bool t banner->move((screenRect.width() - bw) / 2, (spaceY - bh) / 2); } } - // TODO: UniLogo - int ls = (spaceY > 400 ? 400 : spaceY); + int ls = (spaceY > 500 ? 500 : spaceY); + if (ls > screenRect.height() / 5) ls = screenRect.height() / 5; + if (ls > screenRect.width() / 5) ls = screenRect.width() / 5; QRect logoRect(QPoint(0, screenRect.height() - ls), QSize(ls, ls)); QSize logoSize = createLogo(logoRect); if (showLoginForm()) { @@ -121,7 +122,7 @@ QSize MainWindow::createLogo(const QRect &max) } QSize size(w, h); QRect c(max); - c.setSize(size); + c.adjust(0, max.height() - h, -(max.width() - w), 0); c.adjust(10, 10, -10, -10); img->setGeometry(c); return size; |