summaryrefslogtreecommitdiffstats
path: root/src/ui/widget
diff options
context:
space:
mode:
authorJohn Smith <john.smith7545@yahoo.com>2012-09-11 00:14:11 +0000
committerJohn Smith <john.smith7545@yahoo.com>2012-09-11 00:14:11 +0000
commit63a0b0f94e29ed91fb98b1b841cd698fd3e95cce (patch)
treed62d677de61e2e5e896730f3ac738f9190dfd6dc /src/ui/widget
parentpdf import. move style attribute from <tspan> node to <text> node (Bug 219709) (diff)
downloadinkscape-63a0b0f94e29ed91fb98b1b841cd698fd3e95cce.tar.gz
inkscape-63a0b0f94e29ed91fb98b1b841cd698fd3e95cce.zip
Fix for 167181 : Gnome-HIG-2.0 conformant Preferences dialog - accel keys
(bzr r11662)
Diffstat (limited to 'src/ui/widget')
-rw-r--r--src/ui/widget/labelled.cpp5
-rw-r--r--src/ui/widget/labelled.h4
-rw-r--r--src/ui/widget/preferences-widget.cpp27
-rw-r--r--src/ui/widget/preferences-widget.h9
4 files changed, 42 insertions, 3 deletions
diff --git a/src/ui/widget/labelled.cpp b/src/ui/widget/labelled.cpp
index 2dda941f2..6e3652830 100644
--- a/src/ui/widget/labelled.cpp
+++ b/src/ui/widget/labelled.cpp
@@ -78,6 +78,11 @@ Labelled::setTooltipText(const Glib::ustring &tooltip)
_widget->set_tooltip_text(tooltip);
}
+bool Labelled::on_mnemonic_activate ( bool group_cycling )
+{
+ return _widget->mnemonic_activate ( group_cycling );
+}
+
} // namespace Widget
} // namespace UI
} // namespace Inkscape
diff --git a/src/ui/widget/labelled.h b/src/ui/widget/labelled.h
index 030fd0d93..88eb3ce19 100644
--- a/src/ui/widget/labelled.h
+++ b/src/ui/widget/labelled.h
@@ -56,7 +56,11 @@ public:
void setLabelText(const Glib::ustring &str);
void setTooltipText(const Glib::ustring &tooltip);
+private:
+ virtual bool on_mnemonic_activate( bool group_cycling );
+
protected:
+
Gtk::Widget *_widget;
Gtk::Label *_label;
Gtk::Label *_suffix;
diff --git a/src/ui/widget/preferences-widget.cpp b/src/ui/widget/preferences-widget.cpp
index 8ce7c63db..07145f5f3 100644
--- a/src/ui/widget/preferences-widget.cpp
+++ b/src/ui/widget/preferences-widget.cpp
@@ -54,7 +54,7 @@ DialogPage::DialogPage()
this->set_row_spacings(6);
}
-void DialogPage::add_line(bool indent, Glib::ustring const &label, Gtk::Widget &widget, Glib::ustring const &suffix, const Glib::ustring &tip, bool expand_widget)
+void DialogPage::add_line(bool indent, Glib::ustring const &label, Gtk::Widget &widget, Glib::ustring const &suffix, const Glib::ustring &tip, bool expand_widget, Gtk::Widget *other_widget)
{
int start_col;
int row = this->property_n_rows();
@@ -68,6 +68,10 @@ void DialogPage::add_line(bool indent, Glib::ustring const &label, Gtk::Widget &
Gtk::HBox* hb = Gtk::manage(new Gtk::HBox());
hb->set_spacing(12);
hb->pack_start(widget,false,false);
+ if (other_widget) {
+ hb->pack_start(*other_widget,false,false);
+ }
+
w = (Gtk::Widget*) hb;
}
if (label != "")
@@ -468,6 +472,12 @@ ZoomCorrRulerSlider::on_unit_changed() {
}
}
+bool ZoomCorrRulerSlider::on_mnemonic_activate ( bool group_cycling )
+{
+ return _sb.mnemonic_activate ( group_cycling );
+}
+
+
void
ZoomCorrRulerSlider::init(int ruler_width, int ruler_height, double lower, double upper,
double step_increment, double page_increment, double default_value)
@@ -539,6 +549,11 @@ PrefSlider::on_spinbutton_value_changed()
}
}
+bool PrefSlider::on_mnemonic_activate ( bool group_cycling )
+{
+ return _sb.mnemonic_activate ( group_cycling );
+}
+
void
PrefSlider::init(Glib::ustring const &prefs_path,
double lower, double upper, double step_increment, double page_increment, double default_value, int digits)
@@ -674,6 +689,11 @@ void PrefEntryButtonHBox::onRelatedButtonClickedCallback()
}
}
+bool PrefEntryButtonHBox::on_mnemonic_activate ( bool group_cycling )
+{
+ return relatedEntry->mnemonic_activate ( group_cycling );
+}
+
void PrefEntryFileButtonHBox::init(Glib::ustring const &prefs_path,
bool visibility)
{
@@ -806,6 +826,11 @@ void PrefEntryFileButtonHBox::onRelatedButtonClickedCallback()
}
}
+bool PrefEntryFileButtonHBox::on_mnemonic_activate ( bool group_cycling )
+{
+ return relatedEntry->mnemonic_activate ( group_cycling );
+}
+
void PrefFileButton::init(Glib::ustring const &prefs_path)
{
_prefs_path = prefs_path;
diff --git a/src/ui/widget/preferences-widget.h b/src/ui/widget/preferences-widget.h
index 874e0958a..bfe0deaba 100644
--- a/src/ui/widget/preferences-widget.h
+++ b/src/ui/widget/preferences-widget.h
@@ -130,6 +130,7 @@ private:
void on_slider_value_changed();
void on_spinbutton_value_changed();
void on_unit_changed();
+ virtual bool on_mnemonic_activate( bool group_cycling );
Inkscape::UI::Widget::SpinButton _sb;
UnitMenu _unit;
@@ -147,7 +148,8 @@ public:
private:
void on_slider_value_changed();
void on_spinbutton_value_changed();
-
+ virtual bool on_mnemonic_activate( bool group_cycling );
+
Glib::ustring _prefs_path;
Inkscape::UI::Widget::SpinButton _sb;
Gtk::HScale _slider;
@@ -188,6 +190,7 @@ class PrefEntryButtonHBox : public Gtk::HBox
public:
void init(Glib::ustring const &prefs_path,
bool mask, Glib::ustring const &default_string);
+
protected:
Glib::ustring _prefs_path;
Glib::ustring _default_string;
@@ -195,6 +198,7 @@ protected:
Gtk::Entry *relatedEntry;
void onRelatedEntryChangedCallback();
void onRelatedButtonClickedCallback();
+ virtual bool on_mnemonic_activate( bool group_cycling );
};
class PrefEntryFileButtonHBox : public Gtk::HBox
@@ -208,6 +212,7 @@ protected:
Gtk::Entry *relatedEntry;
void onRelatedEntryChangedCallback();
void onRelatedButtonClickedCallback();
+ virtual bool on_mnemonic_activate( bool group_cycling );
};
class PrefFileButton : public Gtk::FileChooserButton
@@ -247,7 +252,7 @@ class DialogPage : public Gtk::Table
{
public:
DialogPage();
- void add_line(bool indent, Glib::ustring const &label, Gtk::Widget& widget, Glib::ustring const &suffix, Glib::ustring const &tip, bool expand = true);
+ void add_line(bool indent, Glib::ustring const &label, Gtk::Widget& widget, Glib::ustring const &suffix, Glib::ustring const &tip, bool expand = true, Gtk::Widget *other_widget = NULL);
void add_group_header(Glib::ustring name);
void set_tip(Gtk::Widget &widget, Glib::ustring const &tip);
};