From af409c37d4ba1f4f5c42369cc2ce699dc59bca59 Mon Sep 17 00:00:00 2001 From: John Horan Date: Wed, 11 May 2016 18:42:39 +0100 Subject: [PATCH] labels that can be used to switch to applications now highlight when hovered, ones that don't have a known window, don't highlight --- src/streamMenu.js | 14 +++++++++++++- src/stylesheet.css | 13 +++++++++++-- 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/src/streamMenu.js b/src/streamMenu.js index 50254f1..8b0ef0b 100644 --- a/src/streamMenu.js +++ b/src/streamMenu.js @@ -186,7 +186,8 @@ const StreamBase = new Lang.Class({ this._paPath = null; this._parent = parent; - this._label = new St.Label({style_class: 'simple-stream-label', reactive: true}) + this._label = new St.Label({style_class: 'simple-stream-label', + reactive: true, track_hover:true}); this._muteBtn = new St.Button(); this._volSlider = new Slider.Slider(0); @@ -363,6 +364,7 @@ const SimpleStream = new Lang.Class({ icon = new St.Icon({style_class: 'icon'}); icon.set_gicon(info.get_icon()); } + this._label.add_style_pseudo_class('clickable'); } if(name == null){ @@ -556,6 +558,7 @@ const MPRISStream = new Lang.Class({ this._mediaLength = 0; this._sigFVol = this._sigFMute = -1; this.actor.add_style_class_name("mpris-stream"); + this._label.add_style_pseudo_class('clickable'); this.unsetPAStream(); @@ -681,11 +684,20 @@ const MPRISStream = new Lang.Class({ this._posSlider.actor.connect('notify::hover', Lang.bind(this, function(){ this._setFocused(this._posSlider.actor.hover, 'active-bottom'); })); + this._label.connect('notify::hover', Lang.bind(this, function(){ + this._setFocused(this._label.hover, 'active-top'); + })); + + this._muteBtn.set_track_hover(true); + this._muteBtn.connect('notify::hover', Lang.bind(this, function(){ + this._setFocused(this._muteBtn.hover, 'active-top'); + })); this._volSlider.actor.connect('key-focus-in', Lang.bind(this, function(){ this._setFocused(true, 'active-top'); })); this._volSlider.actor.connect('key-focus-out', Lang.bind(this, function(){ this._setFocused(false, 'active-top'); })); this._posSlider.actor.connect('key-focus-in', Lang.bind(this, function(){ this._setFocused(true, 'active-bottom'); })); this._posSlider.actor.connect('key-focus-out', Lang.bind(this, function(){ this._setFocused(false, 'active-bottom'); })); + }, _setFocused: function(activate, type){ diff --git a/src/stylesheet.css b/src/stylesheet.css index fe7622d..2dcf1c2 100644 --- a/src/stylesheet.css +++ b/src/stylesheet.css @@ -24,6 +24,15 @@ spacing:2px; } + +.simple-stream-label{ + color:lightgray; +} + +.simple-stream-label:hover:clickable { + color:white; +} + .solitary .stream_container, .stream_container:empty{ margin-bottom:0px; @@ -155,7 +164,7 @@ .mpris-stream:active-top{ background-gradient-start: rgba(74,80,80,1); - background-gradient-end: rgba(74,80,80,0); + background-gradient-end: rgba(74,80,80,0.3); background-gradient-direction: vertical; } @@ -164,7 +173,7 @@ } .mpris-stream:active-bottom{ - background-gradient-start: rgba(74,80,80,0); + background-gradient-start: rgba(74,80,80,0.3); background-gradient-end: rgba(74,80,80,1); background-gradient-direction: vertical; }