[gnome-boxes/gnome-3-8: 3/5] Make sure wizard buttons use underlined chars



commit 95fdfb1c827cfb92cc3cb66d8f1e55a4a1326540
Author: Christophe Fergeau <cfergeau redhat com>
Date:   Thu Apr 18 13:10:40 2013 +0200

    Make sure wizard buttons use underlined chars
    
    Because of libgd bgo#698289, creating a button with a label containing a
    "_" and setting use_underline to TRUE afterwards don't make
    GdHeadersimpleButton reinterpret the label to remove the '_' character
    and use it as an underline mark.
    
    Setting the label to the value it already has right after setting
    use_underline works around this issue.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=698287

 src/wizard.vala | 8 ++++++++
 1 file changed, 8 insertions(+)
---
diff --git a/src/wizard.vala b/src/wizard.vala
index d664ed4..fa2907b 100644
--- a/src/wizard.vala
+++ b/src/wizard.vala
@@ -648,6 +648,8 @@ private class Boxes.Wizard: Boxes.UI {
         toolbar_sizegroup = new Gtk.SizeGroup (Gtk.SizeGroupMode.HORIZONTAL);
         cancel_button = toolbar.add_button (null, _("_Cancel"), true) as Gtk.Button;
         cancel_button.use_underline = true;
+        // workaround for libgd bug #698289
+        cancel_button.label = _("_Cancel");
         cancel_button.clicked.connect (() => {
             destroy_machine ();
             wizard_source.page = SourcePage.MAIN;
@@ -657,6 +659,8 @@ private class Boxes.Wizard: Boxes.UI {
 
         back_button = toolbar.add_button (null, _("_Back"), false) as Gtk.Button;
         back_button.use_underline = true;
+        // workaround for libgd bug #698289
+        back_button.label = _("_Back");
         back_button.clicked.connect (() => {
             page = page - 1;
         });
@@ -664,6 +668,8 @@ private class Boxes.Wizard: Boxes.UI {
 
         continue_button = toolbar.add_button (null, _("C_ontinue"), false) as Gtk.Button;
         continue_button.use_underline = true;
+        // workaround for libgd bug #698289
+        continue_button.label = _("C_ontinue");
         continue_button.get_style_context ().add_class ("boxes-continue");
         continue_button.bind_property ("sensitive",
                                        continue_button, "has-focus",
@@ -675,6 +681,8 @@ private class Boxes.Wizard: Boxes.UI {
 
         create_button = toolbar.add_button (null, _("C_reate"), false) as Gtk.Button;
         create_button.use_underline = true;
+        // workaround for libgd bug #698289
+        create_button.label = _("C_reate");
         create_button.get_style_context ().add_class ("boxes-continue");
         create_button.bind_property ("sensitive",
                                      create_button, "has-focus",


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]