Update topbar for only_multiple_scenes.. preference
This commit is contained in:
parent
369f350e02
commit
1273ab83ef
@ -1,7 +1,7 @@
|
|||||||
from .. import __package__ as base_package
|
from .. import __package__ as base_package
|
||||||
import bpy
|
import bpy
|
||||||
from bpy.types import Header, Panel
|
from bpy.types import Header, Panel
|
||||||
from .funcs import get_scene_workspaces, get_use_topbar, get_switch, get_compact
|
from .funcs import get_scene_workspaces, get_use_topbar, get_switch, get_compact, get_only_with_multiple
|
||||||
|
|
||||||
# Ref TOPBAR_HT_upper_bar https://projects.blender.org/blender/blender/src/commit/2204157a2c9fc926643b0e39968602c750d9b5e6/scripts/startup/bl_ui/space_topbar.py#L14
|
# Ref TOPBAR_HT_upper_bar https://projects.blender.org/blender/blender/src/commit/2204157a2c9fc926643b0e39968602c750d9b5e6/scripts/startup/bl_ui/space_topbar.py#L14
|
||||||
class TOPBAR_HT_upper_bar(Header):
|
class TOPBAR_HT_upper_bar(Header):
|
||||||
@ -29,6 +29,9 @@ class TOPBAR_HT_upper_bar(Header):
|
|||||||
use_topbar = get_use_topbar()
|
use_topbar = get_use_topbar()
|
||||||
compact = get_compact()
|
compact = get_compact()
|
||||||
switch= get_switch()
|
switch= get_switch()
|
||||||
|
only_with_multiple = get_only_with_multiple()
|
||||||
|
has_multiple = len(bpy.data.scenes) > 1
|
||||||
|
multiple_satisfied = (not only_with_multiple or only_with_multiple and has_multiple)
|
||||||
|
|
||||||
if not screen.show_fullscreen:
|
if not screen.show_fullscreen:
|
||||||
main_col = layout.column()
|
main_col = layout.column()
|
||||||
@ -37,11 +40,11 @@ class TOPBAR_HT_upper_bar(Header):
|
|||||||
main_row = main_col.row()
|
main_row = main_col.row()
|
||||||
sy = 1.18
|
sy = 1.18
|
||||||
sx = 1.18
|
sx = 1.18
|
||||||
if switch:
|
if switch and multiple_satisfied:
|
||||||
col = main_row.column()
|
col = main_row.column()
|
||||||
# Show/Hide Custom Topbar
|
# Show/Hide Custom Topbar
|
||||||
col.operator("sw.switch", text="", emboss=False, icon="CHECKBOX_HLT" if use_topbar else "CHECKBOX_DEHLT")
|
col.operator("sw.switch", text="", emboss=False, icon="CHECKBOX_HLT" if use_topbar else "CHECKBOX_DEHLT")
|
||||||
if not use_topbar:
|
if not use_topbar or not multiple_satisfied:
|
||||||
# Original
|
# Original
|
||||||
layout.template_ID_tabs(window, "workspace", new="workspace.add", menu="TOPBAR_MT_workspace_menu")
|
layout.template_ID_tabs(window, "workspace", new="workspace.add", menu="TOPBAR_MT_workspace_menu")
|
||||||
else:
|
else:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user