Browse Source

Added convenient Tooltips::show() and Tooltips::hide().

merge-requests/365/head
eidheim 11 years ago
parent
commit
4a5eba77b8
  1. 18
      juci/tooltips.cc
  2. 4
      juci/tooltips.h

18
juci/tooltips.cc

@ -68,4 +68,20 @@ void Tooltips::show(const Gdk::Rectangle& rectangle) {
else else
tooltip->hide(); tooltip->hide();
} }
} }
void Tooltips::show() {
init_adjustments();
for(auto& tooltip: tooltips) {
tooltip->update();
tooltip->show_all();
tooltip->adjust();
}
}
void Tooltips::hide() {
init_adjustments();
for(auto& tooltip: tooltips) {
tooltip->hide();
}
}

4
juci/tooltips.h

@ -32,6 +32,8 @@ public:
void add(const std::string& text, Glib::RefPtr<Gtk::TextBuffer::Mark> start_mark, Glib::RefPtr<Gtk::TextBuffer::Mark> end_mark); void add(const std::string& text, Glib::RefPtr<Gtk::TextBuffer::Mark> start_mark, Glib::RefPtr<Gtk::TextBuffer::Mark> end_mark);
void show(const Gdk::Rectangle& rectangle); void show(const Gdk::Rectangle& rectangle);
void show();
void hide();
Gdk::Rectangle tooltips_rectangle; Gdk::Rectangle tooltips_rectangle;
private: private:
@ -39,4 +41,4 @@ private:
std::vector<std::unique_ptr<Tooltip> > tooltips; std::vector<std::unique_ptr<Tooltip> > tooltips;
}; };
#endif // JUCI_TOOLTIPS_H_ #endif // JUCI_TOOLTIPS_H_

Loading…
Cancel
Save