mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-18 04:07:57 -06:00
View default view selected in view menu
This commit is contained in:
parent
030dc74f3f
commit
a6a3602840
2 changed files with 7 additions and 7 deletions
|
@ -26,11 +26,11 @@ class SidebarViewModel(ListModel):
|
||||||
## Update the model when new views are added or another view is made the active view.
|
## Update the model when new views are added or another view is made the active view.
|
||||||
def _onSidebarViewsChanged(self):
|
def _onSidebarViewsChanged(self):
|
||||||
items = []
|
items = []
|
||||||
current_view_id = None
|
current_view_id = "default"
|
||||||
|
|
||||||
sidebar_views = self._controller.getAllSidebarViews()
|
sidebar_views = self._controller.getAllSidebarViews()
|
||||||
current_view = self._controller.getActiveSidebarView()
|
current_view = self._controller.getActiveSidebarView()
|
||||||
if current_view:
|
if current_view and hasattr(current_view, "getPluginId"):
|
||||||
current_view_id = current_view.getPluginId()
|
current_view_id = current_view.getPluginId()
|
||||||
|
|
||||||
for sidebar_view_id, sidebar_view in sidebar_views.items():
|
for sidebar_view_id, sidebar_view in sidebar_views.items():
|
||||||
|
@ -39,9 +39,9 @@ class SidebarViewModel(ListModel):
|
||||||
if sidebar_view_id == "default":
|
if sidebar_view_id == "default":
|
||||||
items.append({
|
items.append({
|
||||||
"id": "default",
|
"id": "default",
|
||||||
"name": "Print settings",
|
"name": "Print settings sidebar",
|
||||||
"weight": 0,
|
"active": sidebar_view_id == current_view_id,
|
||||||
"active": current_view_id == "default"
|
"weight": 0
|
||||||
})
|
})
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
@ -52,7 +52,7 @@ class SidebarViewModel(ListModel):
|
||||||
continue
|
continue
|
||||||
|
|
||||||
name = sidebar_view_metadata.get("name", sidebar_view_id)
|
name = sidebar_view_metadata.get("name", sidebar_view_id)
|
||||||
weight = sidebar_view_metadata.get("weight", 0)
|
weight = sidebar_view_metadata.get("weight", 1)
|
||||||
|
|
||||||
items.append({
|
items.append({
|
||||||
"id": sidebar_view_id,
|
"id": sidebar_view_id,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue