mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-10-01 20:49:44 +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(
|
def get_tab(
|
||||||
self: "Union[BIMAreaProperties, BIMTabProperties]", context: bpy.types.Context
|
self: "Union[BIMAreaProperties, BIMTabProperties]", context: bpy.types.Context
|
||||||
) -> list[tuple[str, str, str, str, int]]:
|
) -> 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"):
|
if not hasattr(get_tab, "enum_items"):
|
||||||
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),
|
("OBJECT", "Object Information", "", "FILE_3D", 1),
|
||||||
("GEOMETRY", "Geometry and Materials", "", "MATERIAL", 2),
|
("GEOMETRY", "Geometry and Materials", "", "MATERIAL", 2),
|
||||||
("DRAWINGS", "Drawings and Documents", "", "DOCUMENTS", 3),
|
("DRAWINGS", "Drawings and Documents", "", "DOCUMENTS", 3),
|
||||||
|
|||||||
@@ -408,7 +408,7 @@ class BIM_PT_tabs(Panel):
|
|||||||
UIData.load()
|
UIData.load()
|
||||||
is_ifc_project = bool(tool.Ifc.get())
|
is_ifc_project = bool(tool.Ifc.get())
|
||||||
aprops = tool.Blender.get_area_props(context)
|
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 = self.layout.row()
|
||||||
row.alignment = "CENTER"
|
row.alignment = "CENTER"
|
||||||
@@ -1119,7 +1119,11 @@ class UIData:
|
|||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def load(cls):
|
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
|
cls.is_loaded = True
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
@@ -1127,8 +1131,8 @@ class UIData:
|
|||||||
return tool.Blender.get_bonsai_version()
|
return tool.Blender.get_bonsai_version()
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def icon_color_mode(cls):
|
def icon_color_mode(cls, color_path):
|
||||||
return tool.Blender.detect_icon_color_mode()
|
return tool.Blender.detect_icon_color_mode(color_path)
|
||||||
|
|
||||||
|
|
||||||
def draw_statusbar(self, context):
|
def draw_statusbar(self, context):
|
||||||
|
|||||||
Reference in New Issue
Block a user