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

Do not allow floating toolboxes #684

Merged
merged 2 commits into from
Oct 17, 2023
Merged
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
11 changes: 9 additions & 2 deletions src/cfclient/ui/tab_toolbox.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,13 @@ def __init__(self, helper, tab_toolbox_name):

self._dock_area = self._get_toolbox_area_config()

# Do not allow floating toolboxes, it seems to be buggy
self.dock_widget.setFeatures(QtWidgets.QDockWidget.DockWidgetFeature.DockWidgetClosable |
QtWidgets.QDockWidget.DockWidgetFeature.DockWidgetMovable)
# If floating is set in the config, change to right docking area
if self._dock_area == Qt.DockWidgetArea.NoDockWidgetArea:
self._dock_area = Qt.DockWidgetArea.RightDockWidgetArea

def get_tab_toolbox_name(self):
"""Return the name that will be shown in the tab or toolbox"""
return self.tab_toolbox_name
Expand All @@ -90,7 +97,7 @@ def set_display_state(self, new_display_state):
self.enable()

def preferred_dock_area(self):
return Qt.DockWidgetArea(self._dock_area)
return self._dock_area

def set_preferred_dock_area(self, area):
self._dock_area = area
Expand Down Expand Up @@ -159,7 +166,7 @@ def _get_toolbox_area_config(self):
config = self._read_toolbox_area_config()

if self.tab_toolbox_name in config.keys():
result = config[self.tab_toolbox_name]
result = Qt.DockWidgetArea(config[self.tab_toolbox_name])

return result

Expand Down