/[svn]/gigedit/trunk/src/gigedit/paramedit.cpp
ViewVC logotype

Diff of /gigedit/trunk/src/gigedit/paramedit.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 3408 by schoenebeck, Tue Nov 14 18:07:25 2017 UTC revision 3409 by schoenebeck, Tue Jan 23 16:30:56 2018 UTC
# Line 23  Line 23 
23  #include "compat.h"  #include "compat.h"
24  #include "Settings.h"  #include "Settings.h"
25    
26    #include <glibmm/glibmm.h>
27  #include <gtkmm/messagedialog.h>  #include <gtkmm/messagedialog.h>
28    
29  namespace {  namespace {
# Line 144  LabelWidget::LabelWidget(const char* lab Line 145  LabelWidget::LabelWidget(const char* lab
145  #else  #else
146      label.set_halign(Gtk::Align::START);      label.set_halign(Gtk::Align::START);
147  #endif  #endif
148        Settings::singleton()->showTooltips.get_proxy().signal_changed().connect(
149            sigc::mem_fun(this, &LabelWidget::on_show_tooltips_changed)
150        );
151    
152        // workaround for a crash with certain gtkmm versions: postpone calling
153        // on_show_tooltips_changed() because widget.gobj() might be uninitialized
154        // at this point yet
155        Glib::signal_idle().connect_once( // timeout starts given amount of ms after the main loop became idle again ...
156            sigc::mem_fun(*this, &LabelWidget::on_show_tooltips_changed),
157            300
158        );
159    }
160    
161    void LabelWidget::on_show_tooltips_changed() {
162        const bool b = Settings::singleton()->showTooltips;
163        label.set_has_tooltip(b);
164        widget.set_has_tooltip(b);
165  }  }
166    
167  void LabelWidget::set_sensitive(bool sensitive)  void LabelWidget::set_sensitive(bool sensitive)
# Line 195  NumEntry::NumEntry(const char* labelText Line 213  NumEntry::NumEntry(const char* labelText
213      box.add(scale);      box.add(scale);
214  }  }
215    
216    void NumEntry::on_show_tooltips_changed() {
217        LabelWidget::on_show_tooltips_changed();
218    
219        const bool b = Settings::singleton()->showTooltips;
220        spinbutton.set_has_tooltip(b);
221        scale.set_has_tooltip(b);
222    }
223    
224  NumEntryGain::NumEntryGain(const char* labelText,  NumEntryGain::NumEntryGain(const char* labelText,
225                             double lower, double upper,                             double lower, double upper,
226                             int decimals, double coeff) :                             int decimals, double coeff) :
# Line 245  BoolEntryPlus6::BoolEntryPlus6(const cha Line 271  BoolEntryPlus6::BoolEntryPlus6(const cha
271          sigc::mem_fun(*this, &BoolEntryPlus6::value_changed));          sigc::mem_fun(*this, &BoolEntryPlus6::value_changed));
272  }  }
273    
274    void BoolEntryPlus6::on_show_tooltips_changed() {
275        LabelWidget::on_show_tooltips_changed();
276    
277        eGain.on_show_tooltips_changed();
278    }
279    
280  void BoolEntryPlus6::value_changed()  void BoolEntryPlus6::value_changed()
281  {  {
282      if (checkbutton.get_active()) eGain.set_value(plus6value);      if (checkbutton.get_active()) eGain.set_value(plus6value);
# Line 376  void spin_button_show_notes(Gtk::SpinBut Line 408  void spin_button_show_notes(Gtk::SpinBut
408          sigc::bind(sigc::ptr_fun(&on_output), &spin_button));          sigc::bind(sigc::ptr_fun(&on_output), &spin_button));
409  }  }
410    
411    void ChoiceEntryBase::on_show_tooltips_changed() {
412        LabelWidget::on_show_tooltips_changed();
413    
414        const bool b = Settings::singleton()->showTooltips;
415        combobox.set_has_tooltip(b);
416    }
417    
418  ChoiceEntryLeverageCtrl::ChoiceEntryLeverageCtrl(const char* labelText) :  ChoiceEntryLeverageCtrl::ChoiceEntryLeverageCtrl(const char* labelText) :
419  #if HAS_GTKMM_ALIGNMENT  #if HAS_GTKMM_ALIGNMENT
420      LabelWidget(labelText, align),      LabelWidget(labelText, align),
# Line 409  ChoiceEntryLeverageCtrl::ChoiceEntryLeve Line 448  ChoiceEntryLeverageCtrl::ChoiceEntryLeve
448      value.controller_number = 0;      value.controller_number = 0;
449  }  }
450    
451    void ChoiceEntryLeverageCtrl::on_show_tooltips_changed() {
452        LabelWidget::on_show_tooltips_changed();
453    
454        const bool b = Settings::singleton()->showTooltips;
455        combobox.set_has_tooltip(b);
456    }
457    
458  void ChoiceEntryLeverageCtrl::value_changed()  void ChoiceEntryLeverageCtrl::value_changed()
459  {  {
460      int rowno = combobox.get_active_row_number();      int rowno = combobox.get_active_row_number();
# Line 487  void ChoiceEntryLeverageCtrl::set_value( Line 533  void ChoiceEntryLeverageCtrl::set_value(
533  }  }
534    
535    
536    BoolBox::BoolBox(const char* labelText) : Gtk::CheckButton(labelText) {
537        signal_toggled().connect(sig_changed.make_slot());
538        Settings::singleton()->showTooltips.get_proxy().signal_changed().connect(
539            sigc::mem_fun(this, &BoolBox::on_show_tooltips_changed)
540        );
541        on_show_tooltips_changed();
542    }
543    
544    void BoolBox::on_show_tooltips_changed() {
545        const bool b = Settings::singleton()->showTooltips;
546        set_has_tooltip(b);
547    }
548    
549    
550  BoolEntry::BoolEntry(const char* labelText) :  BoolEntry::BoolEntry(const char* labelText) :
551      LabelWidget(labelText, checkbutton),      LabelWidget(labelText, checkbutton),
552      checkbutton(labelText)      checkbutton(labelText)
# Line 536  void StringEntryMultiLine::set_value(con Line 596  void StringEntryMultiLine::set_value(con
596      text_buffer->set_text(text);      text_buffer->set_text(text);
597  }  }
598    
599    void StringEntryMultiLine::on_show_tooltips_changed() {
600        LabelWidget::on_show_tooltips_changed();
601    
602        const bool b = Settings::singleton()->showTooltips;
603        text_view.set_has_tooltip(b);
604    }
605    
606    
607  Table::Table(int x, int y) :  Table::Table(int x, int y) :
608  #if USE_GTKMM_GRID  #if USE_GTKMM_GRID

Legend:
Removed from v.3408  
changed lines
  Added in v.3409

  ViewVC Help
Powered by ViewVC