layouting problems fixed

This commit is contained in:
mrbesen 2022-07-03 16:44:07 +02:00
parent 99858e7fae
commit 1f4f4b52bc
Signed by: MrBesen
GPG Key ID: 596B2350DCD67504
5 changed files with 80 additions and 41 deletions

View File

@ -21,6 +21,7 @@ public:
protected: protected:
virtual void closeEvent(QCloseEvent* event) override; virtual void closeEvent(QCloseEvent* event) override;
virtual void resizeEvent(QResizeEvent *event) override;
private slots: private slots:
void toggleMainswitch(bool); void toggleMainswitch(bool);

View File

@ -23,6 +23,8 @@ MainWindow::MainWindow(LolAutoAccept& lolaa, QWidget *parent) : QMainWindow(pare
applySetting(rc.prepick, ui->prepickstage); applySetting(rc.prepick, ui->prepickstage);
applySetting(rc.ban, ui->banstage); applySetting(rc.ban, ui->banstage);
applySetting(rc.pick, ui->pickstage); applySetting(rc.pick, ui->pickstage);
resizeEvent(nullptr);
} }
MainWindow::~MainWindow() { MainWindow::~MainWindow() {
@ -36,8 +38,15 @@ void MainWindow::closeEvent([[maybe_unused]] QCloseEvent* event) {
conf.save(); 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) { void MainWindow::toggleMainswitch(bool state) {
Log::info << "mainswitch toggled: " << state; Log::info << "mainswitch toggled: " << state;
if(state) { if(state) {
if(!lolaa.init()) { if(!lolaa.init()) {
Log::error << "League Client not found!"; Log::error << "League Client not found!";

View File

@ -10,7 +10,6 @@
StageSettings::StageSettings(QWidget *parent) : QWidget(parent), ui(new Ui::StageSettings) { StageSettings::StageSettings(QWidget *parent) : QWidget(parent), ui(new Ui::StageSettings) {
ui->setupUi(this); ui->setupUi(this);
setMinimumSize(ui->gridLayout->minimumSize());
} }
StageSettings::~StageSettings() { StageSettings::~StageSettings() {

View File

@ -6,16 +6,22 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>400</width> <width>432</width>
<height>635</height> <height>630</height>
</rect> </rect>
</property> </property>
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="windowTitle"> <property name="windowTitle">
<string>LoL-Auto-Accept</string> <string>LoL-Auto-Accept</string>
</property> </property>
<widget class="QWidget" name="centralwidget"> <widget class="QWidget" name="centralwidget">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Maximum"> <sizepolicy hsizetype="Ignored" vsizetype="Ignored">
<horstretch>0</horstretch> <horstretch>0</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
@ -23,13 +29,16 @@
<widget class="QWidget" name="verticalLayoutWidget"> <widget class="QWidget" name="verticalLayoutWidget">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>10</x> <x>0</x>
<y>50</y> <y>0</y>
<width>381</width> <width>431</width>
<height>491</height> <height>581</height>
</rect> </rect>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout"> <layout class="QVBoxLayout" name="verticalLayout">
<property name="sizeConstraint">
<enum>QLayout::SetDefaultConstraint</enum>
</property>
<item> <item>
<widget class="QCheckBox" name="mainswitch"> <widget class="QCheckBox" name="mainswitch">
<property name="text"> <property name="text">
@ -50,14 +59,14 @@
<bool>true</bool> <bool>true</bool>
</property> </property>
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Maximum"> <sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding">
<horstretch>0</horstretch> <horstretch>0</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
</property> </property>
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>200</width> <width>100</width>
<height>10</height> <height>10</height>
</size> </size>
</property> </property>
@ -72,14 +81,14 @@
<item> <item>
<widget class="StageSettings" name="banstage" native="true"> <widget class="StageSettings" name="banstage" native="true">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Maximum"> <sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding">
<horstretch>0</horstretch> <horstretch>0</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
</property> </property>
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>200</width> <width>100</width>
<height>10</height> <height>10</height>
</size> </size>
</property> </property>
@ -94,14 +103,14 @@
<item> <item>
<widget class="StageSettings" name="pickstage" native="true"> <widget class="StageSettings" name="pickstage" native="true">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Maximum"> <sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding">
<horstretch>0</horstretch> <horstretch>0</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
</property> </property>
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>200</width> <width>100</width>
<height>10</height> <height>10</height>
</size> </size>
</property> </property>
@ -121,7 +130,7 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>400</width> <width>432</width>
<height>24</height> <height>24</height>
</rect> </rect>
</property> </property>
@ -152,8 +161,8 @@
<slot>aatoggled(bool)</slot> <slot>aatoggled(bool)</slot>
<hints> <hints>
<hint type="sourcelabel"> <hint type="sourcelabel">
<x>17</x> <x>18</x>
<y>258</y> <y>80</y>
</hint> </hint>
<hint type="destinationlabel"> <hint type="destinationlabel">
<x>393</x> <x>393</x>
@ -168,8 +177,8 @@
<slot>pptoggled(bool)</slot> <slot>pptoggled(bool)</slot>
<hints> <hints>
<hint type="sourcelabel"> <hint type="sourcelabel">
<x>252</x> <x>253</x>
<y>338</y> <y>254</y>
</hint> </hint>
<hint type="destinationlabel"> <hint type="destinationlabel">
<x>296</x> <x>296</x>
@ -200,8 +209,8 @@
<slot>toggleMainswitch(bool)</slot> <slot>toggleMainswitch(bool)</slot>
<hints> <hints>
<hint type="sourcelabel"> <hint type="sourcelabel">
<x>86</x> <x>87</x>
<y>163</y> <y>49</y>
</hint> </hint>
<hint type="destinationlabel"> <hint type="destinationlabel">
<x>1</x> <x>1</x>
@ -264,8 +273,8 @@
<slot>ppedited()</slot> <slot>ppedited()</slot>
<hints> <hints>
<hint type="sourcelabel"> <hint type="sourcelabel">
<x>184</x> <x>185</x>
<y>335</y> <y>254</y>
</hint> </hint>
<hint type="destinationlabel"> <hint type="destinationlabel">
<x>122</x> <x>122</x>

View File

@ -6,8 +6,8 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>762</width> <width>412</width>
<height>859</height> <height>180</height>
</rect> </rect>
</property> </property>
<property name="sizePolicy"> <property name="sizePolicy">
@ -18,20 +18,23 @@
</property> </property>
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>300</width> <width>0</width>
<height>130</height> <height>0</height>
</size> </size>
</property> </property>
<property name="baseSize"> <property name="baseSize">
<size> <size>
<width>300</width> <width>0</width>
<height>130</height> <height>0</height>
</size> </size>
</property> </property>
<property name="windowTitle"> <property name="windowTitle">
<string notr="true"/> <string notr="true"/>
</property> </property>
<layout class="QGridLayout" name="gridLayout"> <layout class="QGridLayout" name="gridLayout">
<property name="sizeConstraint">
<enum>QLayout::SetMinAndMaxSize</enum>
</property>
<item row="0" column="0"> <item row="0" column="0">
<widget class="QGroupBox" name="groupBox"> <widget class="QGroupBox" name="groupBox">
<property name="sizePolicy"> <property name="sizePolicy">
@ -44,6 +47,9 @@
<string notr="true"/> <string notr="true"/>
</property> </property>
<layout class="QGridLayout" name="gridLayout_2"> <layout class="QGridLayout" name="gridLayout_2">
<property name="sizeConstraint">
<enum>QLayout::SetMinAndMaxSize</enum>
</property>
<item row="0" column="0" colspan="2"> <item row="0" column="0" colspan="2">
<widget class="QCheckBox" name="checkBox"> <widget class="QCheckBox" name="checkBox">
<property name="text"> <property name="text">
@ -53,8 +59,17 @@
</item> </item>
<item row="1" column="1"> <item row="1" column="1">
<layout class="QVBoxLayout" name="verticalLayout"> <layout class="QVBoxLayout" name="verticalLayout">
<property name="sizeConstraint">
<enum>QLayout::SetMinAndMaxSize</enum>
</property>
<item> <item>
<widget class="QPushButton" name="addChampion"> <widget class="QPushButton" name="addChampion">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text"> <property name="text">
<string>Add Champion</string> <string>Add Champion</string>
</property> </property>
@ -62,6 +77,12 @@
</item> </item>
<item> <item>
<widget class="QPushButton" name="removeChampion"> <widget class="QPushButton" name="removeChampion">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text"> <property name="text">
<string>Remove Champion</string> <string>Remove Champion</string>
</property> </property>
@ -72,15 +93,15 @@
<item row="1" column="0"> <item row="1" column="0">
<widget class="QListWidget" name="championList"> <widget class="QListWidget" name="championList">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding"> <sizepolicy hsizetype="Minimum" vsizetype="MinimumExpanding">
<horstretch>0</horstretch> <horstretch>0</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
</property> </property>
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>0</width> <width>128</width>
<height>150</height> <height>100</height>
</size> </size>
</property> </property>
<property name="showDropIndicator" stdset="0"> <property name="showDropIndicator" stdset="0">
@ -122,7 +143,7 @@
</hint> </hint>
<hint type="destinationlabel"> <hint type="destinationlabel">
<x>20</x> <x>20</x>
<y>296</y> <y>179</y>
</hint> </hint>
</hints> </hints>
</connection> </connection>
@ -133,12 +154,12 @@
<slot>addChamp()</slot> <slot>addChamp()</slot>
<hints> <hints>
<hint type="sourcelabel"> <hint type="sourcelabel">
<x>739</x> <x>389</x>
<y>328</y> <y>102</y>
</hint> </hint>
<hint type="destinationlabel"> <hint type="destinationlabel">
<x>757</x> <x>411</x>
<y>291</y> <y>179</y>
</hint> </hint>
</hints> </hints>
</connection> </connection>
@ -149,12 +170,12 @@
<slot>removeChamp()</slot> <slot>removeChamp()</slot>
<hints> <hints>
<hint type="sourcelabel"> <hint type="sourcelabel">
<x>739</x> <x>389</x>
<y>598</y> <y>146</y>
</hint> </hint>
<hint type="destinationlabel"> <hint type="destinationlabel">
<x>758</x> <x>411</x>
<y>697</y> <y>179</y>
</hint> </hint>
</hints> </hints>
</connection> </connection>