Skip to content

Commit a89698e

Browse files
committed
update tooltip based on autoshrink state
1 parent d7af531 commit a89698e

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

material_maker/nodes/comment/comment.gd

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ var generator : MMGenComment:
3434
if mm_globals.get_config("auto_size_comment"):
3535
resize_to_selection()
3636
update_theme()
37+
update_autoshrink_button_tooltip()
3738

3839
var palette_colors := [
3940
Color("F8B8B3"),
@@ -90,7 +91,6 @@ func setup_titlebar_controls() -> void:
9091
autoshrink_button.size_flags_vertical = Control.SIZE_SHRINK_CENTER
9192
autoshrink_button.size_flags_horizontal = Control.SIZE_SHRINK_BEGIN
9293
autoshrink_button.gui_input.connect(_on_autoshrink_gui_input)
93-
autoshrink_button.tooltip_text = "LMB: Shrink to fit\nShift-LMB: Toggle Autoshrink"
9494

9595
var hbox_spacer := Control.new()
9696
hbox_spacer.custom_minimum_size.x = 0.5
@@ -238,6 +238,7 @@ func _on_autoshrink_gui_input(event : InputEvent) -> void:
238238
autoshrink_enabled = not autoshrink_enabled
239239
generator.autoshrink = autoshrink_enabled
240240
_on_theme_changed()
241+
update_autoshrink_button_tooltip()
241242
else:
242243
if autoshrink_enabled:
243244
return
@@ -286,3 +287,9 @@ func _on_resize_end(new_size : Vector2) -> void:
286287
redo_action = { type="resize_comment", node=generator.get_hier_name(), size=size }
287288
get_parent().undoredo.add("Resize comment", [undo_action], [redo_action], true)
288289
generator.size = new_size
290+
291+
func update_autoshrink_button_tooltip() -> void:
292+
if autoshrink_enabled:
293+
autoshrink_button.tooltip_text = "Shift-LMB: Toggle Autoshrink"
294+
else:
295+
autoshrink_button.tooltip_text = "LMB: Shrink to fit\nShift-LMB: Toggle Autoshrink"

0 commit comments

Comments
 (0)