Fix #6087. (again)

I don't know why depress was used. To make it colour in blue?
This commit is contained in:
Dion Moult
2025-02-03 12:36:18 +11:00
parent b2a4529904
commit f3f7510b48
2 changed files with 9 additions and 7 deletions
+3
View File
@@ -188,6 +188,9 @@ def refresh_ui_data():
and it need to be refreshed manually if needed.
"""
from bonsai.bim import modules
import bonsai.bim.ui
bonsai.bim.ui.refresh()
for name, value in modules.items():
try:
+6 -7
View File
@@ -408,9 +408,6 @@ class BIM_PT_tabs(Panel):
is_ifc_project = bool(tool.Ifc.get())
aprops = tool.Blender.get_area_props(context)
ifc_icon = f"{UIData.data['icon_color_mode']}_ifc"
theme = bpy.context.preferences.themes[0].user_interface
original_text_sel = theme.wcol_regular.text_sel # Store original color
theme.wcol_regular.text_sel = theme.wcol_regular.text # Override the text_sel color
row = self.layout.row()
row.alignment = "CENTER"
@@ -418,7 +415,6 @@ class BIM_PT_tabs(Panel):
"bim.set_tab",
text="",
emboss=aprops.tab == "PROJECT",
depress=True,
icon_value=bonsai.bim.icons[ifc_icon].icon_id,
).tab = "PROJECT"
self.draw_tab_entry(row, "FILE_3D", "OBJECT", is_ifc_project, aprops.tab == "OBJECT")
@@ -430,7 +426,6 @@ class BIM_PT_tabs(Panel):
self.draw_tab_entry(row, "PACKAGE", "FM", True, aprops.tab == "FM")
self.draw_tab_entry(row, "COMMUNITY", "QUALITY", True, aprops.tab == "QUALITY")
row.operator("bim.switch_tab", text="", emboss=False, icon="UV_SYNC_SELECT")
theme.wcol_regular.text_sel = original_text_sel # Restore original tex_sel color
# Yes, that's right.
row = self.layout.row()
@@ -512,9 +507,9 @@ class BIM_PT_tabs(Panel):
op = row.operator("bim.open_uri", text="", icon="QUESTION")
op.uri = "https://docs.bonsaibim.org/guides/troubleshooting.html#incompatible-blender-features"
def draw_tab_entry(self, row, icon, tab_name, enabled=True, highlight=False):
def draw_tab_entry(self, row, icon, tab_name, enabled=True, highlight=True):
tab_entry = row.row(align=True)
tab_entry.operator("bim.set_tab", text="", emboss=highlight, icon=icon, depress=True).tab = tab_name
tab_entry.operator("bim.set_tab", text="", emboss=highlight, icon=icon).tab = tab_name
tab_entry.enabled = enabled
@@ -1113,6 +1108,10 @@ class BIM_PT_tab_operations(Panel):
pass
def refresh():
UIData.is_loaded = False
class UIData:
data = {}
is_loaded = False