def setup_ui(self) -> None:
super().setup_ui()
self.autosave_control = TimeEdit(self)
self.base_ppi_spinbox = SpinBox(
self, 1, 999, valueChanged=lambda: hasattr(main_window(), 'timeline') and main_window().timeline.set_sizes()
)
self.dark_theme_checkbox = CheckBox('Dark theme', self, clicked=lambda: main_window().apply_stylesheet())
self.opengl_rendering_checkbox = CheckBox('OpenGL rendering', self)
self.force_old_storages_removal_checkbox = CheckBox('Remove old storages', self)
self.output_index_spinbox = SpinBox(self, 0, 65535)
self.png_compressing_spinbox = SpinBox(self, 0, 100)
self.statusbar_timeout_control = TimeEdit(self)
self.timeline_notches_margin_spinbox = SpinBox(self, 1, 9999, '%')
self.usable_cpus_spinbox = SpinBox(self, 1, self.get_usable_cpus_count())
self.zoom_levels_combobox = ComboBox[int](editable=True, insertPolicy=QComboBox.InsertPolicy.NoInsert)
self.zoom_levels_lineedit = self.zoom_levels_combobox.lineEdit()
self.zoom_levels_lineedit.returnPressed.connect(self.zoom_levels_combobox_on_add)
QShortcut( # type: ignore
QKeyCombination(Qt.Modifier.CTRL, Qt.Key.Key_Delete).toCombined(), self.zoom_levels_combobox,
activated=partial(self.zoom_levels_combobox_on_remove, True)
)
self.zoom_level_default_combobox = ComboBox[int]()
self.dragnavigator_timeout_spinbox = SpinBox(self, 0, 1000 * 60 * 5)
self.dragtimeline_timeout_spinbox = SpinBox(self, 0, 500)
self.primaries_combobox = ComboBox[str](
model=GeneralModel[str]([
'sRGB', 'DCI-P3'
], False)
)
self.color_management_checkbox = CheckBox('Color management', self)
self.plugins_save_position_combobox = ComboBox[str](model=GeneralModel[str](['no', 'global', 'local']))
HBoxLayout(self.vlayout, [QLabel('Autosave interval (0 - disable)'), self.autosave_control])
HBoxLayout(self.vlayout, [QLabel('Base PPI'), self.base_ppi_spinbox])
HBoxLayout(self.vlayout, [self.dark_theme_checkbox, self.force_old_storages_removal_checkbox])
HBoxLayout(self.vlayout, [self.opengl_rendering_checkbox])
HBoxLayout(self.vlayout, [QLabel('Default output index'), self.output_index_spinbox])
HBoxLayout(self.vlayout, [QLabel('PNG compression level (0 (max) - 100 (min))'), self.png_compressing_spinbox])
HBoxLayout(self.vlayout, [QLabel('Status bar message timeout'), self.statusbar_timeout_control])
HBoxLayout(self.vlayout, [
QLabel('Timeline label notches margin', self), self.timeline_notches_margin_spinbox
])
HBoxLayout(self.vlayout, [QLabel('Usable CPUs count'), self.usable_cpus_spinbox])
HBoxLayout(self.vlayout, [
VBoxLayout([
QLabel('Zoom Levels'),
HBoxLayout([
self.zoom_levels_combobox,
PushButton('❌', clicked=self.zoom_levels_combobox_on_remove, maximumWidth=18),
PushButton('✔️', clicked=self.zoom_levels_combobox_on_add, maximumWidth=18),
])
]),
VBoxLayout([QLabel('Default Zoom Level'), self.zoom_level_default_combobox])
])
HBoxLayout(self.vlayout, [QLabel('Drag Navigator Timeout (ms)'), self.dragnavigator_timeout_spinbox])
HBoxLayout(self.vlayout, [QLabel('Drag Timeline Timeout (ms)'), self.dragtimeline_timeout_spinbox])
HBoxLayout(self.vlayout, [QLabel('Output Primaries'), self.primaries_combobox])
HBoxLayout(self.vlayout, [QLabel('Save Plugins Bar Position'), self.plugins_save_position_combobox])
if sys.platform == 'win32':
HBoxLayout(self.vlayout, [self.color_management_checkbox])