summaryrefslogtreecommitdiffstats
path: root/src/ui/widget/combo-tool-item.cpp
diff options
context:
space:
mode:
authorAlexander Valavanis <valavanisalex@gmail.com>2019-05-28 09:52:31 +0000
committerAlexander Valavanis <valavanisalex@gmail.com>2019-05-28 09:52:31 +0000
commit88bc8d77cc809cc1597823667c142d3c1eee3434 (patch)
tree2f158d44d41a58c0f310364f77828d9c909bdce5 /src/ui/widget/combo-tool-item.cpp
parentStrip out all content from TextToolbar (diff)
downloadinkscape-88bc8d77cc809cc1597823667c142d3c1eee3434.tar.gz
inkscape-88bc8d77cc809cc1597823667c142d3c1eee3434.zip
Hackfest2019: TextToolbar: Start GtkAction migration
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