From 10b1aecd8d885414229807196018cd32582bb085 Mon Sep 17 00:00:00 2001 From: Alexander Valavanis Date: Tue, 28 May 2019 17:38:25 +0100 Subject: Hackfest2019: Add an entry to ComboBoxToolItem --- src/ui/widget/combo-tool-item.cpp | 10 ++++++---- src/ui/widget/combo-tool-item.h | 6 ++++-- 2 files changed, 10 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/ui/widget/combo-tool-item.cpp b/src/ui/widget/combo-tool-item.cpp index a9952fce6..b8638ba72 100644 --- a/src/ui/widget/combo-tool-item.cpp +++ b/src/ui/widget/combo-tool-item.cpp @@ -34,15 +34,17 @@ ComboToolItem* ComboToolItem::create(const Glib::ustring &group_label, const Glib::ustring &tooltip, const Glib::ustring &stock_id, - Glib::RefPtr store ) + Glib::RefPtr store, + bool has_entry) { - return new ComboToolItem(group_label, tooltip, stock_id, store); + return new ComboToolItem(group_label, tooltip, stock_id, store, has_entry); } ComboToolItem::ComboToolItem(Glib::ustring group_label, Glib::ustring tooltip, Glib::ustring stock_id, - Glib::RefPtr store ) : + Glib::RefPtr store, + bool has_entry) : _group_label(std::move( group_label )), _tooltip(std::move( tooltip )), _stock_id(std::move( stock_id )), @@ -63,7 +65,7 @@ ComboToolItem::ComboToolItem(Glib::ustring group_label, } // Create combobox - _combobox = Gtk::manage (new Gtk::ComboBox()); + _combobox = Gtk::manage (new Gtk::ComboBox(has_entry)); _combobox->set_model(_store); populate_combobox(); diff --git a/src/ui/widget/combo-tool-item.h b/src/ui/widget/combo-tool-item.h index 8ace006a1..d2ca874f0 100644 --- a/src/ui/widget/combo-tool-item.h +++ b/src/ui/widget/combo-tool-item.h @@ -54,7 +54,8 @@ public: static ComboToolItem* create(const Glib::ustring &label, const Glib::ustring &tooltip, const Glib::ustring &stock_id, - Glib::RefPtr store ); + Glib::RefPtr store, + bool has_entry = false); /* Style of combobox */ void use_label( bool use_label ); @@ -109,7 +110,8 @@ private: ComboToolItem(Glib::ustring group_label, Glib::ustring tooltip, Glib::ustring stock_id, - Glib::RefPtr store ); + Glib::RefPtr store, + bool has_entry = false); }; } } -- cgit v1.2.3