Skip to content

Commit

Permalink
Do not allow floating toolboxes
Browse files Browse the repository at this point in the history
  • Loading branch information
krichardsson committed Oct 17, 2023
1 parent 4edd71a commit f67dc54
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/cfclient/ui/tab_toolbox.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,14 @@ 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 +98,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 +167,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 f67dc54

Please sign in to comment.