[polari/wip/fmuellner/debug-instance: 5/5] window: Differentiate test instances from normal ones



commit aaec4eea5e03af3de5a489a8e76594a386bcd8e7
Author: Florian Müllner <fmuellner gnome org>
Date:   Thu Mar 23 02:20:55 2017 +0100

    window: Differentiate test instances from normal ones
    
    When running a test instance alongside the regular Polari instance,
    it is easy to lose track of which is the temporary one. Address this
    by adding some subtle styling hints in the test instance's title bar.
    
    Fixes https://gitlab.gnome.org/GNOME/polari/issues/24

 data/resources/application.css | 9 +++++++++
 src/mainWindow.js              | 3 +++
 2 files changed, 12 insertions(+)
---
diff --git a/data/resources/application.css b/data/resources/application.css
index a5170e1..6c0f72f 100644
--- a/data/resources/application.css
+++ b/data/resources/application.css
@@ -206,3 +206,12 @@ treeview.polari-server-room-list {
 .polari-room-loading {
     opacity: 0.3;
 }
+
+/* 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-repeat: no-repeat;
+    background-position: 1em center;
+    background-size: 4em;
+}
diff --git a/src/mainWindow.js b/src/mainWindow.js
index b03a7e6..9fc14dc 100644
--- a/src/mainWindow.js
+++ b/src/mainWindow.js
@@ -137,6 +137,9 @@ var MainWindow = GObject.registerClass({
         this._overlay.add_overlay(app.notificationQueue);
         this._overlay.add_overlay(app.commandOutputQueue);
 
+        if (app.isTestInstance)
+            this.get_style_context().add_class('test-instance');
+
         // command output notifications should not pop up over
         // the input area, but appear to emerge from it, so
         // set up an appropriate margin


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