From 887bce811048e60a76e3da2f17346f216d4ad5e7 Mon Sep 17 00:00:00 2001 From: jderose9 Date: Wed, 15 Feb 2017 22:34:50 -0500 Subject: [PATCH] Add highlight for focused application icon --- Makefile | 6 +- img/focused_multi_bg.svg | 163 ++++++++++++++++++++++++++++++++ img/focused_multi_running.svg | 155 ++++++++++++++++++++++++++++++ img/focused_single_bg.svg | 147 ++++++++++++++++++++++++++++ img/unfocused_multi_running.svg | 155 ++++++++++++++++++++++++++++++ taskbar.js | 20 +++- 6 files changed, 642 insertions(+), 4 deletions(-) create mode 100644 img/focused_multi_bg.svg create mode 100644 img/focused_multi_running.svg create mode 100644 img/focused_single_bg.svg create mode 100644 img/unfocused_multi_running.svg diff --git a/Makefile b/Makefile index 3a47bb2..66b5d39 100644 --- a/Makefile +++ b/Makefile @@ -3,7 +3,7 @@ UUID = dash-to-panel@jderose9.github.com BASE_MODULES = extension.js stylesheet.css metadata.json COPYING README.md EXTRA_MODULES = convenience.js panel.js panelStyle.js overview.js taskbar.js secondaryMenu.js windowPreview.js prefs.js Settings.ui -#EXTRA_MEDIA = logo.svg +EXTRA_IMAGES = focused_multi_bg.svg focused_single_bg.svg focused_multi_running.svg unfocused_multi_running.svg TOLOCALIZE = prefs.js MSGSRC = $(wildcard po/*.po) ifeq ($(strip $(DESTDIR)),) @@ -69,8 +69,8 @@ _build: all -rm -fR ./_build mkdir -p _build cp $(BASE_MODULES) $(EXTRA_MODULES) _build - #mkdir -p _build/media - #cd media ; cp $(EXTRA_MEDIA) ../_build/media/ + mkdir -p _build/img + cd img ; cp $(EXTRA_IMAGES) ../_build/img/ mkdir -p _build/schemas cp schemas/*.xml _build/schemas/ cp schemas/gschemas.compiled _build/schemas/ diff --git a/img/focused_multi_bg.svg b/img/focused_multi_bg.svg new file mode 100644 index 0000000..87a04e8 --- /dev/null +++ b/img/focused_multi_bg.svg @@ -0,0 +1,163 @@ + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + diff --git a/img/focused_multi_running.svg b/img/focused_multi_running.svg new file mode 100644 index 0000000..1b6e9d2 --- /dev/null +++ b/img/focused_multi_running.svg @@ -0,0 +1,155 @@ + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + diff --git a/img/focused_single_bg.svg b/img/focused_single_bg.svg new file mode 100644 index 0000000..a003ea0 --- /dev/null +++ b/img/focused_single_bg.svg @@ -0,0 +1,147 @@ + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + diff --git a/img/unfocused_multi_running.svg b/img/unfocused_multi_running.svg new file mode 100644 index 0000000..8b796fc --- /dev/null +++ b/img/unfocused_multi_running.svg @@ -0,0 +1,155 @@ + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + diff --git a/taskbar.js b/taskbar.js index 7395e90..657edfa 100644 --- a/taskbar.js +++ b/taskbar.js @@ -1404,9 +1404,25 @@ const taskbarAppIcon = new Lang.Class({ }, _onFocusAppChanged: function() { + if(this._nWindows > 1) + this._dot.set_style("background-image: url('" + + Me.path + + "/img/" + + (tracker.focus_app == this.app ? "focused" : "unfocused") + + "_multi_running.svg'); background-size: 48px 3px;"); + else + this._dot.set_style(""); + if(tracker.focus_app == this.app) { this._dot.opacity = 255; this.actor.add_style_class_name('focused'); + + this.actor.set_style("background-image: url('" + + Me.path + + "/img/focused_" + + (this._nWindows > 1 ? "multi" : "single") + + "_bg.svg'); background-position: 0 0; background-size: 48px 45px;"); + Tweener.addTween(this._dot, { width: this._iconContainer.get_width(), height: RUNNING_INDICATOR_SIZE, @@ -1417,10 +1433,12 @@ const taskbarAppIcon = new Lang.Class({ { opacity: 0, time: DASH_ANIMATION_TIME, transition: 'easeInOutCubic', - }); + }); } else { this._dot.opacity = 255; this.actor.remove_style_class_name('focused'); + this.actor.set_style(""); + Tweener.addTween(this._dot, { width: 0, height: RUNNING_INDICATOR_SIZE,