summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSimon Rettberg2022-07-17 11:31:33 +0200
committerSimon Rettberg2022-07-17 11:31:33 +0200
commitde4a5cc90703f8fdb5dd36e29bdde1d70a037034 (patch)
tree689eb578886999edc79acc2f35d78784df00de9b /src
parentEnable LocalStorage for WebKit, so SWITCH IdPs work again (diff)
downloadslxgreeter-de4a5cc90703f8fdb5dd36e29bdde1d70a037034.tar.gz
slxgreeter-de4a5cc90703f8fdb5dd36e29bdde1d70a037034.tar.xz
slxgreeter-de4a5cc90703f8fdb5dd36e29bdde1d70a037034.zip
Fix msg window overlapping login, fix browser widget resizing
Diffstat (limited to 'src')
-rw-r--r--src/loginform.cpp10
-rw-r--r--src/mainwindow.cpp24
2 files changed, 25 insertions, 9 deletions
diff --git a/src/loginform.cpp b/src/loginform.cpp
index 50bd08e..7c4deaa 100644
--- a/src/loginform.cpp
+++ b/src/loginform.cpp
@@ -472,7 +472,7 @@ void LoginForm::keyPressEvent(QKeyEvent *event)
void LoginForm::resetForm()
{
- std::cerr << "PageCount: " << pageCount;
+ std::cerr << "PageCount: " << pageCount << std::endl;
if (pageCount > 1) {
ui->loginChooser->setCurrentWidget(ui->welcomePage);
}
@@ -505,7 +505,7 @@ void LoginForm::setBrowserSize()
browser->setFixedSize(s);
browser->setGeometry(QRect(QPoint(0, 0), s));
}
- QTimer::singleShot(10, [=]() {
+ QTimer::singleShot(10, [this, f]() {
int pw = 0, ph = 0;
if (this->parentWidget() != nullptr) {
this->parentWidget()->pos();
@@ -515,6 +515,12 @@ void LoginForm::setBrowserSize()
this->resize(*f);
this->setFixedSize(*f);
this->setGeometry(pw, ph, f->width(), f->height());
+ auto s = ui->shibPage->size();
+ std::cerr << "Delayed resize to " << s.width() << " " << s.height() << std::endl;
+ if (browser != nullptr) {
+ browser->setFixedSize(s);
+ browser->setGeometry(QRect(QPoint(0, 0), s));
+ }
emit resized();
});
}
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
index ce117ee..a7bdb58 100644
--- a/src/mainwindow.cpp
+++ b/src/mainwindow.cpp
@@ -163,12 +163,20 @@ void MainWindow::reLayout()
// Log window
if (m_messages != nullptr) {
QRect lwSize(QPoint(logoSize.width(), m_ScreenRect.height() * 3/4), QPoint(m_ScreenRect.width() - distroSize.width(), m_ScreenRect.height()));
+ if (m_LoginForm != nullptr && lwSize.top() < m_LoginForm->geometry().bottom()) {
+ lwSize.setTop(m_LoginForm->geometry().bottom());
+ }
lwSize.adjust(10, 10, -10, -10);
- m_messages->setGeometry(lwSize);
- int ps = lwSize.height() / 20;
- if (ps > 20) ps = 20;
- m_messages->setFontPointSize(ps);
- newsBottom = lwSize.top();
+ if (lwSize.height() < 10) {
+ m_messages->hide();
+ } else {
+ m_messages->show();
+ m_messages->setGeometry(lwSize);
+ int ps = lwSize.height() / 20;
+ if (ps > 20) ps = 20;
+ m_messages->setFontPointSize(ps);
+ newsBottom = lwSize.top();
+ }
}
if (m_Clock != nullptr) {
m_Clock->setFixedWidth(m_ScreenRect.width());
@@ -185,6 +193,10 @@ void MainWindow::reLayout()
m_News->show();
}
}
+ if (m_LoginForm != nullptr) {
+ // This is most important, so bring to top
+ m_LoginForm->raise();
+ }
}
void MainWindow::paintEvent(QPaintEvent *event)
@@ -239,9 +251,7 @@ QSize MainWindow::createLogo(QRect max)
QString filePath = fileInfo.absoluteFilePath();
createNextLogo(max, retval, filePath);
}
- return retval;
}
- createNextLogo(max, retval, path);
return retval;
}