[polari/wip/fmuellner/ci-snapshots: 8/9] window: Add a visual hint when running a snapshot build



commit c4ebeda270d366767bc66fcaf254207fa2768fd0
Author: Florian Müllner <fmuellner gnome org>
Date:   Mon Jul 30 03:15:52 2018 +0200

    window: Add a visual hint when running a snapshot build
    
    As outlined in the DevOps-with-Flatpak initiative[0], it is important
    that development versions are instantly recognizable as such, similar
    to the style hint for test instance we added in commit aaec4ee.
    
    However the existing hint is only added when a test instance is actually
    running along-side a regular one, so it is not enough to identify a
    snapshot build in all cases.
    
    For that, add a different visual hint for snapshots and make sure it
    complements the existing hint if both are applied.
    
    [0] https://gitlab.gnome.org/GNOME/Initiatives/wikis/DevOps-with-Flatpak
    
    https://gitlab.gnome.org/GNOME/polari/issues/61

 data/resources/application.css | 12 ++++++++++--
 src/mainWindow.js              |  2 ++
 2 files changed, 12 insertions(+), 2 deletions(-)
---
diff --git a/data/resources/application.css b/data/resources/application.css
index 6c0f72f..3af920d 100644
--- a/data/resources/application.css
+++ b/data/resources/application.css
@@ -209,9 +209,17 @@ treeview.polari-server-room-list {
 
 /* Differentiate test instance from "normal" ones */
 window.test-instance headerbar:last-child {
-    background-image: -gtk-icontheme('system-run-symbolic');
-    background-blend-mode: color-burn;
+    background-image: cross-fade(25% -gtk-icontheme('system-run-symbolic'));
     background-repeat: no-repeat;
     background-position: 1em center;
     background-size: 4em;
 }
+
+/* Differentiate snapshot builds from regular ones */
+window.snapshot headerbar { background: none; }
+window.snapshot .titlebar {
+    background: linear-gradient(to left, #a5b1bd 0%, #a5b1bd 8%, @theme_bg_color 25%);
+    box-shadow: inset 0 1px #f1f3f5;
+    border-color: #909fae;
+    color: alpha(@theme_fg_color, 0.4);
+}
diff --git a/src/mainWindow.js b/src/mainWindow.js
index f5d8797..b5a8036 100644
--- a/src/mainWindow.js
+++ b/src/mainWindow.js
@@ -134,6 +134,8 @@ var MainWindow = GObject.registerClass({
 
         if (app.isTestInstance)
             this.get_style_context().add_class('test-instance');
+        if (GLib.get_application_name().toLowerCase().includes('snapshot'))
+            this.get_style_context().add_class('snapshot');
 
         // command output notifications should not pop up over
         // the input area, but appear to emerge from it, so


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