Use CheckableComboBox in ui file

This commit is contained in:
Mizaki 2024-02-11 01:51:47 +00:00
parent a6b60a4317
commit e9e619c992
2 changed files with 28 additions and 15 deletions

View File

@ -61,7 +61,6 @@ from comictaggerlib.resulttypes import Action, IssueResult, MatchStatus, OnlineM
from comictaggerlib.seriesselectionwindow import SeriesSelectionWindow
from comictaggerlib.settingswindow import SettingsWindow
from comictaggerlib.ui import ui_path
from comictaggerlib.ui.customwidgets import CheckableComboBox
from comictaggerlib.ui.qtutils import center_window_on_parent, enable_widget, reduce_widget_font_size
from comictaggerlib.versionchecker import VersionChecker
from comictalker.comictalker import ComicTalker, TalkerError
@ -227,19 +226,6 @@ class TaggerWindow(QtWidgets.QMainWindow):
self.save_data_styles: list[str] = config[0].internal__save_data_style
self.load_data_style: str = config[0].internal__load_data_style
# Add multiselect combobox
self.cbSaveDataStyle = CheckableComboBox()
self.cbSaveDataStyle.setToolTip("At least 1 save style is required")
# Add normal combobox for read style (TODO support multiple read styles)
self.cbLoadDataStyle = QtWidgets.QComboBox()
# Need to set minimum or source_style_formLayout will resize larger than 230px which will affect the
# file info box and cover image width underneath
self.cbLoadDataStyle.setMinimumWidth(100)
self.cbSaveDataStyle.setMinimumWidth(100)
self.source_style_formLayout.addRow("Read Style", self.cbLoadDataStyle)
self.source_style_formLayout.addRow("Modify Styles", self.cbSaveDataStyle)
self.setAcceptDrops(True)
self.view_tag_actions, self.remove_tag_actions = self.tag_actions()
self.config_menus()

View File

@ -52,7 +52,7 @@
<item>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<layout class="QFormLayout" name="source_style_formLayout">
<layout class="QFormLayout" name="style_layout">
<property name="fieldGrowthPolicy">
<enum>QFormLayout::AllNonFixedFieldsGrow</enum>
</property>
@ -75,6 +75,26 @@
<item row="0" column="1">
<widget class="QComboBox" name="cbx_sources"/>
</item>
<item row="1" column="1">
<widget class="QComboBox" name="cbLoadDataStyle"/>
</item>
<item row="2" column="1">
<widget class="CheckableComboBox" name="cbSaveDataStyle"/>
</item>
<item row="1" column="0">
<widget class="QLabel" name="lbl_read_style">
<property name="text">
<string>Read Style</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="lbl_modify_style">
<property name="text">
<string>Modify Styles</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
@ -1441,6 +1461,13 @@
</action>
</widget>
<layoutdefault spacing="6" margin="11"/>
<customwidgets>
<customwidget>
<class>CheckableComboBox</class>
<extends>QComboBox</extends>
<header>comictaggerlib.ui.customwidgets</header>
</customwidget>
</customwidgets>
<resources/>
<connections/>
</ui>