summaryrefslogtreecommitdiffstats
path: root/src/widgets/ink-comboboxentry-action.h
diff options
context:
space:
mode:
authorAlexander Valavanis <valavanisalex@gmail.com>2019-06-04 15:55:52 +0000
committerAlexander Valavanis <valavanisalex@gmail.com>2019-06-04 15:55:52 +0000
commit2ca9be0db6ec5173e382e032f7e43768049352cb (patch)
tree1f883538b514bfda2fc37876b90e2343ac7724f7 /src/widgets/ink-comboboxentry-action.h
parentHackfest 2019: C++ify ComboBoxEntryAction (diff)
downloadinkscape-2ca9be0db6ec5173e382e032f7e43768049352cb.tar.gz
inkscape-2ca9be0db6ec5173e382e032f7e43768049352cb.zip
ComboBoxToolItem: Rebase on ToolItem
Diffstat (limited to 'src/widgets/ink-comboboxentry-action.h')
-rw-r--r--src/widgets/ink-comboboxentry-action.h40
1 files changed, 21 insertions, 19 deletions
diff --git a/src/widgets/ink-comboboxentry-action.h b/src/widgets/ink-comboboxentry-action.h
index 1235ec300..7ae07d599 100644
--- a/src/widgets/ink-comboboxentry-action.h
+++ b/src/widgets/ink-comboboxentry-action.h
@@ -20,14 +20,20 @@
#ifndef SEEN_INK_COMBOBOXENTRY_ACTION
#define SEEN_INK_COMBOBOXENTRY_ACTION
-#include <gtkmm/action.h>
+#include <gtkmm/toolitem.h>
namespace Inkscape {
namespace UI {
namespace Widget {
-class ComboBoxEntryAction : public Gtk::Action {
+/**
+ * Creates a Gtk::ToolItem subclass that wraps a Gtk::ComboBox object.
+ */
+class ComboBoxEntryToolItem : public Gtk::ToolItem {
private:
+ Glib::ustring _stock_id;
+ Glib::ustring _tooltip;
+ Glib::ustring _label;
GtkTreeModel *_model; ///< Tree Model
GtkComboBox *_combobox;
GtkEntry *_entry;
@@ -55,16 +61,15 @@ private:
// Signals
sigc::signal<void> _signal_changed;
- void (*changed) (ComboBoxEntryAction* action);
- void (*activated) (ComboBoxEntryAction* action);
+ void (*changed) (ComboBoxEntryToolItem* action);
+ void (*activated) (ComboBoxEntryToolItem* action);
- static gint get_active_row_from_text(ComboBoxEntryAction *action,
+ static gint get_active_row_from_text(ComboBoxEntryToolItem *action,
const gchar *target_text,
gboolean exclude = false,
gboolean ignore_case = false);
void defocus();
- Gtk::Widget* create_tool_item_vfunc() override;
static void combo_box_changed_cb( GtkComboBox* widget, gpointer data );
static void entry_activate_cb( GtkEntry *widget,
gpointer data );
@@ -79,19 +84,16 @@ private:
Glib::ustring check_comma_separated_text();
public:
- /**
- * Creates a GtkAction subclass that wraps a GtkComboBoxEntry object.
- */
- ComboBoxEntryAction(const gchar *name,
- const gchar *label,
- const gchar *tooltip,
- const gchar *stock_id,
- GtkTreeModel *model,
- gint entry_width = -1,
- gint extra_width = -1,
- gpointer cell_data_func = nullptr,
- gpointer separator_func = nullptr,
- GtkWidget* focusWidget = nullptr);
+ ComboBoxEntryToolItem(const Glib::ustring name,
+ const Glib::ustring label,
+ const Glib::ustring tooltip,
+ const Glib::ustring stock_id,
+ GtkTreeModel *model,
+ gint entry_width = -1,
+ gint extra_width = -1,
+ gpointer cell_data_func = nullptr,
+ gpointer separator_func = nullptr,
+ GtkWidget* focusWidget = nullptr);
gchar* get_active_text();
gboolean set_active_text(const gchar* text, int row=-1);