Commit b6e9794
Show cursor in dialog
Changed files (6)
modifiedlibbirdfont/ForesightTool.valamodifiedlibbirdfont/MainWindow.valamodifiedlibbirdfont/PenTool.valamodifiedlibbirdfont/StrokeTool.valamodifiedlibbirdfont/TabBar.valamodifiedlibbirdfont/Toolbox.vala
Diff
@@ -72,10 +72,11 @@ public class ForesightTool : Tool { p.release_action (p, 2, x, y); current_path.hide_end_handle = true; state = NONE;- MainWindow.native_window.set_cursor (NativeWindow.VISIBLE);+ MainWindow.set_cursor (NativeWindow.VISIBLE); return; } + BirdFont.get_current_font ().touch (); MainWindow.get_current_glyph ().store_undo_state (); last_move_x = x;@@ -195,8 +196,13 @@ public class ForesightTool : Tool { last_move_x = x; last_move_y = y; + if (MainWindow.dialog.visible && state != NONE) {+ state = NONE;+ p.release_action (p, 1, last_move_x, last_move_y);+ }+ if (state == NONE) {- MainWindow.native_window.set_cursor (NativeWindow.VISIBLE);+ MainWindow.set_cursor (NativeWindow.VISIBLE); } PenTool.active_path = current_path;@@ -75,6 +75,16 @@ public class MainWindow : GLib.Object { dialog = d; dialog.visible = true; GlyphCanvas.redraw (); + + set_cursor (NativeWindow.VISIBLE); + } + + public static void set_cursor (int flags) { + if (dialog.visible) { + native_window.set_cursor (NativeWindow.VISIBLE); + } else { + native_window.set_cursor (flags); + } } public static void show_message (string text) { @@ -176,7 +176,7 @@ public class PenTool : Tool { } } - MainWindow.native_window.set_cursor (NativeWindow.VISIBLE);+ MainWindow.set_cursor (NativeWindow.VISIBLE); point_selection_image = false; BirdFont.get_current_font ().touch ();@@ -560,9 +560,9 @@ public class PenTool : Tool { } if (move_selected_handle || move_selected) {- MainWindow.native_window.set_cursor (NativeWindow.HIDDEN);+ MainWindow.set_cursor (NativeWindow.HIDDEN); } else {- MainWindow.native_window.set_cursor (NativeWindow.VISIBLE);+ MainWindow.set_cursor (NativeWindow.VISIBLE); } // move control point handles@@ -2068,11 +2068,13 @@ first.color = Color.pink (); int i; if (path.is_open ()) {+ /* get_segment (thickness, 0, 0.001, p2, p3, out start); add_corner (side1, previous, start, p2.copy (), thickness); get_segment (-thickness, 0, 0.001, p2, p3, out start); add_corner (side2, previous_inside, start, p2.copy (), thickness);+ */ } for (i = 0; i < size; i++) {@@ -83,7 +83,7 @@ public class TabBar : GLib.Object { } public void motion (double x, double y) {- MainWindow.native_window.set_cursor (NativeWindow.VISIBLE);+ MainWindow.set_cursor (NativeWindow.VISIBLE); if (MenuTab.suppress_event) { warn_if_test ("Event suppressed");@@ -258,7 +258,7 @@ public class Toolbox : GLib.Object { bool consumed = false; bool active; - MainWindow.native_window.set_cursor (NativeWindow.VISIBLE);+ MainWindow.set_cursor (NativeWindow.VISIBLE); foreach (Expander exp in current_set.get_expanders ()) { if (exp.visible) {