From: Kris Date: Thu, 23 Dec 2010 17:52:29 +0000 (+0100) Subject: Mnemonics in "Fill and stroke", "Align and distribute", and "Transform" dialogs ... X-Git-Url: https://git.tokkee.org/?p=inkscape.git;a=commitdiff_plain;h=6302669b796eadd6994ecdc2e70f0119b29194dd Mnemonics in "Fill and stroke", "Align and distribute", and "Transform" dialogs (Bug 170765) --- diff --git a/src/ui/dialog/align-and-distribute.cpp b/src/ui/dialog/align-and-distribute.cpp index 48f0fbf22..f974ec6ce 100644 --- a/src/ui/dialog/align-and-distribute.cpp +++ b/src/ui/dialog/align-and-distribute.cpp @@ -467,7 +467,8 @@ public: dialog.tooltips().set_tip(removeOverlapXGap, _("Minimum horizontal gap (in px units) between bounding boxes")); //TRANSLATORS: "H:" stands for horizontal gap - removeOverlapXGapLabel.set_label(C_("Gap", "H:")); + removeOverlapXGapLabel.set_text_with_mnemonic(C_("Gap", "_H:")); + removeOverlapXGapLabel.set_mnemonic_widget(removeOverlapXGap); removeOverlapYGap.set_digits(1); removeOverlapYGap.set_size_request(60, -1); @@ -477,7 +478,8 @@ public: dialog.tooltips().set_tip(removeOverlapYGap, _("Minimum vertical gap (in px units) between bounding boxes")); /* TRANSLATORS: Vertical gap */ - removeOverlapYGapLabel.set_label(C_("Gap", "V:")); + removeOverlapYGapLabel.set_text_with_mnemonic(C_("Gap", "_V:")); + removeOverlapYGapLabel.set_mnemonic_widget(removeOverlapYGap); dialog.removeOverlap_table().attach(removeOverlapXGapLabel, column, column+1, row, row+1, Gtk::FILL, Gtk::FILL); dialog.removeOverlap_table().attach(removeOverlapXGap, column+1, column+2, row, row+1, Gtk::FILL, Gtk::FILL); @@ -896,7 +898,7 @@ AlignAndDistribute::AlignAndDistribute() _removeOverlapTable(1, 5, false), _nodesTable(1, 4, true), _anchorLabel(_("Relative to: ")), - _selgrpLabel(_("Treat selection as group: ")) + _selgrpLabel(_("_Treat selection as group: "), 1) { Inkscape::Preferences *prefs = Inkscape::Preferences::get(); @@ -1038,6 +1040,7 @@ AlignAndDistribute::AlignAndDistribute() _anchorBox.pack_start(_anchorLabel); _anchorBox.pack_start(_combo); + _selgrpLabel.set_mnemonic_widget(_selgrp); _selgrpBox.pack_start(_selgrpLabel); _selgrpBox.pack_start(_selgrp); _selgrp.set_active(prefs->getBool("/dialogs/align/sel-as-groups")); diff --git a/src/ui/dialog/transformation.cpp b/src/ui/dialog/transformation.cpp index c895f0be9..8da9914bc 100644 --- a/src/ui/dialog/transformation.cpp +++ b/src/ui/dialog/transformation.cpp @@ -104,7 +104,7 @@ Transformation::Transformation() _scalar_transform_f ("_F:", _("Transformation matrix element F")), _check_move_relative (_("Rela_tive move"), _("Add the specified relative displacement to the current position; otherwise, edit the current absolute position directly")), - _check_scale_proportional (_("Scale proportionally"), _("Preserve the width/height ratio of the scaled objects")), + _check_scale_proportional (_("_Scale proportionally"), _("Preserve the width/height ratio of the scaled objects")), _check_apply_separately (_("Apply to each _object separately"), _("Apply the scale/rotate/skew to each selected object separately; otherwise, transform the selection as a whole")), _check_replace_matrix (_("Edit c_urrent matrix"), _("Edit the current transform= matrix; otherwise, post-multiply transform= by this matrix")) diff --git a/src/widgets/spw-utilities.cpp b/src/widgets/spw-utilities.cpp index 7c2956c65..49e3a7495 100644 --- a/src/widgets/spw-utilities.cpp +++ b/src/widgets/spw-utilities.cpp @@ -34,11 +34,19 @@ * position in the table. */ Gtk::Label * -spw_label(Gtk::Table *table, const gchar *label_text, int col, int row) +spw_label(Gtk::Table *table, const gchar *label_text, int col, int row, Gtk::Widget* target) { - Gtk::Label *label_widget = new Gtk::Label(label_text); + Gtk::Label *label_widget = new Gtk::Label(); g_assert(label_widget != NULL); - + if (target != NULL) + { + label_widget->set_text_with_mnemonic(label_text); + label_widget->set_mnemonic_widget(*target); + } + else + { + label_widget->set_text(label_text); + } label_widget->set_alignment(1.0, 0.5); label_widget->show(); table->attach(*label_widget, col, col+1, row, row+1, (Gtk::EXPAND | Gtk::FILL), static_cast(0), 4, 0); diff --git a/src/widgets/spw-utilities.h b/src/widgets/spw-utilities.h index d17762811..9a387454f 100644 --- a/src/widgets/spw-utilities.h +++ b/src/widgets/spw-utilities.h @@ -20,6 +20,7 @@ #include #include /* GtkWidget */ +#include namespace Gtk { class Label; @@ -28,7 +29,7 @@ namespace Gtk { } Gtk::Label * -spw_label(Gtk::Table *table, gchar const *label_text, int col, int row); +spw_label(Gtk::Table *table, gchar const *label_text, int col, int row, Gtk::Widget *target); GtkWidget * spw_label_old(GtkWidget *table, gchar const *label_text, int col, int row); diff --git a/src/widgets/stroke-style.cpp b/src/widgets/stroke-style.cpp index ffcbe48f8..885a58536 100644 --- a/src/widgets/stroke-style.cpp +++ b/src/widgets/stroke-style.cpp @@ -673,7 +673,7 @@ sp_stroke_style_line_widget_new(void) gint i = 0; - spw_label(t, C_("Stroke width", "Width:"), 0, i); + //spw_label(t, C_("Stroke width", "_Width:"), 0, i); hb = spw_hbox(t, 3, 1, i); @@ -689,7 +689,8 @@ sp_stroke_style_line_widget_new(void) sb = new Gtk::SpinButton(*a, 0.1, 3); tt->set_tip(*sb, _("Stroke width")); sb->show(); - + spw_label(t, C_("Stroke width", "_Width:"), 0, i, sb); + sp_dialog_defocus_on_enter_cpp(sb); hb->pack_start(*sb, false, false, 0); @@ -711,7 +712,7 @@ sp_stroke_style_line_widget_new(void) /* Join type */ // TRANSLATORS: The line join style specifies the shape to be used at the // corners of paths. It can be "miter", "round" or "bevel". - spw_label(t, _("Join:"), 0, i); + spw_label(t, _("Join:"), 0, i, NULL); hb = spw_hbox(t, 3, 1, i); @@ -755,7 +756,7 @@ sp_stroke_style_line_widget_new(void) // spike that extends well beyond the connection point. The purpose of the // miter limit is to cut off such spikes (i.e. convert them into bevels) // when they become too long. - spw_label(t, _("Miter limit:"), 0, i); + //spw_label(t, _("Miter _limit:"), 0, i); hb = spw_hbox(t, 3, 1, i); @@ -765,6 +766,7 @@ sp_stroke_style_line_widget_new(void) sb = new Gtk::SpinButton(*a, 0.1, 2); tt->set_tip(*sb, _("Maximum length of the miter (in units of stroke width)")); sb->show(); + spw_label(t, _("Miter _limit:"), 0, i, sb); spw->set_data("miterlimit_sb", sb); sp_dialog_defocus_on_enter_cpp(sb); @@ -775,7 +777,8 @@ sp_stroke_style_line_widget_new(void) /* Cap type */ // TRANSLATORS: cap type specifies the shape for the ends of lines - spw_label(t, _("Cap:"), 0, i); + //spw_label(t, _("_Cap:"), 0, i); + spw_label(t, _("Cap:"), 0, i, NULL); hb = spw_hbox(t, 3, 1, i); @@ -809,7 +812,11 @@ sp_stroke_style_line_widget_new(void) /* Dash */ - spw_label(t, _("Dashes:"), 0, i); + spw_label(t, _("Dashes:"), 0, i, NULL); //no mnemonic for now + //decide what to do: + // implement a set_mnemonic_source function in the + // SPDashSelector class, so that we do not have to + // expose any of the underlying widgets? ds = manage(new SPDashSelector); ds->show(); @@ -826,8 +833,9 @@ sp_stroke_style_line_widget_new(void) // TRANSLATORS: Path markers are an SVG feature that allows you to attach arbitrary shapes // (arrowheads, bullets, faces, whatever) to the start, end, or middle nodes of a path. - spw_label(t, _("Start Markers:"), 0, i); + //spw_label(t, _("_Start Markers:"), 0, i); marker_start_menu = ink_marker_menu(spw ,"marker-start", sandbox); + spw_label(t, _("_Start Markers:"), 0, i, marker_start_menu); tt->set_tip(*marker_start_menu, _("Start Markers are drawn on the first node of a path or shape")); marker_start_menu_connection = marker_start_menu->signal_changed().connect( sigc::bind( @@ -837,8 +845,9 @@ sp_stroke_style_line_widget_new(void) spw->set_data("start_mark_menu", marker_start_menu); i++; - spw_label(t, _("Mid Markers:"), 0, i); + //spw_label(t, _("_Mid Markers:"), 0, i); marker_mid_menu = ink_marker_menu(spw ,"marker-mid", sandbox); + spw_label(t, _("_Mid Markers:"), 0, i, marker_mid_menu); tt->set_tip(*marker_mid_menu, _("Mid Markers are drawn on every node of a path or shape except the first and last nodes")); marker_mid_menu_connection = marker_mid_menu->signal_changed().connect( sigc::bind( @@ -848,8 +857,9 @@ sp_stroke_style_line_widget_new(void) spw->set_data("mid_mark_menu", marker_mid_menu); i++; - spw_label(t, _("End Markers:"), 0, i); + //spw_label(t, _("_End Markers:"), 0, i); marker_end_menu = ink_marker_menu(spw ,"marker-end", sandbox); + spw_label(t, _("_End Markers:"), 0, i, marker_end_menu); tt->set_tip(*marker_end_menu, _("End Markers are drawn on the last node of a path or shape")); marker_end_menu_connection = marker_end_menu->signal_changed().connect( sigc::bind(