summaryrefslogtreecommitdiffstats
path: root/src/widgets
diff options
context:
space:
mode:
authorAlex Valavanis <valavanisalex@gmail.com>2012-04-30 22:04:12 +0000
committerAlex Valavanis <valavanisalex@gmail.com>2012-04-30 22:04:12 +0000
commitbc19e10ccfe4010990d2a86cbae992f7825e2562 (patch)
treec34501ae52633d8b9451734a951196ed1675e471 /src/widgets
parentemf import. use EMR_EXTSELECTCLIPRGN to cancel clipping (Bug 990083) (diff)
downloadinkscape-bc19e10ccfe4010990d2a86cbae992f7825e2562.tar.gz
inkscape-bc19e10ccfe4010990d2a86cbae992f7825e2562.zip
gtkmm-3.0 changes for Gtk::Adjustment
(bzr r11308)
Diffstat (limited to 'src/widgets')
-rw-r--r--src/widgets/dash-selector.cpp10
-rw-r--r--src/widgets/dash-selector.h4
-rw-r--r--src/widgets/desktop-widget.cpp12
-rw-r--r--src/widgets/select-toolbar.cpp5
-rw-r--r--src/widgets/stroke-style.cpp17
-rw-r--r--src/widgets/toolbox.cpp5
6 files changed, 48 insertions, 5 deletions
diff --git a/src/widgets/dash-selector.cpp b/src/widgets/dash-selector.cpp
index 7f36b91f5..901d3b68c 100644
--- a/src/widgets/dash-selector.cpp
+++ b/src/widgets/dash-selector.cpp
@@ -61,9 +61,17 @@ SPDashSelector::SPDashSelector()
this->pack_start(dash_combo, false, false, 0);
+#if WITH_GTKMM_3_0
+ offset = Gtk::Adjustment::create(0.0, 0.0, 10.0, 0.1, 1.0, 0.0);
+#else
offset = new Gtk::Adjustment(0.0, 0.0, 10.0, 0.1, 1.0, 0.0);
+#endif
offset->signal_value_changed().connect(sigc::mem_fun(*this, &SPDashSelector::offset_value_changed));
+#if WITH_GTKMM_3_0
+ Inkscape::UI::Widget::SpinButton *sb = new Inkscape::UI::Widget::SpinButton(offset, 0.1, 2);
+#else
Inkscape::UI::Widget::SpinButton *sb = new Inkscape::UI::Widget::SpinButton(*offset, 0.1, 2);
+#endif
sb->set_tooltip_text(_("Pattern offset"));
sp_dialog_defocus_on_enter_cpp(sb);
sb->show();
@@ -84,7 +92,9 @@ SPDashSelector::SPDashSelector()
SPDashSelector::~SPDashSelector() {
// FIXME: for some reason this doesn't get called; does the call to manage() in
// sp_stroke_style_line_widget_new() not processed correctly?
+#if !WITH_GTKMM_3_0
delete offset;
+#endif
}
void SPDashSelector::prepareImageRenderer( Gtk::TreeModel::const_iterator const &row ) {
diff --git a/src/widgets/dash-selector.h b/src/widgets/dash-selector.h
index 875d8e9d5..0a572f4de 100644
--- a/src/widgets/dash-selector.h
+++ b/src/widgets/dash-selector.h
@@ -77,7 +77,11 @@ private:
Gtk::ComboBox dash_combo;
Gtk::CellRendererPixbuf image_renderer;
+#if WITH_GTKMM_3_0
+ Glib::RefPtr<Gtk::Adjustment> offset;
+#else
Gtk::Adjustment *offset;
+#endif
static gchar const *const _prefs_path;
int preview_width;
diff --git a/src/widgets/desktop-widget.cpp b/src/widgets/desktop-widget.cpp
index 996f116e2..71f7b8c17 100644
--- a/src/widgets/desktop-widget.cpp
+++ b/src/widgets/desktop-widget.cpp
@@ -334,7 +334,7 @@ void SPDesktopWidget::init( SPDesktopWidget *dtw )
/* Main table */
#if GTK_CHECK_VERSION(3,0,0)
dtw->vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0);
- gtk_box_new(GTK_BOX(dtw->vbox), FALSE);
+ gtk_box_set_homogeneous(GTK_BOX(dtw->vbox), FALSE);
#else
dtw->vbox = gtk_vbox_new (FALSE, 0);
#endif
@@ -413,13 +413,17 @@ void SPDesktopWidget::init( SPDesktopWidget *dtw )
/* Horizontal scrollbar */
dtw->hadj = (GtkAdjustment *) gtk_adjustment_new (0.0, -4000.0, 4000.0, 10.0, 100.0, 4.0);
+#if GTK_CHECK_VERSION(3,0,0)
+ dtw->hscrollbar = gtk_scrollbar_new(GTK_ORIENTATION_HORIZONTAL, GTK_ADJUSTMENT (dtw->hadj));
+#else
dtw->hscrollbar = gtk_hscrollbar_new (GTK_ADJUSTMENT (dtw->hadj));
+#endif
gtk_table_attach (GTK_TABLE (canvas_tbl), dtw->hscrollbar, 1, 2, 2, 3, (GtkAttachOptions)(GTK_FILL), (GtkAttachOptions)(GTK_SHRINK), 0, 0);
/* Vertical scrollbar and the sticky zoom button */
#if GTK_CHECK_VERSION(3,0,0)
dtw->vscrollbar_box = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0);
- gtk_box_new(GTK_BOX(dtw->vscrollbar_box), FALSE);
+ gtk_box_set_homogeneous(GTK_BOX(dtw->vscrollbar_box), FALSE);
#else
dtw->vscrollbar_box = gtk_vbox_new (FALSE, 0);
#endif
@@ -432,7 +436,11 @@ void SPDesktopWidget::init( SPDesktopWidget *dtw )
gtk_box_pack_start (GTK_BOX (dtw->vscrollbar_box), dtw->sticky_zoom, FALSE, FALSE, 0);
g_signal_connect (G_OBJECT (dtw->sticky_zoom), "toggled", G_CALLBACK (sp_dtw_sticky_zoom_toggled), dtw);
dtw->vadj = (GtkAdjustment *) gtk_adjustment_new (0.0, -4000.0, 4000.0, 10.0, 100.0, 4.0);
+#if GTK_CHECK_VERSION(3,0,0)
+ dtw->vscrollbar = gtk_scrollbar_new(GTK_ORIENTATION_VERTICAL, GTK_ADJUSTMENT(dtw->vadj));
+#else
dtw->vscrollbar = gtk_vscrollbar_new (GTK_ADJUSTMENT (dtw->vadj));
+#endif
gtk_box_pack_start (GTK_BOX (dtw->vscrollbar_box), dtw->vscrollbar, TRUE, TRUE, 0);
gtk_table_attach (GTK_TABLE (canvas_tbl), dtw->vscrollbar_box, 2, 3, 0, 2, (GtkAttachOptions)(GTK_SHRINK), (GtkAttachOptions)(GTK_FILL), 0, 0);
diff --git a/src/widgets/select-toolbar.cpp b/src/widgets/select-toolbar.cpp
index e23d4f84b..4378bc19d 100644
--- a/src/widgets/select-toolbar.cpp
+++ b/src/widgets/select-toolbar.cpp
@@ -270,7 +270,12 @@ sp_object_layout_any_value_changed(GtkAdjustment *adj, SPWidget *spw)
static GtkWidget* createCustomSlider( GtkAdjustment *adjustment, gdouble climbRate, guint digits )
{
+#if WITH_GTKMM_3_0
+ Glib::RefPtr<Gtk::Adjustment> adj = Glib::wrap(adjustment, true);
+ Inkscape::UI::Widget::SpinButton *inkSpinner = new Inkscape::UI::Widget::SpinButton(adj, climbRate, digits);
+#else
Inkscape::UI::Widget::SpinButton *inkSpinner = new Inkscape::UI::Widget::SpinButton(*Glib::wrap(adjustment, true), climbRate, digits);
+#endif
inkSpinner = Gtk::manage( inkSpinner );
GtkWidget *widget = GTK_WIDGET( inkSpinner->gobj() );
return widget;
diff --git a/src/widgets/stroke-style.cpp b/src/widgets/stroke-style.cpp
index db378ef4d..90bd62847 100644
--- a/src/widgets/stroke-style.cpp
+++ b/src/widgets/stroke-style.cpp
@@ -296,7 +296,6 @@ Gtk::Container *sp_stroke_style_line_widget_new(void)
GtkWidget *us_old, *spw_old;
Gtk::Container *spw;
Gtk::Table *t;
- Gtk::Adjustment *a;
Inkscape::UI::Widget::SpinButton *sb;
Gtk::RadioButton *tb;
Gtk::HBox *f, *hb;
@@ -328,9 +327,15 @@ Gtk::Container *sp_stroke_style_line_widget_new(void)
// with it, the two remaining calls of stroke_average_width, allowing us to get rid of that
// function in desktop-style.
- a = new Gtk::Adjustment(1.0, 0.0, 1000.0, 0.1, 10.0, 0.0);
+#if WITH_GTKMM_3_0
+ Glib::RefPtr<Gtk::Adjustment> a = Gtk::Adjustment::create(1.0, 0.0, 1000.0, 0.1, 10.0, 0.0);
+ spw->set_data("width", &a);
+ sb = new Inkscape::UI::Widget::SpinButton(a, 0.1, 3);
+#else
+ Gtk::Adjustment *a = new Gtk::Adjustment(1.0, 0.0, 1000.0, 0.1, 10.0, 0.0);
spw->set_data("width", a);
sb = new Inkscape::UI::Widget::SpinButton(*a, 0.1, 3);
+#endif
sb->set_tooltip_text(_("Stroke width"));
sb->show();
spw_label(t, C_("Stroke width", "_Width:"), 0, i, sb);
@@ -404,10 +409,16 @@ Gtk::Container *sp_stroke_style_line_widget_new(void)
hb = spw_hbox(t, 3, 1, i);
+#if WITH_GTKMM_3_0
+ a = Gtk::Adjustment::create(4.0, 0.0, 100.0, 0.1, 10.0, 0.0);
+ spw->set_data("miterlimit", &a);
+ sb = new Inkscape::UI::Widget::SpinButton(a, 0.1, 2);
+#else
a = new Gtk::Adjustment(4.0, 0.0, 100.0, 0.1, 10.0, 0.0);
spw->set_data("miterlimit", a);
-
sb = new Inkscape::UI::Widget::SpinButton(*a, 0.1, 2);
+#endif
+
sb->set_tooltip_text(_("Maximum length of the miter (in units of stroke width)"));
sb->show();
spw_label(t, _("Miter _limit:"), 0, i, sb);
diff --git a/src/widgets/toolbox.cpp b/src/widgets/toolbox.cpp
index 7d73c042b..0ecea3766 100644
--- a/src/widgets/toolbox.cpp
+++ b/src/widgets/toolbox.cpp
@@ -1119,7 +1119,12 @@ GtkWidget *ToolboxFactory::createSnapToolbox()
static GtkWidget* createCustomSlider( GtkAdjustment *adjustment, gdouble climbRate, guint digits )
{
+#if WITH_GTKMM_3_0
+ Glib::RefPtr<Gtk::Adjustment> adj = Glib::wrap(adjustment, true);
+ Inkscape::UI::Widget::SpinButton *inkSpinner = new Inkscape::UI::Widget::SpinButton(adj, climbRate, digits);
+#else
Inkscape::UI::Widget::SpinButton *inkSpinner = new Inkscape::UI::Widget::SpinButton(*Glib::wrap(adjustment, true), climbRate, digits);
+#endif
inkSpinner = Gtk::manage( inkSpinner );
GtkWidget *widget = GTK_WIDGET( inkSpinner->gobj() );
return widget;