diff --git a/include/mainwindow.h b/include/mainwindow.h index c9c6183..c206b6a 100644 --- a/include/mainwindow.h +++ b/include/mainwindow.h @@ -21,6 +21,7 @@ public: protected: virtual void closeEvent(QCloseEvent* event) override; + virtual void resizeEvent(QResizeEvent *event) override; private slots: void toggleMainswitch(bool); diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 3b2879d..4bf593d 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -23,6 +23,8 @@ MainWindow::MainWindow(LolAutoAccept& lolaa, QWidget *parent) : QMainWindow(pare applySetting(rc.prepick, ui->prepickstage); applySetting(rc.ban, ui->banstage); applySetting(rc.pick, ui->pickstage); + + resizeEvent(nullptr); } MainWindow::~MainWindow() { @@ -36,8 +38,15 @@ void MainWindow::closeEvent([[maybe_unused]] QCloseEvent* event) { conf.save(); } +void MainWindow::resizeEvent([[maybe_unused]] QResizeEvent *event) { + ui->verticalLayoutWidget->setMinimumSize(ui->centralwidget->size()); + ui->verticalLayoutWidget->setMaximumSize(ui->centralwidget->size()); + ui->verticalLayoutWidget->setMinimumSize(ui->centralwidget->size()); +} + void MainWindow::toggleMainswitch(bool state) { Log::info << "mainswitch toggled: " << state; + if(state) { if(!lolaa.init()) { Log::error << "League Client not found!"; diff --git a/src/stagesettings.cpp b/src/stagesettings.cpp index 3304725..d3ebd0d 100644 --- a/src/stagesettings.cpp +++ b/src/stagesettings.cpp @@ -10,7 +10,6 @@ StageSettings::StageSettings(QWidget *parent) : QWidget(parent), ui(new Ui::StageSettings) { ui->setupUi(this); - setMinimumSize(ui->gridLayout->minimumSize()); } StageSettings::~StageSettings() { diff --git a/ui/mainwindow.ui b/ui/mainwindow.ui index 15ecccb..ac67dfd 100644 --- a/ui/mainwindow.ui +++ b/ui/mainwindow.ui @@ -6,16 +6,22 @@ 0 0 - 400 - 635 + 432 + 630 + + + 0 + 0 + + LoL-Auto-Accept - + 0 0 @@ -23,13 +29,16 @@ - 10 - 50 - 381 - 491 + 0 + 0 + 431 + 581 + + QLayout::SetDefaultConstraint + @@ -50,14 +59,14 @@ true - + 0 0 - 200 + 100 10 @@ -72,14 +81,14 @@ - + 0 0 - 200 + 100 10 @@ -94,14 +103,14 @@ - + 0 0 - 200 + 100 10 @@ -121,7 +130,7 @@ 0 0 - 400 + 432 24 @@ -152,8 +161,8 @@ aatoggled(bool) - 17 - 258 + 18 + 80 393 @@ -168,8 +177,8 @@ pptoggled(bool) - 252 - 338 + 253 + 254 296 @@ -200,8 +209,8 @@ toggleMainswitch(bool) - 86 - 163 + 87 + 49 1 @@ -264,8 +273,8 @@ ppedited() - 184 - 335 + 185 + 254 122 diff --git a/ui/stagesettings.ui b/ui/stagesettings.ui index d49315e..b3a1fdd 100644 --- a/ui/stagesettings.ui +++ b/ui/stagesettings.ui @@ -6,8 +6,8 @@ 0 0 - 762 - 859 + 412 + 180 @@ -18,20 +18,23 @@ - 300 - 130 + 0 + 0 - 300 - 130 + 0 + 0 + + QLayout::SetMinAndMaxSize + @@ -44,6 +47,9 @@ + + QLayout::SetMinAndMaxSize + @@ -53,8 +59,17 @@ + + QLayout::SetMinAndMaxSize + + + + 0 + 0 + + Add Champion @@ -62,6 +77,12 @@ + + + 0 + 0 + + Remove Champion @@ -72,15 +93,15 @@ - + 0 0 - 0 - 150 + 128 + 100 @@ -122,7 +143,7 @@ 20 - 296 + 179 @@ -133,12 +154,12 @@ addChamp() - 739 - 328 + 389 + 102 - 757 - 291 + 411 + 179 @@ -149,12 +170,12 @@ removeChamp() - 739 - 598 + 389 + 146 - 758 - 697 + 411 + 179