From cacd16116201eb578e09d29a889785c19e99caf5 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Mon, 13 Nov 2017 13:41:39 +0100 Subject: Improve style a bit: Pull b-l-logo down, a bit smaller, better dropdown style --- src/loginform.cpp | 2 ++ src/loginform.ui | 25 ++++++++++++++++++------- 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 #include #include +#include #include @@ -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 @@ 0 0 350 - 354 + 270 @@ -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; +} @@ -61,12 +72,12 @@ QComboBox::down-arrow { - - 25 - 8 + + 9 + @@ -109,13 +120,13 @@ QComboBox::down-arrow { 80 - 60 + 30 80 - 60 + 30 @@ -229,7 +240,7 @@ QComboBox::down-arrow { - + 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; -- cgit v1.2.3-55-g7522