summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Valavanis <valavanisalex@gmail.com>2016-08-11 23:45:47 +0000
committerAlex Valavanis <valavanisalex@gmail.com>2016-08-11 23:45:47 +0000
commitded71e7f2330ae5abbb0b09e12f89a8fefc2820a (patch)
treec4db69b3917f9a3941bf75b07028dd27ae9ad466
parentCloneTiler: Further C++ification (diff)
downloadinkscape-ded71e7f2330ae5abbb0b09e12f89a8fefc2820a.tar.gz
inkscape-ded71e7f2330ae5abbb0b09e12f89a8fefc2820a.zip
CloneTiler: Further C++ification
(bzr r15053)
-rw-r--r--src/ui/dialog/clonetiler.cpp18
-rw-r--r--src/ui/dialog/clonetiler.h2
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);