Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PICARD-2791: Prevent panes of options window being fully collapsible #2345

Merged
merged 2 commits into from
Dec 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion picard/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
PICARD_DISPLAY_NAME = "MusicBrainz Picard"
PICARD_APP_ID = "org.musicbrainz.Picard"
PICARD_DESKTOP_NAME = PICARD_APP_ID + ".desktop"
PICARD_VERSION = Version(3, 0, 0, 'dev', 1)
PICARD_VERSION = Version(3, 0, 0, 'dev', 2)


# optional build version
Expand Down
6 changes: 6 additions & 0 deletions picard/config_upgrade.py
Original file line number Diff line number Diff line change
Expand Up @@ -506,6 +506,11 @@ def upgrade_to_v3_0_0_dev_1(config):
config.remove(key)


def upgrade_to_v3_0_0_dev_2(config):
"""Reset option dialog splitter states"""
config.persist['splitters_OptionsDialog'] = b''


def rename_option(config, old_opt, new_opt, option_type, default):
_s = config.setting
if old_opt in _s:
Expand Down Expand Up @@ -552,4 +557,5 @@ def upgrade_config(config):
cfg.register_upgrade_hook(upgrade_to_v2_8_0_dev_2)
cfg.register_upgrade_hook(upgrade_to_v2_9_0_alpha_2)
cfg.register_upgrade_hook(upgrade_to_v3_0_0_dev_1)
cfg.register_upgrade_hook(upgrade_to_v3_0_0_dev_2)
cfg.run_upgrade_hooks(log.debug)
13 changes: 8 additions & 5 deletions picard/ui/ui_options.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Form implementation generated from reading ui file 'ui/options.ui'
#
# Created by: PyQt6 UI code generator 6.3.1
# Created by: PyQt6 UI code generator 6.6.1
#
# WARNING: Any manual changes made to this file will be lost when pyuic6 is
# run again. Do not edit this file unless you know what you are doing.
Expand All @@ -17,25 +17,28 @@ def setupUi(self, Dialog):
self.vboxlayout.setContentsMargins(9, 9, 9, 9)
self.vboxlayout.setSpacing(6)
self.vboxlayout.setObjectName("vboxlayout")
self.dialog_splitter = QtWidgets.QSplitter(Dialog)
self.dialog_splitter = QtWidgets.QSplitter(parent=Dialog)
self.dialog_splitter.setOrientation(QtCore.Qt.Orientation.Horizontal)
self.dialog_splitter.setChildrenCollapsible(False)
self.dialog_splitter.setObjectName("dialog_splitter")
self.pages_tree = QtWidgets.QTreeWidget(self.dialog_splitter)
self.pages_tree = QtWidgets.QTreeWidget(parent=self.dialog_splitter)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Ignored, QtWidgets.QSizePolicy.Policy.Expanding)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.pages_tree.sizePolicy().hasHeightForWidth())
self.pages_tree.setSizePolicy(sizePolicy)
self.pages_tree.setMinimumSize(QtCore.QSize(140, 0))
self.pages_tree.setObjectName("pages_tree")
self.pages_stack = QtWidgets.QStackedWidget(self.dialog_splitter)
self.pages_stack = QtWidgets.QStackedWidget(parent=self.dialog_splitter)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Ignored, QtWidgets.QSizePolicy.Policy.Preferred)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.pages_stack.sizePolicy().hasHeightForWidth())
self.pages_stack.setSizePolicy(sizePolicy)
self.pages_stack.setMinimumSize(QtCore.QSize(280, 0))
self.pages_stack.setObjectName("pages_stack")
self.vboxlayout.addWidget(self.dialog_splitter)
self.buttonbox = QtWidgets.QDialogButtonBox(Dialog)
self.buttonbox = QtWidgets.QDialogButtonBox(parent=Dialog)
self.buttonbox.setMinimumSize(QtCore.QSize(0, 0))
self.buttonbox.setOrientation(QtCore.Qt.Orientation.Horizontal)
self.buttonbox.setObjectName("buttonbox")
Expand Down
15 changes: 15 additions & 0 deletions ui/options.ui
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,22 @@
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="childrenCollapsible">
<bool>false</bool>
</property>
<widget class="QTreeWidget" name="pages_tree">
<property name="sizePolicy">
<sizepolicy hsizetype="Ignored" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>140</width>
<height>0</height>
</size>
</property>
<column>
<property name="text">
<string/>
Expand All @@ -54,6 +63,12 @@
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>280</width>
<height>0</height>
</size>
</property>
</widget>
</widget>
</item>
Expand Down
Loading