The Birdfont Source Code


All Repositories / birdfont.git / commit – RSS feed

Show cursor in dialog

These changes was commited to the Birdfont repository Sun, 26 Apr 2015 22:33:41 +0000.

Contributing

Send patches or pull requests to johan.mattsson.m@gmail.com.
Clone this repository: git clone https://github.com/johanmattssonm/birdfont.git
author Johan Mattsson <johan.mattsson.m@gmail.com>
Sun, 26 Apr 2015 22:33:41 +0000 (00:33 +0200)
committer Johan Mattsson <johan.mattsson.m@gmail.com>
Sun, 26 Apr 2015 22:33:41 +0000 (00:33 +0200)
commit b6e97943d29c105ad2ebcd49da330f608202bcec
tree 226955c403351a2d9f414f134f602e31f9571978
parent 7db41696c6dd6b2e2cb16b2a51b705f3d594e117
Show cursor in dialog

libbirdfont/ForesightTool.vala
libbirdfont/MainWindow.vala
libbirdfont/PenTool.vala
libbirdfont/StrokeTool.vala
libbirdfont/TabBar.vala
libbirdfont/Toolbox.vala
--- a/libbirdfont/ForesightTool.vala +++ b/libbirdfont/ForesightTool.vala @@ -72,10 +72,11 @@ 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; @@ -194,9 +195,14 @@ 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;
--- a/libbirdfont/MainWindow.vala +++ b/libbirdfont/MainWindow.vala @@ -75,6 +75,16 @@ 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) {
--- a/libbirdfont/PenTool.vala +++ b/libbirdfont/PenTool.vala @@ -176,7 +176,7 @@ } } - 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 @@ } 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
--- a/libbirdfont/StrokeTool.vala +++ b/libbirdfont/StrokeTool.vala @@ -2068,11 +2068,13 @@ 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++) {
--- a/libbirdfont/TabBar.vala +++ b/libbirdfont/TabBar.vala @@ -83,7 +83,7 @@ } 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");
--- a/libbirdfont/Toolbox.vala +++ b/libbirdfont/Toolbox.vala @@ -258,7 +258,7 @@ 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) {