Browse Source

Move tooltips slightly to right if they reach top of screen

merge-requests/382/head
eidheim 8 years ago
parent
commit
1e414b9fab
  1. 2
      src/tooltips.cc

2
src/tooltips.cc

@ -93,7 +93,7 @@ void Tooltip::show(bool disregard_drawn) {
text_view->get_window(Gtk::TextWindowType::TEXT_WINDOW_TEXT)->get_root_coords(activation_rectangle_x, activation_rectangle.get_y(), root_x, root_y); text_view->get_window(Gtk::TextWindowType::TEXT_WINDOW_TEXT)->get_root_coords(activation_rectangle_x, activation_rectangle.get_y(), root_x, root_y);
} }
Gdk::Rectangle rectangle; Gdk::Rectangle rectangle;
rectangle.set_x(root_x); rectangle.set_x(root_y<size.second ? root_x+size.first*0.2 : root_x);
rectangle.set_y(std::max(0, root_y-size.second)); rectangle.set_y(std::max(0, root_y-size.second));
rectangle.set_width(size.first); rectangle.set_width(size.first);
rectangle.set_height(size.second); rectangle.set_height(size.second);

Loading…
Cancel
Save