Use a single button to save vertical space

This commit is contained in:
Kovid Goyal 2023-04-03 13:30:36 +05:30
parent 2647bbd621
commit 8a2b4ac5da
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 26 additions and 19 deletions

View File

@ -333,8 +333,10 @@ class ConfigWidget(ConfigWidgetBase, Ui_Form):
self.select_default_button.clicked.connect(self.changed_signal)
self.set_as_default_button.clicked.connect(self.fields_model.commit_user_defaults)
self.tag_map_rules = self.author_map_rules = None
self.tag_map_rules_button.clicked.connect(self.change_tag_map_rules)
self.author_map_rules_button.clicked.connect(self.change_author_map_rules)
m = QMenu(self)
m.addAction(_('Tags')).triggered.connect(self.change_tag_map_rules)
m.addAction(_('Authors')).triggered.connect(self.change_author_map_rules)
self.map_rules_button.setMenu(m)
l = self.page.layout()
l.setStretch(0, 1)
l.setStretch(1, 1)

View File

@ -163,8 +163,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>356</width>
<height>462</height>
<width>350</width>
<height>441</height>
</rect>
</property>
<property name="sizePolicy">
@ -226,20 +226,25 @@
</widget>
</item>
<item row="5" column="0" colspan="2">
<widget class="QPushButton" name="tag_map_rules_button">
<widget class="QToolButton" name="map_rules_button">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Create &amp;rules to filter/transform tags</string>
<string>Create &amp;rules to transform tags/authors</string>
</property>
<property name="popupMode">
<enum>QToolButton::InstantPopup</enum>
</property>
<property name="toolButtonStyle">
<enum>Qt::ToolButtonTextOnly</enum>
</property>
</widget>
</item>
<item row="6" column="0" colspan="2">
<widget class="QPushButton" name="author_map_rules_button">
<property name="text">
<string>Create rules to &amp;transform author names</string>
</property>
</widget>
</item>
<item row="7" column="0">
<item row="6" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
<string>Max. &amp;number of tags to download:</string>
@ -249,10 +254,10 @@
</property>
</widget>
</item>
<item row="7" column="1">
<item row="6" column="1">
<widget class="QSpinBox" name="opt_max_tags"/>
</item>
<item row="8" column="0">
<item row="7" column="0">
<widget class="QLabel" name="label_3">
<property name="text">
<string>Max. &amp;time to wait after first match is found:</string>
@ -262,14 +267,14 @@
</property>
</widget>
</item>
<item row="8" column="1">
<item row="7" column="1">
<widget class="QSpinBox" name="opt_wait_after_first_identify_result">
<property name="suffix">
<string> secs</string>
</property>
</widget>
</item>
<item row="9" column="0">
<item row="8" column="0">
<widget class="QLabel" name="label_4">
<property name="text">
<string>Max. time to wait after first &amp;cover is found:</string>
@ -279,7 +284,7 @@
</property>
</widget>
</item>
<item row="9" column="1">
<item row="8" column="1">
<widget class="QSpinBox" name="opt_wait_after_first_cover_result">
<property name="suffix">
<string> secs</string>