More UI hints and cursor changes

UI hint for the layer visibility buttons and the cursor shape changes depending on where the user is hovering.
This commit is contained in:
OverloadedOrama 2019-09-04 20:50:05 +03:00
parent 21397fefb2
commit 1f80291a4b
4 changed files with 31 additions and 1 deletions

View file

@ -139,8 +139,10 @@ func generate_layer_panels() -> void:
current_layer_index = layers.size() - 1
if layers.size() == 1:
Global.remove_layer_button.disabled = true
Global.remove_layer_button.mouse_default_cursor_shape = Control.CURSOR_FORBIDDEN
else:
Global.remove_layer_button.disabled = false
Global.remove_layer_button.mouse_default_cursor_shape = Control.CURSOR_POINTING_HAND
for i in range(layers.size() -1, -1, -1):
var layer_container = load("res://LayerContainer.tscn").instance()

View file

@ -29,15 +29,21 @@ func changed_selection() -> void:
if Global.canvas.current_layer_index < Global.canvas.layers.size() - 1:
Global.move_up_layer_button.disabled = false
Global.move_up_layer_button.mouse_default_cursor_shape = Control.CURSOR_POINTING_HAND
else:
Global.move_up_layer_button.disabled = true
Global.move_up_layer_button.mouse_default_cursor_shape = Control.CURSOR_FORBIDDEN
if Global.canvas.current_layer_index > 0:
Global.move_down_layer_button.disabled = false
Global.move_down_layer_button.mouse_default_cursor_shape = Control.CURSOR_POINTING_HAND
Global.merge_down_layer_button.disabled = false
Global.merge_down_layer_button.mouse_default_cursor_shape = Control.CURSOR_POINTING_HAND
else:
Global.move_down_layer_button.disabled = true
Global.move_down_layer_button.mouse_default_cursor_shape = Control.CURSOR_FORBIDDEN
Global.merge_down_layer_button.disabled = true
Global.merge_down_layer_button.mouse_default_cursor_shape = Control.CURSOR_FORBIDDEN
else:
child.currently_selected = false
child.get_stylebox("panel").bg_color = Color("3d3b45")