[dconf-editor] Use a separate icon and dismiss text when key is planned to be erased.
- From: Arnaud Bonatti <arnaudb src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [dconf-editor] Use a separate icon and dismiss text when key is planned to be erased.
- Date: Tue, 19 Jul 2016 23:43:40 +0000 (UTC)
commit f53b4353b0f1b2a92ac003f928ff6950abc1ebf4
Author: Arnaud Bonatti <arnaud bonatti gmail com>
Date: Wed Jul 20 01:43:31 2016 +0200
Use a separate icon and dismiss text when key is planned to be erased.
editor/dconf-editor.css | 6 ++----
editor/key-list-box-row.vala | 5 ++++-
editor/registry-view.vala | 22 ++++++++++++++++------
3 files changed, 22 insertions(+), 11 deletions(-)
---
diff --git a/editor/dconf-editor.css b/editor/dconf-editor.css
index d6ab463..7f46a37 100644
--- a/editor/dconf-editor.css
+++ b/editor/dconf-editor.css
@@ -88,10 +88,8 @@ window > popover.menu {
/* pending change icon */
.dconf-list > row > .key { transition:background-position 0.3s; }
- .dconf-list > row > .key.delayed {
- background-image:-gtk-icontheme("document-open-recent-symbolic");
- background-repeat:no-repeat;
- }
+ .dconf-list > row > .key.delayed {
background-image:-gtk-icontheme("document-open-recent-symbolic"); background-repeat:no-repeat; }
+ .dconf-list > row > .key.delayed.erase {
background-image:-gtk-icontheme("user-trash-symbolic"); }
.dconf-list > row > .key.delayed { background-size:16px;
transition:background-size 0.3s; }
.small-rows .dconf-list > row > .key.delayed { background-size:12px; }
diff --git a/editor/key-list-box-row.vala b/editor/key-list-box-row.vala
index 23f2309..7c9c8aa 100644
--- a/editor/key-list-box-row.vala
+++ b/editor/key-list-box-row.vala
@@ -216,7 +216,7 @@ private class KeyListBoxRowEditableNoSchema : KeyListBoxRow
if (key.planned_change)
{
popover.new_section ();
- popover.new_action ("dismiss", () => {
+ popover.new_action (key.planned_value == null ? "unerase" : "dismiss", () => {
destroy_popover ();
change_dismissed ();
});
@@ -392,6 +392,9 @@ private class ContextPopover : Popover
else if (action_action == "erase")
/* Translators: "erase key" action in the right-click menu on a key without schema */
current_section.append (_("Erase key"), group_dot_action);
+ else if (action_action == "unerase")
+ /* Translators: "dismiss change" action in the right-click menu on a key without schema planned
to be erased */
+ current_section.append (_("Do not erase"), group_dot_action);
else assert_not_reached ();
}
diff --git a/editor/registry-view.vala b/editor/registry-view.vala
index 473f8cf..818a848 100644
--- a/editor/registry-view.vala
+++ b/editor/registry-view.vala
@@ -213,11 +213,11 @@ class RegistryView : Grid
else
row = new KeyListBoxRowEditableNoSchema ((DConfKey) key);
- ((KeyListBoxRow) row).set_key_value.connect ((variant) => { set_key_value (key, variant); });
+ ((KeyListBoxRow) row).set_key_value.connect ((variant) => { set_key_value (key, variant);
set_delayed_icon (row, key); });
((KeyListBoxRow) row).change_dismissed.connect (() => { revealer.dismiss_change (key); });
- key.notify ["planned-change"].connect (() => { set_delayed_icon (row, key.planned_change); });
- set_delayed_icon (row, key.planned_change);
+ key.notify ["planned-change"].connect (() => { set_delayed_icon (row, key); });
+ set_delayed_icon (row, key);
row.on_row_clicked.connect (() => {
if (!properties_view.populate_properties_list_box (revealer, key)) // TODO unduplicate
@@ -232,10 +232,20 @@ class RegistryView : Grid
return row;
}
- private void set_delayed_icon (ClickableListBoxRow row, bool state)
+ private void set_delayed_icon (ClickableListBoxRow row, Key key)
{
- if (state)
- row.get_style_context ().add_class ("delayed");
+ if (key.planned_change)
+ {
+ StyleContext context = row.get_style_context ();
+ context.add_class ("delayed");
+ if (!key.has_schema)
+ {
+ if (key.planned_value == null)
+ context.add_class ("erase");
+ else
+ context.remove_class ("erase");
+ }
+ }
else
row.get_style_context ().remove_class ("delayed");
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]