Skip to content

Commit

Permalink
Merge pull request #684 from bitcraze/krichardsson/issue-678
Browse files Browse the repository at this point in the history
Do not allow floating toolboxes
  • Loading branch information
knmcguire authored Oct 17, 2023
2 parents 4edd71a + 39a4e3b commit 7dcde45
Showing 1 changed file with 9 additions and 2 deletions.
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

0 comments on commit 7dcde45

Please sign in to comment.