[caribou] Allow to overwrite the label in the keyboard layout.



commit 24338c010a358e6439d08d4592c0cf8130a04b11
Author: Raphael Freudiger <laser_b gmx ch>
Date:   Sun Nov 9 09:20:21 2014 +0100

    Allow to overwrite the label in the keyboard layout.
    
    Currently some buttons do only have its name as label.
    This is not always useful. I.e. for the dead-keys the label is often only "dead".
    In some keyboard layout it is preferred to have a symbol as label.
    
    This allows to overwrite the default label in the keyboard layout.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=739837

 libcaribou/key-model.vala        |    2 +-
 libcaribou/xml-deserializer.vala |    3 +++
 2 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/libcaribou/key-model.vala b/libcaribou/key-model.vala
index 0005ba7..89015bc 100644
--- a/libcaribou/key-model.vala
+++ b/libcaribou/key-model.vala
@@ -26,7 +26,7 @@ namespace Caribou {
         public uint keyval { get; private set; }
         public string? text { get; private construct set; default = null; }
         private uint[] _keyvals = {};
-        public string label { get; private set; default = ""; }
+        public string label { get; set; default = ""; }
 
         public bool scan_stepping { get; internal set; }
         private bool _scan_selected;
diff --git a/libcaribou/xml-deserializer.vala b/libcaribou/xml-deserializer.vala
index e5a3239..3e4cfe3 100644
--- a/libcaribou/xml-deserializer.vala
+++ b/libcaribou/xml-deserializer.vala
@@ -147,8 +147,11 @@ namespace Caribou {
             assert (name != null);
 
             string? text = node->get_prop ("text");
+            string? label_override = node->get_prop ("label");
 
             KeyModel key = new KeyModel (name, text);
+            if (label_override != null)
+                key.label = label_override;
 
             if (align != null)
                 key.align = align;


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