Browse Source

Merge branch 'VadimGit-little_fixes'

merge-requests/365/head
eidheim 10 years ago
parent
commit
277c4b5665
  1. 4
      src/selectiondialog.cc
  2. 6
      src/tooltips.cc
  3. 12
      src/tooltips.h

4
src/selectiondialog.cc

@ -33,12 +33,12 @@ ListViewText::ListViewText(bool use_markup) : Gtk::TreeView(), use_markup(use_ma
set_rules_hint(true); set_rules_hint(true);
} }
void ListViewText::ListViewText::append(const std::string& value) { void ListViewText::append(const std::string& value) {
auto new_row=list_store->append(); auto new_row=list_store->append();
new_row->set_value(column_record.text, value); new_row->set_value(column_record.text, value);
} }
void ListViewText::ListViewText::hide() { void ListViewText::hide() {
Gtk::TreeView::hide(); Gtk::TreeView::hide();
list_store->clear(); list_store->clear();
} }

6
src/tooltips.cc

@ -138,7 +138,7 @@ void Tooltip::wrap_lines(Glib::RefPtr<Gtk::TextBuffer> text_buffer) {
} }
void Tooltips::show(const Gdk::Rectangle& rectangle, bool disregard_drawn) { void Tooltips::show(const Gdk::Rectangle& rectangle, bool disregard_drawn) {
for(auto& tooltip: *this) { for(auto &tooltip : tooltip_list) {
tooltip.update(); tooltip.update();
if(rectangle.intersects(tooltip.activation_rectangle)) { if(rectangle.intersects(tooltip.activation_rectangle)) {
tooltip.adjust(disregard_drawn); tooltip.adjust(disregard_drawn);
@ -150,7 +150,7 @@ void Tooltips::show(const Gdk::Rectangle& rectangle, bool disregard_drawn) {
} }
void Tooltips::show(bool disregard_drawn) { void Tooltips::show(bool disregard_drawn) {
for(auto& tooltip: *this) { for(auto &tooltip : tooltip_list) {
tooltip.update(); tooltip.update();
tooltip.adjust(disregard_drawn); tooltip.adjust(disregard_drawn);
tooltip.window->show_all(); tooltip.window->show_all();
@ -158,7 +158,7 @@ void Tooltips::show(bool disregard_drawn) {
} }
void Tooltips::hide() { void Tooltips::hide() {
for(auto& tooltip: *this) { for(auto &tooltip : tooltip_list) {
if(tooltip.window) if(tooltip.window)
tooltip.window->hide(); tooltip.window->hide();
} }

12
src/tooltips.h

@ -25,14 +25,24 @@ private:
int tooltip_width, tooltip_height; int tooltip_width, tooltip_height;
}; };
class Tooltips : public std::list<Tooltip> { class Tooltips {
public: public:
static void init() {drawn_tooltips_rectangle=Gdk::Rectangle();} static void init() {drawn_tooltips_rectangle=Gdk::Rectangle();}
void show(const Gdk::Rectangle& rectangle, bool disregard_drawn=false); void show(const Gdk::Rectangle& rectangle, bool disregard_drawn=false);
void show(bool disregard_drawn=false); void show(bool disregard_drawn=false);
void hide(); void hide();
void clear() {tooltip_list.clear();};
template<typename... Ts>
void emplace_back(Ts&&... params)
{
tooltip_list.emplace_back(std::forward<Ts>(params)...);
}
static Gdk::Rectangle drawn_tooltips_rectangle; static Gdk::Rectangle drawn_tooltips_rectangle;
private:
std::list<Tooltip> tooltip_list;
}; };
#endif // JUCI_TOOLTIPS_H_ #endif // JUCI_TOOLTIPS_H_

Loading…
Cancel
Save