The Birdfont Source Code


All Repositories / birdfont.git / commit – RSS feed

Hide tooltip when the pointer leaves the button

These changes was commited to the Birdfont repository Fri, 26 Sep 2014 19:02:56 +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>
Fri, 26 Sep 2014 19:02:56 +0000 (21:02 +0200)
committer Johan Mattsson <johan.mattsson.m@gmail.com>
Fri, 26 Sep 2014 19:02:56 +0000 (21:02 +0200)
commit f68e788bf714fcd994eacbd942f72fbc8ff2c67b
tree a1a4795858ff5def31d7838cea4bc8894199cfb7
parent 520d41083e479e35cbe906e5287ba60c59a9706b
Hide tooltip when the pointer leaves the button

libbirdfont/Tool.vala
libbirdfont/Toolbox.vala
--- a/libbirdfont/Tool.vala +++ b/libbirdfont/Tool.vala @@ -34,6 +34,7 @@ public signal void press_action (Tool selected, int button, int x, int y); public signal void double_click_action (Tool selected, int button, int x, int y); public signal void move_action (Tool selected, int x, int y); + public signal void move_out_action (Tool selected); public signal void release_action (Tool selected, int button, int x, int y); /** Returns true if tool is listening for scroll wheel actions. */ @@ -105,6 +106,11 @@ panel_press_action.connect ((self, button, x, y) => { MainWindow.get_tooltip ().set_text_from_tool (); + }); + + move_out_action.connect ((self) => { + MainWindow.native_window.hide_tooltip (); + active_tooltip.showing_this_tooltip = false; }); panel_move_action.connect ((self, x, y) => {
--- a/libbirdfont/Toolbox.vala +++ b/libbirdfont/Toolbox.vala @@ -248,6 +248,10 @@ if (t.tool_is_visible ()) { active = t.is_over (x, y); tpa = null; + + if (!active && t.is_active ()) { + t.move_out_action (t); + } update = t.set_active (active); tpa = MainWindow.get_tooltip ();