Fix #3480 : Scene tabs now show their individual description on hover

Also correct minor typo
This commit is contained in:
Gorgious56
2023-07-20 10:42:11 +02:00
parent f6307520e9
commit ac28bbdee1
2 changed files with 7 additions and 4 deletions
+5 -2
View File
@@ -42,11 +42,14 @@ from math import radians
class SetTab(bpy.types.Operator): class SetTab(bpy.types.Operator):
bl_idname = "bim.set_tab" bl_idname = "bim.set_tab"
bl_label = "Set Tab" bl_label = "Set Current Tab"
bl_options = {"REGISTER", "UNDO"} bl_options = {"REGISTER", "UNDO"}
bl_description = "Sets the current property tab"
tab: bpy.props.StringProperty() tab: bpy.props.StringProperty()
@classmethod
def description(cls, context, properties):
return next((t[1] for t in blenderbim.bim.prop.get_tab(None, context) if t[0] == properties.tab), "")
def execute(self, context): def execute(self, context):
if context.area.spaces.active.search_filter: if context.area.spaces.active.search_filter:
return {"FINISHED"} return {"FINISHED"}
+2 -2
View File
@@ -234,7 +234,7 @@ def get_length_value(self):
return self.float_value * si_conversion return self.float_value * si_conversion
def set_lenght_value(self, value): def set_length_value(self, value):
si_conversion = ifcopenshell.util.unit.calculate_unit_scale(tool.Ifc.get()) si_conversion = ifcopenshell.util.unit.calculate_unit_scale(tool.Ifc.get())
self.float_value = value / si_conversion self.float_value = value / si_conversion
@@ -274,7 +274,7 @@ class Attribute(PropertyGroup):
set=set_float_value, set=set_float_value,
) )
length_value: FloatProperty( length_value: FloatProperty(
name="Value", description=tooltip, get=get_length_value, set=set_lenght_value, unit="LENGTH" name="Value", description=tooltip, get=get_length_value, set=set_length_value, unit="LENGTH"
) )
enum_items: StringProperty(name="Value") enum_items: StringProperty(name="Value")
enum_descriptions: CollectionProperty(type=StrProperty) enum_descriptions: CollectionProperty(type=StrProperty)