summaryrefslogtreecommitdiffstats
path: root/src/ui/widget/combo-tool-item.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui/widget/combo-tool-item.cpp')
-rw-r--r--src/ui/widget/combo-tool-item.cpp43
1 files changed, 36 insertions, 7 deletions
diff --git a/src/ui/widget/combo-tool-item.cpp b/src/ui/widget/combo-tool-item.cpp
index a6c44f7eb..a9952fce6 100644
--- a/src/ui/widget/combo-tool-item.cpp
+++ b/src/ui/widget/combo-tool-item.cpp
@@ -66,6 +66,42 @@ ComboToolItem::ComboToolItem(Glib::ustring group_label,
_combobox = Gtk::manage (new Gtk::ComboBox());
_combobox->set_model(_store);
+ populate_combobox();
+
+ _combobox->signal_changed().connect(
+ sigc::mem_fun(*this, &ComboToolItem::on_changed_combobox));
+
+ box->add (*_combobox);
+
+ show_all();
+}
+
+void
+ComboToolItem::use_label(bool use_label)
+{
+ _use_label = use_label;
+ populate_combobox();
+}
+
+void
+ComboToolItem::use_icon(bool use_icon)
+{
+ _use_icon = use_icon;
+ populate_combobox();
+}
+
+void
+ComboToolItem::use_pixbuf(bool use_pixbuf)
+{
+ _use_pixbuf = use_pixbuf;
+ populate_combobox();
+}
+
+void
+ComboToolItem::populate_combobox()
+{
+ _combobox->clear();
+
ComboToolItemColumns columns;
if (_use_icon) {
Gtk::CellRendererPixbuf *renderer = new Gtk::CellRendererPixbuf;
@@ -89,13 +125,6 @@ ComboToolItem::ComboToolItem(Glib::ustring group_label,
}
_combobox->set_active (_active);
-
- _combobox->signal_changed().connect(
- sigc::mem_fun(*this, &ComboToolItem::on_changed_combobox));
-
- box->add (*_combobox);
-
- show_all();
}
void