[gnome-clocks] world-row: Set opacity to 0 for current location



commit 138d9a94b7959c31e6d965a0e6c9f0ac1ceb46da
Author: Maximiliano Sandoval R <msandova gnome org>
Date:   Tue Dec 14 20:20:53 2021 +0100

    world-row: Set opacity to 0 for current location

 data/css/gnome-clocks.css | 4 ++++
 src/world-row.vala        | 9 ++++++---
 2 files changed, 10 insertions(+), 3 deletions(-)
---
diff --git a/data/css/gnome-clocks.css b/data/css/gnome-clocks.css
index 0815ba5a..d4186510 100644
--- a/data/css/gnome-clocks.css
+++ b/data/css/gnome-clocks.css
@@ -121,6 +121,10 @@
        font-weight: bolder;
 }
 
+.hidden {
+       opacity: 0;
+}
+
 .clock-time {
        font-size: 2em;
        padding: 0.2em 0.5em;
diff --git a/src/world-row.vala b/src/world-row.vala
index a3f078bf..87240090 100644
--- a/src/world-row.vala
+++ b/src/world-row.vala
@@ -51,14 +51,17 @@ private class Row : Adw.ActionRow {
 
         if (location.day_label != null && location.day_label != "") {
             subtitle = "%s • %s".printf ((string) location.day_label, message);
-            delete_button.show ();
+            delete_button.sensitive = true;
+            delete_button.remove_css_class ("hidden");
         } else if (location.automatic) {
             // Translators: This clock represents the local time
             subtitle = _("Current location");
-            delete_button.hide ();
+            delete_button.sensitive = false;
+            delete_button.add_css_class ("hidden");
         } else {
             subtitle = "%s".printf (message);
-            delete_button.show ();
+            delete_button.sensitive = true;
+            delete_button.remove_css_class ("hidden");
         }
 
         time_label.label = location.time_label;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]