diff options
author | Gergely Polonkai <gergely@polonkai.eu> | 2014-07-23 09:18:03 +1200 |
---|---|---|
committer | Robert Ancell <robert.ancell@canonical.com> | 2014-07-23 09:18:03 +1200 |
commit | 936beb6ce07ceda9269cb02e1b92eb3dc57c3f14 (patch) | |
tree | 34d8f20822a9ee7be94e7f0bf7ac5f5ba10687eb | |
parent | 67df58aca6166498bfa5c04e024865cfd6d79c99 (diff) | |
download | dconf-936beb6ce07ceda9269cb02e1b92eb3dc57c3f14.tar.gz |
dconf-editor: Correct type text for floating point keys
We were previously showing the range for double keys as integers - correct to using double.
https://bugzilla.gnome.org/show_bug.cgi?id=733557
-rw-r--r-- | editor/dconf-editor.vala | 14 | ||||
-rw-r--r-- | editor/dconf-view.vala | 4 |
2 files changed, 17 insertions, 1 deletions
diff --git a/editor/dconf-editor.vala b/editor/dconf-editor.vala index 671b9b5..8174218 100644 --- a/editor/dconf-editor.vala +++ b/editor/dconf-editor.vala @@ -171,7 +171,6 @@ class ConfigurationEditor : Gtk.Application case "u": case "x": case "t": - case "d": Variant min, max; if (key.schema.range != null) { @@ -184,6 +183,19 @@ class ConfigurationEditor : Gtk.Application max = key.get_max(); } return _("Integer [%s..%s]").printf(min.print(false), max.print(false)); + case "d": + Variant min, max; + if (key.schema.range != null) + { + min = key.schema.range.min; + max = key.schema.range.max; + } + else + { + min = key.get_min(); + max = key.get_max(); + } + return _("Double [%s..%s]").printf(min.print(false), max.print(false)); case "b": return _("Boolean"); case "s": diff --git a/editor/dconf-view.vala b/editor/dconf-view.vala index f4d07d4..ac5303b 100644 --- a/editor/dconf-view.vala +++ b/editor/dconf-view.vala @@ -67,6 +67,10 @@ private class KeyValueRenderer: Gtk.CellRenderer } spin_renderer.adjustment = new Gtk.Adjustment(v, min, max, 1, 0, 0); spin_renderer.digits = 0; + if (key.type_string == "d") + { + spin_renderer.digits = 20; + } mode = Gtk.CellRendererMode.EDITABLE; break; default: |