summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTavmjong Bah <tavmjong@free.fr>2017-12-24 22:31:21 +0000
committerTavmjong Bah <tavmjong@free.fr>2017-12-24 22:31:21 +0000
commit83287d0d146821d6376a87c51522860d08e7ef48 (patch)
tree1d3ccb8e6fe242ab4519ac62274158a46b762650 /src
parentName a few more widgets. Minor cleanup. (diff)
downloadinkscape-83287d0d146821d6376a87c51522860d08e7ef48.tar.gz
inkscape-83287d0d146821d6376a87c51522860d08e7ef48.zip
Bug fixes for radio action mode.
Diffstat (limited to 'src')
-rw-r--r--src/ui/widget/ink-select-one-action.cpp19
-rw-r--r--src/ui/widget/ink-select-one-action.h6
2 files changed, 18 insertions, 7 deletions
diff --git a/src/ui/widget/ink-select-one-action.cpp b/src/ui/widget/ink-select-one-action.cpp
index 40bafecc2..dedfb8894 100644
--- a/src/ui/widget/ink-select-one-action.cpp
+++ b/src/ui/widget/ink-select-one-action.cpp
@@ -31,22 +31,22 @@
#include <gtkmm/image.h>
InkSelectOneAction* InkSelectOneAction::create(const Glib::ustring &name,
- const Glib::ustring &label,
+ const Glib::ustring &group_label,
const Glib::ustring &tooltip,
const Glib::ustring &stock_id,
Glib::RefPtr<Gtk::ListStore> store ) {
- return new InkSelectOneAction(name, label, tooltip, stock_id, store);
+ return new InkSelectOneAction(name, group_label, tooltip, stock_id, store);
}
InkSelectOneAction::InkSelectOneAction (const Glib::ustring &name,
- const Glib::ustring &label,
+ const Glib::ustring &group_label,
const Glib::ustring &tooltip,
const Glib::ustring &stock_id,
Glib::RefPtr<Gtk::ListStore> store ) :
- Gtk::Action(name, stock_id, label, tooltip),
+ Gtk::Action(name, stock_id, group_label, tooltip),
_name( name ),
- _label( label ),
+ _group_label( group_label ),
_tooltip( tooltip ),
_stock_id( stock_id ),
_store (store),
@@ -136,6 +136,11 @@ Gtk::Widget* InkSelectOneAction::create_tool_item_vfunc() {
Gtk::Box* box = Gtk::manage(new Gtk::Box());
tool_item->add (*box);
+ if (_use_group_label) {
+ Gtk::Label *group_label = Gtk::manage (new Gtk::Label( _group_label + ": " ));
+ box->add( *group_label );
+ }
+
Gtk::RadioAction::Group group;
int index = 0;
auto children = _store->children();
@@ -167,6 +172,10 @@ Gtk::Widget* InkSelectOneAction::create_tool_item_vfunc() {
box->add (*item);
}
+ if (_radioaction) {
+ _radioaction->set_current_value (_active);
+ }
+
_radioaction->signal_changed().connect( sigc::mem_fun(*this, &InkSelectOneAction::on_changed_radioaction));
} else {
diff --git a/src/ui/widget/ink-select-one-action.h b/src/ui/widget/ink-select-one-action.h
index 194ca8027..0b1b08de4 100644
--- a/src/ui/widget/ink-select-one-action.h
+++ b/src/ui/widget/ink-select-one-action.h
@@ -61,6 +61,7 @@ public:
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_group_label( bool use_group_label ) { _use_group_label = use_group_label; }
gint get_active() { return _active; }
void set_active( gint active );
@@ -81,7 +82,7 @@ protected:
private:
Glib::ustring _name;
- Glib::ustring _label;
+ Glib::ustring _group_label;
Glib::ustring _tooltip;
Glib::ustring _stock_id;
Glib::RefPtr<Gtk::ListStore> _store;
@@ -92,6 +93,7 @@ private:
bool _use_radio; // Applies to tool item only
bool _use_label;
bool _use_icon; // Applies to menu item only
+ bool _use_group_label; // Applies to tool item only
Gtk::BuiltinIconSize _icon_size;
/* Combobox in tool */
@@ -109,7 +111,7 @@ private:
void on_toggled_radiomenu(int n);
InkSelectOneAction (const Glib::ustring &name,
- const Glib::ustring &label,
+ const Glib::ustring &group_label,
const Glib::ustring &tooltip,
const Glib::ustring &stock_id,
Glib::RefPtr<Gtk::ListStore> store );