From 9f1779893dabee614f0917b752eead735a48a24f Mon Sep 17 00:00:00 2001 From: OverloadedOrama <35376950+OverloadedOrama@users.noreply.github.com> Date: Mon, 16 Dec 2019 16:00:02 +0200 Subject: [PATCH] Changed default cursor shape for the rulers, to indicate that they are interactive --- Main.tscn | 2 ++ Scripts/HorizontalRuler.gd | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/Main.tscn b/Main.tscn index 4fb6f75fc..1f3b7d8ef 100644 --- a/Main.tscn +++ b/Main.tscn @@ -806,6 +806,7 @@ margin_right = 704.0 margin_bottom = 16.0 rect_min_size = Vector2( 0, 16 ) focus_mode = 0 +mouse_default_cursor_shape = 15 custom_styles/hover = ExtResource( 12 ) custom_styles/pressed = ExtResource( 12 ) custom_styles/focus = ExtResource( 12 ) @@ -826,6 +827,7 @@ margin_right = 16.0 margin_bottom = 462.0 rect_min_size = Vector2( 16, 0 ) focus_mode = 0 +mouse_default_cursor_shape = 14 size_flags_horizontal = 0 size_flags_vertical = 3 custom_styles/hover = ExtResource( 12 ) diff --git a/Scripts/HorizontalRuler.gd b/Scripts/HorizontalRuler.gd index 7b5481b92..7136bf07a 100644 --- a/Scripts/HorizontalRuler.gd +++ b/Scripts/HorizontalRuler.gd @@ -12,6 +12,11 @@ var last : Vector2 # warning-ignore:unused_argument func _process(delta : float) -> void: update() + var mouse_pos := get_local_mouse_position() + if mouse_pos.x < RULER_WIDTH: #For double guides + mouse_default_cursor_shape = Control.CURSOR_BDIAGSIZE + else: + mouse_default_cursor_shape = Control.CURSOR_HSPLIT #Code taken and modified from Godot's source code func _draw() -> void: