diff options
| author | Marc Jeanmougin <marc@jeanmougin.fr> | 2017-09-30 00:25:47 +0000 |
|---|---|---|
| committer | Marc Jeanmougin <marc@jeanmougin.fr> | 2017-09-30 00:25:47 +0000 |
| commit | 4ced018164553d115a24947ec74dace836e99732 (patch) | |
| tree | cb77b1f59c161da5c1dcde9edaaff9e046865696 /src/live_effects/parameter/togglebutton.cpp | |
| parent | remove helper/gnome-utils.* (diff) | |
| download | inkscape-4ced018164553d115a24947ec74dace836e99732.tar.gz inkscape-4ced018164553d115a24947ec74dace836e99732.zip | |
Hunted every GList to the last (except in libnrtype and libcroco)
Diffstat (limited to 'src/live_effects/parameter/togglebutton.cpp')
| -rw-r--r-- | src/live_effects/parameter/togglebutton.cpp | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/live_effects/parameter/togglebutton.cpp b/src/live_effects/parameter/togglebutton.cpp index 16b8f9067..e26884d6a 100644 --- a/src/live_effects/parameter/togglebutton.cpp +++ b/src/live_effects/parameter/togglebutton.cpp @@ -147,21 +147,25 @@ ToggleButtonParam::refresh_button() if(!box_button){ return; } - GList * childs = gtk_container_get_children(GTK_CONTAINER(box_button->gobj())); - guint total_widgets = g_list_length (childs); + std::vector<Gtk::Widget*> children = Glib::wrap(GTK_CONTAINER(box_button))->get_children(); if (!param_label.empty()) { + Gtk::Label *lab = dynamic_cast<Gtk::Label*>(children[children.size()-1]); + if (!lab) return; if(value || inactive_label.empty()){ - gtk_label_set_text(GTK_LABEL(g_list_nth_data(childs, total_widgets-1)), param_label.c_str()); + lab->set_text(param_label.c_str()); }else{ - gtk_label_set_text(GTK_LABEL(g_list_nth_data(childs, total_widgets-1)), inactive_label.c_str()); + lab->set_text(inactive_label.c_str()); } } if ( _icon_active ) { GdkPixbuf * icon_pixbuf = NULL; + Gtk::Image *im = dynamic_cast<Gtk::Image*>(children[0]); + Gtk::IconSize is(_icon_size); + if (!im) return; if(!value){ - gtk_image_set_from_icon_name (GTK_IMAGE(g_list_nth_data(childs, 0)), _icon_inactive, _icon_size); + im->set_from_icon_name(_icon_inactive, is); } else { - gtk_image_set_from_icon_name (GTK_IMAGE(g_list_nth_data(childs, 0)), _icon_active, _icon_size); + im->set_from_icon_name(_icon_active, is); } } } |
