Enhancement #1857312: Please make the boxes in User categories editor the same size. Move the buttons cancel and OK to the right

This commit is contained in:
Charles Haley 2019-12-23 14:59:35 +00:00
parent 9cc7033fc1
commit 8e3d3512e7
2 changed files with 143 additions and 266 deletions

View File

@ -45,6 +45,12 @@ class TagCategories(QDialog, Ui_TagCategories):
Ui_TagCategories.__init__(self) Ui_TagCategories.__init__(self)
self.setupUi(self) self.setupUi(self)
# I can't figure out how to get these into the .ui file
self.gridLayout_2.setColumnMinimumWidth(0, 50)
self.gridLayout_2.setColumnStretch(0, 1)
self.gridLayout_2.setColumnMinimumWidth(2, 50)
self.gridLayout_2.setColumnStretch(2, 1)
# Remove help icon on title bar # Remove help icon on title bar
icon = self.windowIcon() icon = self.windowIcon()
self.setWindowFlags(self.windowFlags()&(~Qt.WindowContextHelpButtonHint)) self.setWindowFlags(self.windowFlags()&(~Qt.WindowContextHelpButtonHint))

View File

@ -9,228 +9,163 @@
<width>628</width> <width>628</width>
<height>482</height> <height>482</height>
</rect> </rect>
</property> </property> <property name="windowTitle">
<property name="windowTitle">
<string>User categories editor</string> <string>User categories editor</string>
</property> </property>
<property name="windowIcon"> <property name="windowIcon">
<iconset resource="../../../../resources/images.qrc"> <iconset resource="../../../../resources/images.qrc">
<normaloff>:/images/chapters.png</normaloff>:/images/chapters.png</iconset> <normaloff>:/images/chapters.png</normaloff>:/images/chapters.png</iconset>
</property> </property>
<layout class="QGridLayout" name="gridLayout_2"> <layout class="QVBoxLayout">
<item row="0" column="0"> <item>
<layout class="QFormLayout" name="formLayout"> <layout class="QGridLayout" name="gridLayout_4">
<item row="0" column="0"> <item row="0" column="0">
<widget class="QLabel" name="label_3"> <layout class="QFormLayout" name="formLayout">
<property name="sizePolicy"> <item row="0" column="0">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred"> <widget class="QLabel" name="label_3">
<horstretch>0</horstretch> <property name="text">
<verstretch>0</verstretch> <string>Category &amp;name: </string>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>100</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>Category &amp;name: </string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
<property name="buddy">
<cstring>category_box</cstring>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QComboBox" name="category_box">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>160</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>145</width>
<height>0</height>
</size>
</property>
<property name="toolTip">
<string>Select a category to edit</string>
</property>
<property name="editable">
<bool>false</bool>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_5">
<property name="text">
<string>&amp;Category filter: </string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
<property name="buddy">
<cstring>category_filter_box</cstring>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QComboBox" name="category_filter_box">
<property name="toolTip">
<string>Select the content kind of the new category</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="0" column="1" colspan="3">
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QToolButton" name="delete_category_button">
<property name="toolTip">
<string>Delete this selected tag category</string>
</property>
<property name="text">
<string>...</string>
</property>
<property name="icon">
<iconset resource="../../../../resources/images.qrc">
<normaloff>:/images/trash.png</normaloff>:/images/trash.png</iconset>
</property>
</widget>
</item>
<item row="0" column="1">
<layout class="QHBoxLayout">
<item>
<widget class="QLineEdit" name="input_box">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>60</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property> </property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
<property name="buddy">
<cstring>category_box</cstring>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QComboBox" name="category_box">
<property name="toolTip"> <property name="toolTip">
<string>Enter a category name, then use the add button or the rename button</string> <string>Select a category to edit</string>
</property> </property>
<property name="clearButtonEnabled"> <property name="editable">
<bool>true</bool> <bool>false</bool>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item row="1" column="0">
<widget class="QToolButton" name="add_category_button"> <widget class="QLabel" name="label_5">
<property name="text">
<string>&amp;Category filter: </string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
<property name="buddy">
<cstring>category_filter_box</cstring>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QComboBox" name="category_filter_box">
<property name="toolTip"> <property name="toolTip">
<string>Add a new category</string> <string>Select the content kind of the new category</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="0" column="1" colspan="3">
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QToolButton" name="delete_category_button">
<property name="toolTip">
<string>Delete this selected tag category</string>
</property> </property>
<property name="text"> <property name="text">
<string>...</string> <string>...</string>
</property> </property>
<property name="icon"> <property name="icon">
<iconset resource="../../../../resources/images.qrc"> <iconset resource="../../../../resources/images.qrc">
<normaloff>:/images/plus.png</normaloff>:/images/plus.png</iconset> <normaloff>:/images/trash.png</normaloff>:/images/trash.png</iconset>
</property> </property>
</widget> </widget>
</item> </item>
</layout> <item row="0" column="1">
</item> <layout class="QHBoxLayout">
<item row="0" column="2"> <item>
<widget class="QToolButton" name="rename_category_button"> <widget class="QLineEdit" name="input_box">
<property name="toolTip"> <property name="toolTip">
<string>Rename the current category to what is in the box</string> <string>Enter a category name, then use the add button or the rename button</string>
</property> </property>
<property name="text"> <property name="clearButtonEnabled">
<string>...</string> <bool>true</bool>
</property> </property>
<property name="icon"> </widget>
<iconset resource="../../../../resources/images.qrc"> </item>
<normaloff>:/images/edit-undo.png</normaloff>:/images/edit-undo.png</iconset> <item>
</property> <widget class="QToolButton" name="add_category_button">
</widget> <property name="toolTip">
</item> <string>Add a new category</string>
<item row="1" column="0" colspan="3"> </property>
<widget class="QCheckBox" name="apply_vl_checkbox"> <property name="text">
<property name="toolTip"> <string>...</string>
<string>&lt;p&gt;Show items in the Available items box only if they appear in the </property>
current virtual library. Applied items not in the VL will be marked <property name="icon">
&quot;not on any book&quot;.&lt;/p&gt;</string> <iconset resource="../../../../resources/images.qrc">
</property> <normaloff>:/images/plus.png</normaloff>:/images/plus.png</iconset>
<property name="text"> </property>
<string>&amp;Show only available items in current virtual library</string> </widget>
</property> </item>
</widget> </layout>
</item> </item>
</layout> <item row="0" column="2">
</item> <widget class="QToolButton" name="rename_category_button">
<item row="1" column="0"> <property name="toolTip">
<layout class="QVBoxLayout"> <string>Rename the current category to what is in the box</string>
<item> </property>
<layout class="QHBoxLayout">
<item>
<widget class="QLabel" name="label">
<property name="text"> <property name="text">
<string>&amp;Available items</string> <string>...</string>
</property> </property>
<property name="buddy"> <property name="icon">
<cstring>available_items_box</cstring> <iconset resource="../../../../resources/images.qrc">
<normaloff>:/images/edit-undo.png</normaloff>:/images/edit-undo.png</iconset>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item row="1" column="0" colspan="3">
<spacer> <widget class="QCheckBox" name="apply_vl_checkbox">
<property name="orientation"> <property name="toolTip">
<enum>Qt::Horizontal</enum> <string>&lt;p&gt;Show items in the Available items box only if they appear in the
current virtual library. Applied items not in the VL will be marked
&quot;not on any book&quot;.&lt;/p&gt;</string>
</property> </property>
<property name="sizeHint" stdset="0"> <property name="text">
<size> <string>&amp;Show only available items in current virtual library</string>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout">
<item>
<widget class="QListWidget" name="available_items_box">
<property name="alternatingRowColors">
<bool>true</bool>
</property>
<property name="selectionMode">
<enum>QAbstractItemView::MultiSelection</enum>
</property>
<property name="selectionBehavior">
<enum>QAbstractItemView::SelectRows</enum>
</property> </property>
</widget> </widget>
</item> </item>
</layout> </layout>
</item> </item>
</layout> </layout>
</item> </item>
<item row="1" column="1"> <item>
<layout class="QVBoxLayout"> <layout class="QGridLayout" name="gridLayout_2">
<item> <item row="1" column="0">
<spacer> <widget class="QLabel" name="label">
<property name="orientation"> <property name="text">
<enum>Qt::Vertical</enum> <string>&amp;Available items</string>
</property> </property>
<property name="sizeHint" stdset="0"> <property name="buddy">
<size> <cstring>available_items_box</cstring>
<width>20</width>
<height>40</height>
</size>
</property> </property>
</spacer> </widget>
</item> </item>
<item> <item row="2" column="0">
<widget class="QListWidget" name="available_items_box">
<property name="alternatingRowColors">
<bool>true</bool>
</property>
<property name="selectionMode">
<enum>QAbstractItemView::MultiSelection</enum>
</property>
<property name="selectionBehavior">
<enum>QAbstractItemView::SelectRows</enum>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QToolButton" name="apply_button"> <widget class="QToolButton" name="apply_button">
<property name="toolTip"> <property name="toolTip">
<string>Apply tags to current tag category</string> <string>Apply tags to current tag category</string>
@ -244,51 +179,17 @@
</property> </property>
</widget> </widget>
</item> </item>
<item> <item row="1" column="2">
<spacer> <widget class="QLabel" name="label_2">
<property name="orientation"> <property name="text">
<enum>Qt::Vertical</enum> <string>Applied &amp;items</string>
</property> </property>
<property name="sizeHint" stdset="0"> <property name="buddy">
<size> <cstring>applied_items_box</cstring>
<width>20</width>
<height>40</height>
</size>
</property> </property>
</spacer> </widget>
</item> </item>
</layout> <item row="2" column="2">
</item>
<item row="1" column="2">
<layout class="QVBoxLayout">
<item>
<layout class="QHBoxLayout">
<item>
<widget class="QLabel" name="label_2">
<property name="text">
<string>Applied &amp;items</string>
</property>
<property name="buddy">
<cstring>applied_items_box</cstring>
</property>
</widget>
</item>
<item>
<spacer>
<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>
<widget class="QListWidget" name="applied_items_box"> <widget class="QListWidget" name="applied_items_box">
<property name="alternatingRowColors"> <property name="alternatingRowColors">
<bool>true</bool> <bool>true</bool>
@ -298,24 +199,7 @@
</property> </property>
</widget> </widget>
</item> </item>
</layout> <item row="2" column="3">
</item>
<item row="1" column="3">
<layout class="QVBoxLayout">
<item>
<spacer>
<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>
<widget class="QToolButton" name="unapply_button"> <widget class="QToolButton" name="unapply_button">
<property name="toolTip"> <property name="toolTip">
<string>Unapply (remove) tag from current tag category</string> <string>Unapply (remove) tag from current tag category</string>
@ -329,34 +213,21 @@
</property> </property>
</widget> </widget>
</item> </item>
<item> <item row="3" column="0" colspan="4">
<spacer> <widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation"> <property name="orientation">
<enum>Qt::Vertical</enum> <enum>Qt::Horizontal</enum>
</property> </property>
<property name="sizeHint" stdset="0"> <property name="standardButtons">
<size> <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
<width>20</width>
<height>40</height>
</size>
</property> </property>
</spacer> <property name="centerButtons">
<bool>false</bool>
</property>
</widget>
</item> </item>
</layout> </layout>
</item> </item>
<item row="2" column="0" colspan="4">
<widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
</property>
<property name="centerButtons">
<bool>true</bool>
</property>
</widget>
</item>
</layout> </layout>
</widget> </widget>
<resources> <resources>