diff options
| author | Marc Jeanmougin <marc@jeanmougin.fr> | 2018-01-23 09:00:08 +0000 |
|---|---|---|
| committer | Marc Jeanmougin <marc@jeanmougin.fr> | 2018-01-23 09:00:08 +0000 |
| commit | 19aa6a7dd1b0efea6e90756100b8f5b0d5a53004 (patch) | |
| tree | bea6110a49d50d68efd069ec275d934c44a44421 /src/ui/widget | |
| parent | Add FindNSIS and fix prefix (diff) | |
| parent | CPack fixes (diff) | |
| download | inkscape-19aa6a7dd1b0efea6e90756100b8f5b0d5a53004.tar.gz inkscape-19aa6a7dd1b0efea6e90756100b8f5b0d5a53004.zip | |
Merge branch 'master' of gitlab.com:marcjeanmougin/inkscape
Diffstat (limited to 'src/ui/widget')
| -rw-r--r-- | src/ui/widget/ink-select-one-action.cpp | 8 | ||||
| -rw-r--r-- | src/ui/widget/ink-select-one-action.h | 12 |
2 files changed, 16 insertions, 4 deletions
diff --git a/src/ui/widget/ink-select-one-action.cpp b/src/ui/widget/ink-select-one-action.cpp index 42a63adf0..da130ec1d 100644 --- a/src/ui/widget/ink-select-one-action.cpp +++ b/src/ui/widget/ink-select-one-action.cpp @@ -53,6 +53,7 @@ InkSelectOneAction::InkSelectOneAction (const Glib::ustring &name, _use_radio (true), _use_label (true), _use_icon (true), + _use_pixbuf (false), _icon_size ( Gtk::ICON_SIZE_LARGE_TOOLBAR ), _combobox (nullptr), _radioaction (nullptr), @@ -192,11 +193,16 @@ Gtk::Widget* InkSelectOneAction::create_tool_item_vfunc() { _combobox->set_model(_store); InkSelectOneActionColumns columns; - if (_use_icon ) { + if (_use_icon) { Gtk::CellRendererPixbuf *renderer = new Gtk::CellRendererPixbuf; renderer->set_property ("stock_size", Gtk::ICON_SIZE_LARGE_TOOLBAR); _combobox->pack_start (*renderer, false); _combobox->add_attribute (*renderer, "icon_name", columns.col_icon ); + } else if (_use_pixbuf) { + Gtk::CellRendererPixbuf *renderer = new Gtk::CellRendererPixbuf; + //renderer->set_property ("stock_size", Gtk::ICON_SIZE_LARGE_TOOLBAR); + _combobox->pack_start (*renderer, false); + _combobox->add_attribute (*renderer, "pixbuf", columns.col_pixbuf ); } if (_use_label) { diff --git a/src/ui/widget/ink-select-one-action.h b/src/ui/widget/ink-select-one-action.h index a50242bad..c95407797 100644 --- a/src/ui/widget/ink-select-one-action.h +++ b/src/ui/widget/ink-select-one-action.h @@ -37,11 +37,15 @@ public: InkSelectOneActionColumns() { add (col_label); add (col_icon); + add (col_pixbuf); + add (col_data); // Used to store a pointer add (col_tooltip); add (col_sensitive); } Gtk::TreeModelColumn<Glib::ustring> col_label; Gtk::TreeModelColumn<Glib::ustring> col_icon; + Gtk::TreeModelColumn<Glib::RefPtr<Gdk::Pixbuf> > col_pixbuf; + Gtk::TreeModelColumn<void *> col_data; Gtk::TreeModelColumn<Glib::ustring> col_tooltip; Gtk::TreeModelColumn<bool> col_sensitive; }; @@ -58,9 +62,10 @@ public: Glib::RefPtr<Gtk::ListStore> store ); /* Style of action */ - void use_radio( bool use_radio ) { _use_radio = use_radio; } - void use_label( bool use_label ) { _use_label = use_label; } - void use_icon( bool use_icon ) { _use_icon = use_icon; } + void use_radio( bool use_radio ) { _use_radio = use_radio; } + void use_label( bool use_label ) { _use_label = use_label; } + void use_icon( bool use_icon ) { _use_icon = use_icon; } + void use_pixbuf( bool use_pixbuf ) { _use_pixbuf = use_pixbuf; } void use_group_label( bool use_group_label ) { _use_group_label = use_group_label; } gint get_active() { return _active; } @@ -94,6 +99,7 @@ private: bool _use_radio; // Applies to tool item only bool _use_label; bool _use_icon; // Applies to menu item only + bool _use_pixbuf; bool _use_group_label; // Applies to tool item only Gtk::BuiltinIconSize _icon_size; |
