[dconf] Show non-defaults in bold
- From: Robert Ancell <rancell src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [dconf] Show non-defaults in bold
- Date: Wed, 7 Jul 2010 08:12:06 +0000 (UTC)
commit 4c80195aec565788cfa08767108235a44290af50
Author: Robert Ancell <robert ancell gmail com>
Date: Wed Jul 7 18:11:58 2010 +1000
Show non-defaults in bold
editor/dconf-model.vala | 24 ++++++++++++++++++++----
editor/dconf-view.vala | 2 +-
2 files changed, 21 insertions(+), 5 deletions(-)
---
diff --git a/editor/dconf-model.vala b/editor/dconf-model.vala
index fabc1c7..42f5b3a 100644
--- a/editor/dconf-model.vala
+++ b/editor/dconf-model.vala
@@ -58,6 +58,12 @@ public class Key : GLib.Object
}
}
}
+
+ public bool is_default
+ {
+ private set {}
+ public get { update_value(); return _value == null; }
+ }
public Key(SettingsModel model, Directory parent, int index, string name, string full_name)
{
@@ -247,10 +253,20 @@ public class KeyModel: GLib.Object, Gtk.TreeModel/*, Gtk.TreeSortable*/
value = key;
else if (column == 1)
value = key.name;
- else if (key.value != null)
- value = key.value.print(false);
- else
- value = "";
+ else if (column == 2)
+ {
+ if (key.value != null)
+ value = key.value.print(false);
+ else
+ value = "";
+ }
+ else if (column == 4)
+ {
+ if (key.is_default)
+ value = Pango.Weight.NORMAL;
+ else
+ value = Pango.Weight.BOLD;
+ }
}
public bool iter_next(ref Gtk.TreeIter iter)
diff --git a/editor/dconf-view.vala b/editor/dconf-view.vala
index 5c9ff19..1d6e388 100644
--- a/editor/dconf-view.vala
+++ b/editor/dconf-view.vala
@@ -247,7 +247,7 @@ public class DConfKeyView : Gtk.TreeView
{
public DConfKeyView()
{
- var column = new Gtk.TreeViewColumn.with_attributes("Name", new Gtk.CellRendererText(), "text", 1, null);
+ var column = new Gtk.TreeViewColumn.with_attributes("Name", new Gtk.CellRendererText(), "text", 1, "weight", 4, null);
/*column.set_sort_column_id(1);*/
append_column(column);
insert_column_with_attributes(-1, "Value", new KeyValueRenderer(this), "key", 0, null);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]