mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-15 10:47:49 -06:00
Move sidebar target for plugins to only middle section
This commit is contained in:
parent
5673a834bc
commit
e33288b7c8
7 changed files with 67 additions and 92 deletions
|
@ -10,7 +10,7 @@ class SidebarController:
|
|||
|
||||
def __init__(self, application):
|
||||
self._application = application
|
||||
self._sidebar_views = {}
|
||||
self._sidebar_views = {"default": {}} # default is needed for the default settings sidebar
|
||||
self._active_sidebar_view = None
|
||||
|
||||
# Register the sidebar_view plugin type so plugins can expose custom sidebar views.
|
||||
|
@ -51,6 +51,13 @@ class SidebarController:
|
|||
def getActiveSidebarView(self):
|
||||
return self._active_sidebar_view
|
||||
|
||||
## Get the ID of the active sidebar view.
|
||||
def getActiveSidebarViewId(self):
|
||||
if self._active_sidebar_view:
|
||||
if hasattr(self._active_sidebar_view, "getPluginId"):
|
||||
return self._active_sidebar_view.getPluginId()
|
||||
return "default"
|
||||
|
||||
## Change the active sidebar view to one of the registered views.
|
||||
def setActiveSidebarView(self, sidebar_view_id: str):
|
||||
if sidebar_view_id in self._sidebar_views:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue