diff options
author | Simon Rettberg | 2021-08-05 10:51:39 +0200 |
---|---|---|
committer | Simon Rettberg | 2021-08-05 10:51:39 +0200 |
commit | ccd88b7fa33fc27e3d71b57f59dea55ed7430d6e (patch) | |
tree | 35edaff0695b7ed47a3f648f8295ea944935f0a0 /src/mainwindow.cpp | |
parent | Prefix usernames that start with a digit with _x_ (diff) | |
download | slxgreeter-ccd88b7fa33fc27e3d71b57f59dea55ed7430d6e.tar.gz slxgreeter-ccd88b7fa33fc27e3d71b57f59dea55ed7430d6e.tar.xz slxgreeter-ccd88b7fa33fc27e3d71b57f59dea55ed7430d6e.zip |
Add shibboleth login via browser
Diffstat (limited to 'src/mainwindow.cpp')
-rw-r--r-- | src/mainwindow.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 2a56fbc..95d74de 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -55,6 +55,7 @@ MainWindow::MainWindow(bool primary, int screen, const QRect &screenRect, QWidge int centerX = screenRect.width()/2 + screenRect.x(); int centerY = screenRect.height()/2 + screenRect.y(); QCursor::setPos(centerX, centerY); + connect(m_LoginForm, &LoginForm::resized, this, &MainWindow::reLayout); } // Banner @@ -80,6 +81,11 @@ void MainWindow::resizeEvent(QResizeEvent *event) QWidget::resizeEvent(event); m_ScreenRect = QRect(this->pos(), event->size()); setBackground(); + reLayout(); +} + +void MainWindow::reLayout() +{ /* * Everything is layed out manually here, since I don't know how to represent the size constraints * and interactions of everything using layout classes. You're welcome to improve this, but I double @@ -177,8 +183,11 @@ void MainWindow::paintEvent(QPaintEvent *event) void MainWindow::mouseDoubleClickEvent(QMouseEvent *) { + static int clicks = 0; if (m_Snake == nullptr) { - m_Snake = new GameCore(this); + if (clicks++ > 0) { + m_Snake = new GameCore(this); + } } else { m_Snake->addSnake(); } |