diff options
| author | Alex Valavanis <valavanisalex@gmail.com> | 2016-08-11 23:45:47 +0000 |
|---|---|---|
| committer | Alex Valavanis <valavanisalex@gmail.com> | 2016-08-11 23:45:47 +0000 |
| commit | ded71e7f2330ae5abbb0b09e12f89a8fefc2820a (patch) | |
| tree | c4db69b3917f9a3941bf75b07028dd27ae9ad466 /src | |
| parent | CloneTiler: Further C++ification (diff) | |
| download | inkscape-ded71e7f2330ae5abbb0b09e12f89a8fefc2820a.tar.gz inkscape-ded71e7f2330ae5abbb0b09e12f89a8fefc2820a.zip | |
CloneTiler: Further C++ification
(bzr r15053)
Diffstat (limited to 'src')
| -rw-r--r-- | src/ui/dialog/clonetiler.cpp | 18 | ||||
| -rw-r--r-- | src/ui/dialog/clonetiler.h | 2 |
2 files changed, 10 insertions, 10 deletions
diff --git a/src/ui/dialog/clonetiler.cpp b/src/ui/dialog/clonetiler.cpp index a9bec8227..c27d5d35a 100644 --- a/src/ui/dialog/clonetiler.cpp +++ b/src/ui/dialog/clonetiler.cpp @@ -1141,10 +1141,10 @@ CloneTiler::CloneTiler () : // diagrams on the left in the following screenshot: // http://www.inkscape.org/screenshots/gallery/inkscape-0.42-CVS-tiles-unclump.png // So unclumping is the process of spreading a number of objects out more evenly. - GtkWidget *b = gtk_button_new_with_mnemonic (_(" _Unclump ")); - gtk_widget_set_tooltip_text (b, _("Spread out clones to reduce clumping; can be applied repeatedly")); - g_signal_connect (G_OBJECT (b), "clicked", G_CALLBACK (unclump), NULL); - gtk_box_pack_end (GTK_BOX (sb), b, FALSE, FALSE, 0); + auto b = Gtk::manage(new Gtk::Button(_(" _Unclump "), true)); + b->set_tooltip_text(_("Spread out clones to reduce clumping; can be applied repeatedly")); + b->signal_clicked().connect(sigc::mem_fun(*this, &CloneTiler::unclump)); + gtk_box_pack_end (GTK_BOX (sb), GTK_WIDGET(b->gobj()), FALSE, FALSE, 0); } { @@ -1948,14 +1948,14 @@ void CloneTiler::trace_finish() } } -void CloneTiler::unclump(GtkWidget */*widget*/, void *) +void CloneTiler::unclump() { - SPDesktop *desktop = SP_ACTIVE_DESKTOP; + auto desktop = SP_ACTIVE_DESKTOP; if (desktop == NULL) { return; } - Inkscape::Selection *selection = desktop->getSelection(); + auto selection = desktop->getSelection(); // check if something is selected if (selection->isEmpty() || boost::distance(selection->items()) > 1) { @@ -1963,8 +1963,8 @@ void CloneTiler::unclump(GtkWidget */*widget*/, void *) return; } - SPObject *obj = selection->singleItem(); - SPObject *parent = obj->parent; + auto obj = selection->singleItem(); + auto parent = obj->parent; std::vector<SPItem*> to_unclump; // not including the original diff --git a/src/ui/dialog/clonetiler.h b/src/ui/dialog/clonetiler.h index 70a22d3d0..04f676800 100644 --- a/src/ui/dialog/clonetiler.h +++ b/src/ui/dialog/clonetiler.h @@ -57,7 +57,7 @@ protected: void switch_to_create(); void switch_to_fill(); void keep_bbox_toggled(); - static void unclump(GtkWidget */*widget*/, void *); + void unclump(); static void reset(GtkWidget */*widget*/, GtkWidget *dlg); static guint number_of_clones(SPObject *obj); static void trace_setup(SPDocument *doc, gdouble zoom, SPItem *original); |
