Browse Source

Added slight delay on mouse-pointer tooltips.

merge-requests/365/head
eidheim 10 years ago
parent
commit
8175836db1
  1. 23
      src/source.cc

23
src/source.cc

@ -818,16 +818,21 @@ void Source::ClangViewParse::update_types() {
bool Source::ClangViewParse::on_motion_notify_event(GdkEventMotion* event) {
if(on_motion_last_x!=event->x || on_motion_last_y!=event->y) {
delayed_tooltips_connection.disconnect();
if(clang_readable && event->state==0) {
Gdk::Rectangle rectangle(event->x, event->y, 1, 1);
Tooltips::init();
type_tooltips.show(rectangle);
diagnostic_tooltips.show(rectangle);
}
else {
type_tooltips.hide();
diagnostic_tooltips.hide();
if(event->state==0) {
gdouble x=event->x;
gdouble y=event->y;
delayed_tooltips_connection=Glib::signal_timeout().connect([this, x, y]() {
if(clang_readable) {
Gdk::Rectangle rectangle(x, y, 1, 1);
Tooltips::init();
type_tooltips.show(rectangle);
diagnostic_tooltips.show(rectangle);
}
return false;
}, 100);
}
type_tooltips.hide();
diagnostic_tooltips.hide();
}
on_motion_last_x=event->x;
on_motion_last_y=event->y;

Loading…
Cancel
Save