summaryrefslogtreecommitdiff
path: root/libcaribou
diff options
context:
space:
mode:
authorRaphael Freudiger <laser_b@gmx.ch>2014-11-09 09:20:21 +0100
committerDaiki Ueno <dueno@src.gnome.org>2014-11-12 17:55:21 +0900
commit24338c010a358e6439d08d4592c0cf8130a04b11 (patch)
tree6246a5ccdcc640c077bfcdd5bf49ef7e3a9a5762 /libcaribou
parenta1d1c747673fddefcb51141883a039215b150803 (diff)
downloadcaribou-24338c010a358e6439d08d4592c0cf8130a04b11.tar.gz
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
Diffstat (limited to 'libcaribou')
-rw-r--r--libcaribou/key-model.vala2
-rw-r--r--libcaribou/xml-deserializer.vala3
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;