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



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

    window: Differentiate debug instances from normal ones
    
    When running a debug 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 debug instance's title bar.

 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 30474c5..c86867b 100644
--- a/data/resources/application.css
+++ b/data/resources/application.css
@@ -202,3 +202,12 @@ treeview.polari-server-room-list {
 /* tweak labels in the user popover */
 .polari-user-popover-nick { font-weight: bold; }
 .polari-user-popover-status { font-size: smaller; }
+
+/* Differentiate debug instance from "normal" ones */
+window.debug headerbar:last-child {
+    background-image: -gtk-icontheme('dialog-warning-symbolic');
+    background-blend-mode: overlay;
+    background-repeat: no-repeat;
+    background-position: 1em center;
+    background-size: 6em;
+}
diff --git a/src/mainWindow.js b/src/mainWindow.js
index c59a3c3..1b95e38 100644
--- a/src/mainWindow.js
+++ b/src/mainWindow.js
@@ -139,6 +139,9 @@ var MainWindow = GObject.registerClass({
         this._overlay.add_overlay(app.notificationQueue);
         this._overlay.add_overlay(app.commandOutputQueue);
 
+        if (app.isDebugInstance)
+            this.get_style_context().add_class('debug');
+
         // 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]