diff options
| author | Alex Valavanis <valavanisalex@gmail.com> | 2012-02-11 13:19:28 +0000 |
|---|---|---|
| committer | Alex Valavanis <valavanisalex@gmail.com> | 2012-02-11 13:19:28 +0000 |
| commit | d78865613d0001b7323a9cfbecb75e356e022275 (patch) | |
| tree | 80b63042238d1a198c0412d822b97d3e853d63f6 /src/ui/widget | |
| parent | Backward compat fix for Gtkmm 2.20 (diff) | |
| download | inkscape-d78865613d0001b7323a9cfbecb75e356e022275.tar.gz inkscape-d78865613d0001b7323a9cfbecb75e356e022275.zip | |
Lots of gtkmm deprecation fixes
(bzr r10957)
Diffstat (limited to 'src/ui/widget')
| -rw-r--r-- | src/ui/widget/color-preview.cpp | 8 | ||||
| -rw-r--r-- | src/ui/widget/dock-item.cpp | 4 | ||||
| -rw-r--r-- | src/ui/widget/filter-effect-chooser.cpp | 5 | ||||
| -rw-r--r-- | src/ui/widget/icon-widget.cpp | 4 | ||||
| -rw-r--r-- | src/ui/widget/object-composite-settings.cpp | 1 | ||||
| -rw-r--r-- | src/ui/widget/preferences-widget.cpp | 55 | ||||
| -rw-r--r-- | src/ui/widget/spin-slider.cpp | 11 | ||||
| -rw-r--r-- | src/ui/widget/spin-slider.h | 4 | ||||
| -rw-r--r-- | src/ui/widget/svg-canvas.cpp | 2 |
9 files changed, 51 insertions, 43 deletions
diff --git a/src/ui/widget/color-preview.cpp b/src/ui/widget/color-preview.cpp index 22ca1ebe0..8bb523831 100644 --- a/src/ui/widget/color-preview.cpp +++ b/src/ui/widget/color-preview.cpp @@ -22,7 +22,7 @@ namespace Inkscape { ColorPreview::ColorPreview (guint32 rgba) { _rgba = rgba; - set_flags (Gtk::NO_WINDOW); + set_has_window(false); } void @@ -36,14 +36,14 @@ void ColorPreview::on_size_allocate (Gtk::Allocation &all) { set_allocation (all); - if (is_drawable()) + if (get_is_drawable()) queue_draw(); } bool ColorPreview::on_expose_event (GdkEventExpose *event) { - if (is_drawable()) + if (get_is_drawable()) paint (&event->area); return true; @@ -54,7 +54,7 @@ ColorPreview::setRgba32 (guint32 rgba) { _rgba = rgba; - if (is_drawable()) + if (get_is_drawable()) queue_draw(); } diff --git a/src/ui/widget/dock-item.cpp b/src/ui/widget/dock-item.cpp index b9467475a..34c68284e 100644 --- a/src/ui/widget/dock-item.cpp +++ b/src/ui/widget/dock-item.cpp @@ -161,7 +161,7 @@ DockItem::set_size_request(int width, int height) void DockItem::size_request(Gtk::Requisition& requisition) { - getWidget().size_request(requisition); + requisition = getWidget().size_request(); } void @@ -254,7 +254,7 @@ DockItem::present() // always grab focus, even if we're already present grab_focus(); - if (!isFloating() && getWidget().is_realized()) + if (!isFloating() && getWidget().get_realized()) _dock.scrollToItem(*this); } diff --git a/src/ui/widget/filter-effect-chooser.cpp b/src/ui/widget/filter-effect-chooser.cpp index 52ce0b5bc..cdafa529c 100644 --- a/src/ui/widget/filter-effect-chooser.cpp +++ b/src/ui/widget/filter-effect-chooser.cpp @@ -23,7 +23,11 @@ namespace Widget { SimpleFilterModifier::SimpleFilterModifier(int flags) : _lb_blend(_("Blend mode:")), +#if WITH_GTKMM_2_22 + _lb_blur(_("_Blur:"), Gtk::ALIGN_START, Gtk::ALIGN_CENTER, true), +#else _lb_blur(_("_Blur:"), Gtk::ALIGN_LEFT, Gtk::ALIGN_CENTER, true), +#endif _blend(BlendModeConverter, SP_ATTR_INVALID, false), _blur(0, 0, 100, 1, 0.01, 2) { @@ -48,7 +52,6 @@ SimpleFilterModifier::SimpleFilterModifier(int flags) _lb_blur.set_use_underline(); _lb_blur.set_mnemonic_widget(_blur.get_scale()); _blend.signal_changed().connect(signal_blend_blur_changed()); - _blur.set_update_policy(Gtk::UPDATE_DELAYED); _blur.signal_value_changed().connect(signal_blend_blur_changed()); } diff --git a/src/ui/widget/icon-widget.cpp b/src/ui/widget/icon-widget.cpp index de4548f11..0e0736371 100644 --- a/src/ui/widget/icon-widget.cpp +++ b/src/ui/widget/icon-widget.cpp @@ -73,14 +73,14 @@ void IconWidget::size_allocate(Gtk::Allocation const &allocation) { Gtk::Widget::size_allocate(allocation); - if (this->is_drawable()) { + if (this->get_is_drawable()) { this->queue_draw(); } } int IconWidget::expose(GdkEventExpose *event) { - if (this->is_drawable()) { + if (this->get_is_drawable()) { paint(&(event->area)); } return true; diff --git a/src/ui/widget/object-composite-settings.cpp b/src/ui/widget/object-composite-settings.cpp index 06d57c4ac..75170971e 100644 --- a/src/ui/widget/object-composite-settings.cpp +++ b/src/ui/widget/object-composite-settings.cpp @@ -84,7 +84,6 @@ ObjectCompositeSettings::ObjectCompositeSettings(unsigned int verb_code, char co _opacity_hbox.pack_start(_opacity_hscale, true, true, 4); _opacity_hbox.pack_start(_opacity_spin_button, false, false, 0); _opacity_hscale.set_draw_value(false); - _opacity_hscale.set_update_policy(Gtk::UPDATE_DELAYED); _opacity_adjustment.signal_value_changed().connect(sigc::mem_fun(*this, &ObjectCompositeSettings::_opacityValueChanged)); _opacity_label.set_mnemonic_widget(_opacity_hscale); diff --git a/src/ui/widget/preferences-widget.cpp b/src/ui/widget/preferences-widget.cpp index f5c7c8c56..df5bc0e16 100644 --- a/src/ui/widget/preferences-widget.cpp +++ b/src/ui/widget/preferences-widget.cpp @@ -72,7 +72,11 @@ void DialogPage::add_line(bool indent, Glib::ustring const &label, Gtk::Widget & if (label != "") { Gtk::Label* label_widget; +#if WITH_GTKMM_2_22 + label_widget = Gtk::manage(new Gtk::Label(label , Gtk::ALIGN_START , Gtk::ALIGN_CENTER, true)); +#else label_widget = Gtk::manage(new Gtk::Label(label , Gtk::ALIGN_LEFT , Gtk::ALIGN_CENTER, true)); +#endif label_widget->set_mnemonic_widget(widget); if (indent) { @@ -102,7 +106,11 @@ void DialogPage::add_line(bool indent, Glib::ustring const &label, Gtk::Widget & if (suffix != "") { +#if WITH_GTKMM_2_22 + Gtk::Label* suffix_widget = Gtk::manage(new Gtk::Label(suffix , Gtk::ALIGN_START , Gtk::ALIGN_CENTER, true)); +#else Gtk::Label* suffix_widget = Gtk::manage(new Gtk::Label(suffix , Gtk::ALIGN_LEFT , Gtk::ALIGN_CENTER, true)); +#endif if (expand_widget) this->attach(*suffix_widget, 2, 3, row, row + 1, Gtk::FILL, Gtk::AttachOptions(), 0, 0); else @@ -121,8 +129,13 @@ void DialogPage::add_group_header(Glib::ustring name) int row = this->property_n_rows(); if (name != "") { +#if WITH_GTKMM_2_22 + Gtk::Label* label_widget = Gtk::manage(new Gtk::Label(Glib::ustring(/*"<span size='large'>*/"<b>") + name + + Glib::ustring("</b>"/*</span>"*/) , Gtk::ALIGN_START , Gtk::ALIGN_CENTER, true)); +#else Gtk::Label* label_widget = Gtk::manage(new Gtk::Label(Glib::ustring(/*"<span size='large'>*/"<b>") + name + Glib::ustring("</b>"/*</span>"*/) , Gtk::ALIGN_LEFT , Gtk::ALIGN_CENTER, true)); +#endif label_widget->set_use_markup(true); this->attach(*label_widget , 0, 4, row, row + 1, Gtk::FILL, Gtk::AttachOptions(), 0, 0); if (row != 1) @@ -146,7 +159,7 @@ void PrefCheckButton::init(Glib::ustring const &label, Glib::ustring const &pref void PrefCheckButton::on_toggled() { - if (this->is_visible()) //only take action if the user toggled it + if (this->get_visible()) //only take action if the user toggled it { Inkscape::Preferences *prefs = Inkscape::Preferences::get(); prefs->setBool(_prefs_path, this->get_active()); @@ -198,7 +211,7 @@ void PrefRadioButton::on_toggled() this->changed_signal.emit(this->get_active()); Inkscape::Preferences *prefs = Inkscape::Preferences::get(); - if (this->is_visible() && this->get_active() ) //only take action if toggled by user (to active) + if (this->get_visible() && this->get_active() ) //only take action if toggled by user (to active) { if ( _value_type == VAL_STRING ) prefs->setString(_prefs_path, _string_value); @@ -242,7 +255,7 @@ void PrefSpinButton::init(Glib::ustring const &prefs_path, void PrefSpinButton::on_value_changed() { Inkscape::Preferences *prefs = Inkscape::Preferences::get(); - if (this->is_visible()) //only take action if user changed value + if (this->get_visible()) //only take action if user changed value { if (_is_int) { if (_is_percent) { @@ -289,7 +302,7 @@ void PrefSpinUnit::init(Glib::ustring const &prefs_path, void PrefSpinUnit::on_my_value_changed() { Inkscape::Preferences *prefs = Inkscape::Preferences::get(); - if (getWidget()->is_visible()) //only take action if user changed value + if (getWidget()->get_visible()) //only take action if user changed value { prefs->setDoubleUnit(_prefs_path, getValue(getUnit().abbr), getUnit().abbr); } @@ -421,7 +434,7 @@ ZoomCorrRuler::on_expose_event(GdkEventExpose */*event*/) { void ZoomCorrRulerSlider::on_slider_value_changed() { - if (this->is_visible() || freeze) //only take action if user changed value + if (this->get_visible() || freeze) //only take action if user changed value { freeze = true; Inkscape::Preferences *prefs = Inkscape::Preferences::get(); @@ -435,7 +448,7 @@ ZoomCorrRulerSlider::on_slider_value_changed() void ZoomCorrRulerSlider::on_spinbutton_value_changed() { - if (this->is_visible() || freeze) //only take action if user changed value + if (this->get_visible() || freeze) //only take action if user changed value { freeze = true; Inkscape::Preferences *prefs = Inkscape::Preferences::get(); @@ -457,7 +470,7 @@ ZoomCorrRulerSlider::on_unit_changed() { prefs->setString("/options/zoomcorrection/unit", _unit.getUnitAbbr()); double conv = _unit.getConversion(_unit.getUnitAbbr(), "px"); _ruler.set_unit_conversion(conv); - if (_ruler.is_visible()) { + if (_ruler.get_visible()) { _ruler.redraw(); } } @@ -510,7 +523,7 @@ ZoomCorrRulerSlider::init(int ruler_width, int ruler_height, double lower, doubl void PrefSlider::on_slider_value_changed() { - if (this->is_visible() || freeze) //only take action if user changed value + if (this->get_visible() || freeze) //only take action if user changed value { freeze = true; Inkscape::Preferences *prefs = Inkscape::Preferences::get(); @@ -523,7 +536,7 @@ PrefSlider::on_slider_value_changed() void PrefSlider::on_spinbutton_value_changed() { - if (this->is_visible() || freeze) //only take action if user changed value + if (this->get_visible() || freeze) //only take action if user changed value { freeze = true; Inkscape::Preferences *prefs = Inkscape::Preferences::get(); @@ -576,7 +589,11 @@ void PrefCombo::init(Glib::ustring const &prefs_path, for (int i = 0 ; i < num_items; ++i) { +#if WITH_GTKMM_2_24 + this->append(labels[i]); +#else this->append_text(labels[i]); +#endif _values.push_back(values[i]); if (value == values[i]) row = i; @@ -598,7 +615,11 @@ void PrefCombo::init(Glib::ustring const &prefs_path, for (int i = 0 ; i < num_items; ++i) { +#if WITH_GTKMM_2_24 + this->append(labels[i]); +#else this->append_text(labels[i]); +#endif _ustr_values.push_back(values[i]); if (value == values[i]) row = i; @@ -608,7 +629,7 @@ void PrefCombo::init(Glib::ustring const &prefs_path, void PrefCombo::on_changed() { - if (this->is_visible()) //only take action if user changed value + if (this->get_visible()) //only take action if user changed value { Inkscape::Preferences *prefs = Inkscape::Preferences::get(); if(_values.size() > 0) @@ -643,7 +664,7 @@ void PrefEntryButtonHBox::init(Glib::ustring const &prefs_path, void PrefEntryButtonHBox::onRelatedEntryChangedCallback() { - if (this->is_visible()) //only take action if user changed value + if (this->get_visible()) //only take action if user changed value { Inkscape::Preferences *prefs = Inkscape::Preferences::get(); prefs->setString(_prefs_path, relatedEntry->get_text()); @@ -652,7 +673,7 @@ void PrefEntryButtonHBox::onRelatedEntryChangedCallback() void PrefEntryButtonHBox::onRelatedButtonClickedCallback() { - if (this->is_visible()) //only take action if user changed value + if (this->get_visible()) //only take action if user changed value { Inkscape::Preferences *prefs = Inkscape::Preferences::get(); prefs->setString(_prefs_path, _default_string); @@ -692,7 +713,7 @@ void PrefEntryFileButtonHBox::init(Glib::ustring const &prefs_path, void PrefEntryFileButtonHBox::onRelatedEntryChangedCallback() { - if (this->is_visible()) //only take action if user changed value + if (this->get_visible()) //only take action if user changed value { Inkscape::Preferences *prefs = Inkscape::Preferences::get(); prefs->setString(_prefs_path, relatedEntry->get_text()); @@ -703,7 +724,7 @@ static Inkscape::UI::Dialog::FileOpenDialog * selectPrefsFileInstance = NULL; void PrefEntryFileButtonHBox::onRelatedButtonClickedCallback() { - if (this->is_visible()) //only take action if user changed value + if (this->get_visible()) //only take action if user changed value { //# Get the current directory for finding files static Glib::ustring open_path; @@ -818,7 +839,7 @@ void PrefEntry::init(Glib::ustring const &prefs_path, bool visibility) void PrefEntry::on_changed() { - if (this->is_visible()) //only take action if user changed value + if (this->get_visible()) //only take action if user changed value { Inkscape::Preferences *prefs = Inkscape::Preferences::get(); prefs->setString(_prefs_path, this->get_text()); @@ -836,7 +857,7 @@ void PrefColorPicker::init(Glib::ustring const &label, Glib::ustring const &pref void PrefColorPicker::on_changed (guint32 rgba) { - if (this->is_visible()) //only take action if the user toggled it + if (this->get_visible()) //only take action if the user toggled it { Inkscape::Preferences *prefs = Inkscape::Preferences::get(); prefs->setInt(_prefs_path, (int) rgba); @@ -853,7 +874,7 @@ void PrefUnit::init(Glib::ustring const &prefs_path) void PrefUnit::on_changed() { - if (this->is_visible()) //only take action if user changed value + if (this->get_visible()) //only take action if user changed value { Inkscape::Preferences *prefs = Inkscape::Preferences::get(); prefs->setString(_prefs_path, getUnitAbbr()); diff --git a/src/ui/widget/spin-slider.cpp b/src/ui/widget/spin-slider.cpp index 9490ac8d9..688739db3 100644 --- a/src/ui/widget/spin-slider.cpp +++ b/src/ui/widget/spin-slider.cpp @@ -97,11 +97,6 @@ Inkscape::UI::Widget::SpinButton& SpinSlider::get_spin_button() return _spin; } -void SpinSlider::set_update_policy(const Gtk::UpdateType u) -{ - _scale.set_update_policy(u); -} - void SpinSlider::remove_scale() { remove(_scale); @@ -189,12 +184,6 @@ SpinSlider& DualSpinSlider::get_spinslider2() return _s2; } -void DualSpinSlider::set_update_policy(const Gtk::UpdateType u) -{ - _s1.set_update_policy(u); - _s2.set_update_policy(u); -} - void DualSpinSlider::remove_scale() { _s1.remove_scale(); diff --git a/src/ui/widget/spin-slider.h b/src/ui/widget/spin-slider.h index d2f41603a..c21b819ca 100644 --- a/src/ui/widget/spin-slider.h +++ b/src/ui/widget/spin-slider.h @@ -46,8 +46,6 @@ public: const Inkscape::UI::Widget::SpinButton& get_spin_button() const; Inkscape::UI::Widget::SpinButton& get_spin_button(); - void set_update_policy(const Gtk::UpdateType); - // Change the SpinSlider into a SpinButton with AttrWidget support) void remove_scale(); private: @@ -78,8 +76,6 @@ public: const SpinSlider& get_spinslider2() const; SpinSlider& get_spinslider2(); - void set_update_policy(const Gtk::UpdateType); - void remove_scale(); private: void link_toggled(); diff --git a/src/ui/widget/svg-canvas.cpp b/src/ui/widget/svg-canvas.cpp index a0d5e1215..a00c16f52 100644 --- a/src/ui/widget/svg-canvas.cpp +++ b/src/ui/widget/svg-canvas.cpp @@ -35,7 +35,7 @@ void SVGCanvas::init (SPDesktop *dt) { _dt = dt; - _widget->set_flags(Gtk::CAN_FOCUS); + _widget->set_can_focus(); // Set background to white Glib::RefPtr<Gtk::Style> style = _widget->get_style(); |
