added highlight color to the input panel

This commit is contained in:
Bruno Perdigão
2024-08-03 10:34:40 -03:00
committed by Bruno Perdigão
parent f8f22257b4
commit a3b2860789
2 changed files with 11 additions and 2 deletions
@@ -405,11 +405,15 @@ class WallPolylineDecorator:
self.font_id = 0
blf.size(self.font_id, 12)
color = self.addon_prefs.decorations_colour
blf.color(self.font_id, *color)
color_highlight = self.addon_prefs.decorator_color_special
offset = 20
new_line = 20
keys = list(self.input_panel.keys())
for i, text in enumerate(texts):
if keys[i] == self.input_type:
blf.color(self.font_id, *color_highlight)
else:
blf.color(self.font_id, *color)
blf.position(self.font_id, self.mouse_pos[0] + offset, self.mouse_pos[1] + offset - (new_line * i), 0)
blf.draw(self.font_id, text + self.input_panel[keys[i]])
@@ -564,6 +564,9 @@ class DrawPolylineWall(bpy.types.Operator):
self.input_type = event.type
self.number_input = []
self.number_output = ''
WallPolylineDecorator.set_input_panel(self.input_panel, self.input_type)
tool.Blender.update_viewport()
if event.value == 'PRESS' and event.type in {'RIGHTMOUSE', 'ESC'}:
self.is_input_on = False
@@ -604,8 +607,10 @@ class DrawPolylineWall(bpy.types.Operator):
if event.value == 'PRESS' and event.type in {'RET', 'NUMPAD_ENTER'}:
tool.Snaping.insert_polyline_point(float(self.input_panel['X']), float(self.input_panel['Y']))
tool.Blender.update_viewport()
self.is_input_on = False
self.input_type = None
WallPolylineDecorator.set_input_panel(self.input_panel, self.input_type)
tool.Blender.update_viewport()
if event.type in {'MIDDLEMOUSE', 'WHEELUPMOUSE', 'WHEELDOWNMOUSE'}:
return {'PASS_THROUGH'}