Use FlowLayout in AddTorrentParamsWidget

This commit is contained in:
Vladimir Golovnev (Glassez) 2023-04-13 11:48:07 +03:00
parent 905f141657
commit 341b2f345a
No known key found for this signature in database
GPG key ID: 52A2C7DEE2DFA6F7
2 changed files with 196 additions and 179 deletions

View file

@ -33,6 +33,7 @@
#include "base/bittorrent/session.h" #include "base/bittorrent/session.h"
#include "base/bittorrent/torrent.h" #include "base/bittorrent/torrent.h"
#include "base/utils/compare.h" #include "base/utils/compare.h"
#include "flowlayout.h"
#include "fspathedit.h" #include "fspathedit.h"
#include "torrenttagsdialog.h" #include "torrenttagsdialog.h"
#include "ui_addtorrentparamswidget.h" #include "ui_addtorrentparamswidget.h"
@ -92,6 +93,14 @@ AddTorrentParamsWidget::AddTorrentParamsWidget(BitTorrent::AddTorrentParams addT
dlg->open(); dlg->open();
}); });
auto *miscParamsLayout = new FlowLayout(m_ui->miscParamsWidget);
miscParamsLayout->setContentsMargins(0, 0, 0, 0);
miscParamsLayout->addWidget(m_ui->contentLayoutWidget);
miscParamsLayout->addWidget(m_ui->skipCheckingWidget);
miscParamsLayout->addWidget(m_ui->startTorrentWidget);
miscParamsLayout->addWidget(m_ui->stopConditionWidget);
miscParamsLayout->addWidget(m_ui->addToQueueTopWidget);
populate(); populate();
} }

View file

@ -7,7 +7,7 @@
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>503</width> <width>503</width>
<height>338</height> <height>366</height>
</rect> </rect>
</property> </property>
<property name="windowTitle"> <property name="windowTitle">
@ -169,7 +169,16 @@
</item> </item>
<item> <item>
<widget class="QWidget" name="miscParamsWidget" native="true"> <widget class="QWidget" name="miscParamsWidget" native="true">
<layout class="QVBoxLayout" name="miscParamsLayout"> <widget class="QWidget" name="startTorrentWidget" native="true">
<property name="geometry">
<rect>
<x>9</x>
<y>65</y>
<width>143</width>
<height>22</height>
</rect>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<property name="leftMargin"> <property name="leftMargin">
<number>0</number> <number>0</number>
</property> </property>
@ -177,44 +186,11 @@
<number>0</number> <number>0</number>
</property> </property>
<property name="rightMargin"> <property name="rightMargin">
<number>0</number> <number>2</number>
</property> </property>
<property name="bottomMargin"> <property name="bottomMargin">
<number>0</number> <number>0</number>
</property> </property>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLabel" name="contentLayoutLabel">
<property name="text">
<string>Content layout:</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="contentLayoutComboBox">
<property name="currentIndex">
<number>-1</number>
</property>
</widget>
</item>
<item>
<spacer name="contentLayoutSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="startTorrentLayout">
<item> <item>
<widget class="QLabel" name="startTorrentLabel"> <widget class="QLabel" name="startTorrentLabel">
<property name="text"> <property name="text">
@ -229,54 +205,30 @@
</property> </property>
</widget> </widget>
</item> </item>
<item>
<spacer name="startTorrentSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout> </layout>
</item>
<item>
<layout class="QHBoxLayout" name="stopConditionLayout">
<item>
<widget class="QLabel" name="stopConditionLabel">
<property name="text">
<string>Stop condition:</string>
</property>
</widget> </widget>
</item> <widget class="QWidget" name="skipCheckingWidget" native="true">
<item> <property name="geometry">
<widget class="QComboBox" name="stopConditionComboBox"> <rect>
<property name="currentIndex"> <x>9</x>
<number>-1</number> <y>37</y>
<width>164</width>
<height>22</height>
</rect>
</property> </property>
</widget>
</item>
<item>
<spacer name="stopConditionSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="skipCheckingLayout"> <layout class="QHBoxLayout" name="skipCheckingLayout">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>2</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item> <item>
<widget class="QLabel" name="skipCheckingLabel"> <widget class="QLabel" name="skipCheckingLabel">
<property name="text"> <property name="text">
@ -291,23 +243,106 @@
</property> </property>
</widget> </widget>
</item> </item>
</layout>
</widget>
<widget class="QWidget" name="contentLayoutWidget" native="true">
<property name="geometry">
<rect>
<x>9</x>
<y>9</y>
<width>159</width>
<height>22</height>
</rect>
</property>
<layout class="QHBoxLayout" name="contentLayoutLayout">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>2</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item> <item>
<spacer name="skipCheckingSpacer"> <widget class="QLabel" name="contentLayoutLabel">
<property name="orientation"> <property name="text">
<enum>Qt::Horizontal</enum> <string>Content layout:</string>
</property> </property>
<property name="sizeHint" stdset="0"> </widget>
<size> </item>
<width>40</width> <item>
<height>20</height> <widget class="QComboBox" name="contentLayoutComboBox">
</size> <property name="currentIndex">
<number>-1</number>
</property> </property>
</spacer> </widget>
</item> </item>
</layout> </layout>
</widget>
<widget class="QWidget" name="stopConditionWidget" native="true">
<property name="geometry">
<rect>
<x>9</x>
<y>93</y>
<width>158</width>
<height>22</height>
</rect>
</property>
<layout class="QHBoxLayout" name="stopConditionLayout">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>2</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="QLabel" name="stopConditionLabel">
<property name="text">
<string>Stop condition:</string>
</property>
</widget>
</item> </item>
<item> <item>
<widget class="QComboBox" name="stopConditionComboBox">
<property name="currentIndex">
<number>-1</number>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="addToQueueTopWidget" native="true">
<property name="geometry">
<rect>
<x>9</x>
<y>121</y>
<width>187</width>
<height>22</height>
</rect>
</property>
<layout class="QHBoxLayout" name="addToQueueTopLayout"> <layout class="QHBoxLayout" name="addToQueueTopLayout">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>2</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item> <item>
<widget class="QLabel" name="addToQueueTopLabel"> <widget class="QLabel" name="addToQueueTopLabel">
<property name="text"> <property name="text">
@ -322,36 +357,9 @@
</property> </property>
</widget> </widget>
</item> </item>
<item>
<spacer name="addToQueueTopSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
</layout> </layout>
</widget> </widget>
</item> </widget>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item> </item>
</layout> </layout>
</widget> </widget>