[dconf-editor] Do not write key value in bold.
- From: Arnaud Bonatti <arnaudb src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [dconf-editor] Do not write key value in bold.
- Date: Wed, 13 Dec 2017 18:34:04 +0000 (UTC)
commit 5f65e434a734d320ba6dbe033dad78b56a2b0eb6
Author: Arnaud Bonatti <arnaud bonatti gmail com>
Date: Wed Dec 13 19:31:14 2017 +0100
Do not write key value in bold.
editor/dconf-editor.css | 9 +++++----
editor/key-list-box-row.ui | 3 +++
editor/key-list-box-row.vala | 24 +-----------------------
3 files changed, 9 insertions(+), 27 deletions(-)
---
diff --git a/editor/dconf-editor.css b/editor/dconf-editor.css
index 1cf1858..86cba3a 100644
--- a/editor/dconf-editor.css
+++ b/editor/dconf-editor.css
@@ -151,6 +151,11 @@
.keys-list > row > .erase.dconf-key.key.delayed {
background-image:-gtk-icontheme("user-trash-symbolic"); }
.keys-list > row > .erase.dconf-key.key {
background-image:-gtk-icontheme("action-unavailable-symbolic"); }
+.keys-list > row > .erase.dconf-key.key label.key-value { font-style:italic; }
+
+.keys-list > row > :not(erase).dconf-key.key label.key-name,
+.keys-list > row > .edited.gsettings-key.key label.key-name { font-weight:bold; }
+
/*\
* * pathbar
\*/
@@ -290,10 +295,6 @@
font-style:italic;
}
-.bold-label {
- font-weight:bold;
-}
-
.greyed-label {
color:@theme_fg_color;
}
diff --git a/editor/key-list-box-row.ui b/editor/key-list-box-row.ui
index df5ae0a..77c52a1 100644
--- a/editor/key-list-box-row.ui
+++ b/editor/key-list-box-row.ui
@@ -59,6 +59,9 @@
<property name="lines">3</property>
<property name="ellipsize">end</property>
<property name="single-line-mode">True</property>
+ <style>
+ <class name="key-value"/>
+ </style>
</object>
<packing>
<property name="left-attach">1</property>
diff --git a/editor/key-list-box-row.vala b/editor/key-list-box-row.vala
index 5243f42..1f94c17 100644
--- a/editor/key-list-box-row.vala
+++ b/editor/key-list-box-row.vala
@@ -214,9 +214,6 @@ private abstract class KeyListBoxRow : ClickableListBoxRow
}
}
- protected StyleContext name_context;
- protected StyleContext value_context;
-
public signal void set_key_value (Variant? new_value);
public signal void change_dismissed ();
@@ -227,9 +224,6 @@ private abstract class KeyListBoxRow : ClickableListBoxRow
construct
{
- name_context = key_name_label.get_style_context ();
- value_context = key_value_label.get_style_context ();
-
if (abstract_key.type_string == "b") // TODO not with “always delay” behaviour, nor in “delay
mode”
{
boolean_switch = new Switch ();
@@ -317,11 +311,7 @@ private class KeyListBoxRowEditableNoSchema : KeyListBoxRow
((!) boolean_switch).hide ();
key_value_label.show ();
}
- if (!value_context.has_class ("italic-label")) value_context.add_class ("italic-label");
- if (value_context.has_class ("bold-label")) value_context.remove_class ("bold-label");
key_value_label.set_label (_("Key erased."));
-
- if (name_context.has_class ("bold-label")) name_context.remove_class ("bold-label");
}
else
{
@@ -331,11 +321,7 @@ private class KeyListBoxRowEditableNoSchema : KeyListBoxRow
((!) boolean_switch).show ();
((!) boolean_switch).set_active (key.value.get_boolean ());
}
- if (value_context.has_class ("italic-label")) value_context.remove_class ("italic-label");
- if (!value_context.has_class ("bold-label")) value_context.add_class ("bold-label");
key_value_label.set_label (cool_text_value (key));
-
- if (!name_context.has_class ("bold-label")) name_context.add_class ("bold-label");
}
}
@@ -462,21 +448,13 @@ private class KeyListBoxRowEditable : KeyListBoxRow
((!) boolean_switch).set_active (boolean);
}
}
+
StyleContext css_context = get_style_context ();
if (key.is_default)
- {
css_context.remove_class ("edited");
-
- if (name_context.has_class ("bold-label")) name_context.remove_class ("bold-label");
- if (value_context.has_class ("bold-label")) value_context.remove_class ("bold-label");
- }
else
- {
css_context.add_class ("edited");
- if (!name_context.has_class ("bold-label")) name_context.add_class ("bold-label");
- if (!value_context.has_class ("bold-label")) value_context.add_class ("bold-label");
- }
key_value_label.set_label (cool_text_value (key));
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]