mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-12 02:23:34 +00:00
IFC icon in Scene dropdown
custom white mode support for IFC icon in scene drop down menu
This commit is contained in:
@@ -406,11 +406,16 @@ class Attribute(PropertyGroup):
|
||||
def get_tab(
|
||||
self: "Union[BIMAreaProperties, BIMTabProperties]", context: bpy.types.Context
|
||||
) -> list[tuple[str, str, str, str, int]]:
|
||||
# Items are not very dynamic, but can't make them completely static
|
||||
# because icons are not yet available during prop registration.
|
||||
|
||||
UIData = bonsai.bim.ui.UIData
|
||||
if not UIData.is_loaded:
|
||||
UIData.load()
|
||||
|
||||
icon_key = f"{UIData.data['menu_icon_color_mode']}_ifc"
|
||||
|
||||
if not hasattr(get_tab, "enum_items"):
|
||||
get_tab.enum_items = [
|
||||
("PROJECT", "Project Overview", "", bonsai.bim.icons["IFC"].icon_id, 0),
|
||||
("PROJECT", "Project Overview", "", bonsai.bim.icons[icon_key].icon_id, 0),
|
||||
("OBJECT", "Object Information", "", "FILE_3D", 1),
|
||||
("GEOMETRY", "Geometry and Materials", "", "MATERIAL", 2),
|
||||
("DRAWINGS", "Drawings and Documents", "", "DOCUMENTS", 3),
|
||||
|
||||
@@ -408,7 +408,7 @@ class BIM_PT_tabs(Panel):
|
||||
UIData.load()
|
||||
is_ifc_project = bool(tool.Ifc.get())
|
||||
aprops = tool.Blender.get_area_props(context)
|
||||
ifc_icon = f"{UIData.data['icon_color_mode']}_ifc"
|
||||
ifc_icon = f"{UIData.data['tabs_icon_color_mode']}_ifc"
|
||||
|
||||
row = self.layout.row()
|
||||
row.alignment = "CENTER"
|
||||
@@ -1119,7 +1119,11 @@ class UIData:
|
||||
|
||||
@classmethod
|
||||
def load(cls):
|
||||
cls.data = {"version": cls.version(), "icon_color_mode": cls.icon_color_mode()}
|
||||
cls.data = {
|
||||
"version": cls.version(),
|
||||
"tabs_icon_color_mode": cls.icon_color_mode("user_interface.wcol_regular.text"),
|
||||
"menu_icon_color_mode": cls.icon_color_mode("user_interface.wcol_menu.text"),
|
||||
}
|
||||
cls.is_loaded = True
|
||||
|
||||
@classmethod
|
||||
@@ -1127,8 +1131,8 @@ class UIData:
|
||||
return tool.Blender.get_bonsai_version()
|
||||
|
||||
@classmethod
|
||||
def icon_color_mode(cls):
|
||||
return tool.Blender.detect_icon_color_mode()
|
||||
def icon_color_mode(cls, color_path):
|
||||
return tool.Blender.detect_icon_color_mode(color_path)
|
||||
|
||||
|
||||
def draw_statusbar(self, context):
|
||||
|
||||
Reference in New Issue
Block a user