From f5cd4acc0e2e7e79225c478c8048954b3183441d Mon Sep 17 00:00:00 2001 From: jderose9 Date: Mon, 20 Feb 2017 22:30:08 -0500 Subject: [PATCH] rename indicator style and images --- Makefile | 2 +- Settings.ui | 8 ++--- ...focused_single_bg.svg => highlight_bg.svg} | 0 ..._multi_bg.svg => highlight_stacked_bg.svg} | 0 prefs.js | 5 ---- ...shell.extensions.dash-to-panel.gschema.xml | 11 ++----- taskbar.js | 29 ++++++++++++------- 7 files changed, 27 insertions(+), 28 deletions(-) rename img/{focused_single_bg.svg => highlight_bg.svg} (100%) rename img/{focused_multi_bg.svg => highlight_stacked_bg.svg} (100%) diff --git a/Makefile b/Makefile index 47037df..a91d6cb 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_IMAGES = focused_multi_bg.svg focused_single_bg.svg +EXTRA_IMAGES = highlight_bg.svg highlight_stacked_bg.svg TOLOCALIZE = prefs.js MSGSRC = $(wildcard po/*.po) ifeq ($(strip $(DESTDIR)),) diff --git a/Settings.ui b/Settings.ui index 1c3f276..aba0a96 100644 --- a/Settings.ui +++ b/Settings.ui @@ -1352,9 +1352,9 @@ Squares Dashes Segmented - Dotted - Metro Solid + Ciliora + Metro @@ -1413,9 +1413,9 @@ Squares Dashes Segmented - Dotted - Metro Solid + Ciliora + Metro diff --git a/img/focused_single_bg.svg b/img/highlight_bg.svg similarity index 100% rename from img/focused_single_bg.svg rename to img/highlight_bg.svg diff --git a/img/focused_multi_bg.svg b/img/highlight_stacked_bg.svg similarity index 100% rename from img/focused_multi_bg.svg rename to img/highlight_stacked_bg.svg diff --git a/prefs.js b/prefs.js index 5203ed4..8fd36e6 100644 --- a/prefs.js +++ b/prefs.js @@ -222,10 +222,6 @@ const Settings = new Lang.Class({ this._builder.get_object('focus_highlight_switch'), 'active', Gio.SettingsBindFlags.DEFAULT); - this._settings.bind('dot-stacked', - this._builder.get_object('dot_stacked_switch'), - 'active', - Gio.SettingsBindFlags.DEFAULT); this._builder.get_object('dot_size_spinbutton').set_value(this._settings.get_int('dot-size')); this._builder.get_object('dot_size_spinbutton').connect('value-changed', Lang.bind (this, function(widget) { @@ -248,7 +244,6 @@ const Settings = new Lang.Class({ this._builder.get_object('dot_size_spinbutton').set_value(this._settings.get_int('dot-size')); this._settings.set_value('focus-highlight', this._settings.get_default_value('focus-highlight')); - this._settings.set_value('dot-stacked', this._settings.get_default_value('dot-stacked')); } else { // remove the settings box so it doesn't get destroyed; diff --git a/schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml b/schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml index a78ba23..003e879 100644 --- a/schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml +++ b/schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml @@ -5,9 +5,9 @@ - - - + + + @@ -97,11 +97,6 @@ Highlight icon of focused application Whether to highlight the background of the currently focused application's icon - - true - Stacked appearance for indicator - Whether to give a stacked appearance to indicator and highlight of applications with multiple windows open - 'STATUSLEFT' Location of the clock diff --git a/taskbar.js b/taskbar.js index d5cf0ab..2eeb540 100644 --- a/taskbar.js +++ b/taskbar.js @@ -61,11 +61,16 @@ let DOT_STYLE = { SQUARES: "SQUARES", DASHES: "DASHES", SEGMENTED: "SEGMENTED", - DOTTED: "DOTTED", + CILIORA: "CILIORA", METRO: "METRO", SOLID: "SOLID" } +let DOT_POSITION = { + TOP: "TOP", + BOTTOM: "BOTTOM" +} + function getPosition() { return Main.layoutManager.panelBox.anchor_y == 0 ? St.Side.TOP : St.Side.BOTTOM; } @@ -1266,7 +1271,6 @@ const taskbarAppIcon = new Lang.Class({ this._dtpSettings.connect('changed::dot-color-3', Lang.bind(this, this._settingsChangeRefresh)); this._dtpSettings.connect('changed::dot-color-4', Lang.bind(this, this._settingsChangeRefresh)); this._dtpSettings.connect('changed::focus-highlight', Lang.bind(this, this._settingsChangeRefresh)); - this._dtpSettings.connect('changed::dot-stacked', Lang.bind(this, this._settingsChangeRefresh)); this._dtpSettings.connect('changed::appicon-margin', Lang.bind(this, this._setIconStyle)); @@ -1392,14 +1396,19 @@ const taskbarAppIcon = new Lang.Class({ if(this._dtpSettings.get_boolean('focus-highlight') && tracker.focus_app == this.app && !this._isThemeProvidingIndicator()) { let containerWidth = this._iconContainer.get_width(); + let focusedDotStyle = this._dtpSettings.get_string('dot-style-focused'); + let isWide = this._isWideDotStyle(focusedDotStyle); + let pos = this._dtpSettings.get_string('dot-position'); + let size = this._dtpSettings.get_int('dot-size'); + inlineStyle += "background-image: url('" + - Me.path + "/img/focused_" + - ((this._nWindows > 1 && this._dtpSettings.get_boolean('dot-stacked')) ? "multi" : "single") + - "_bg.svg'); background-position: 0 " + - ((this._isWideDotStyle(this._dtpSettings.get_string('dot-style-focused')) && this._dtpSettings.get_string('dot-position') == "TOP") ? this._dtpSettings.get_int('dot-size') : 0) + + Me.path + "/img/highlight_" + + ((this._nWindows > 1 && focusedDotStyle == DOT_STYLE.METRO) ? "stacked_" : "") + + "bg.svg'); background-position: 0 " + + ((isWide && pos == DOT_POSITION.TOP) ? size : 0) + "px; background-size: " + containerWidth + "px " + - (containerWidth - ((this._isWideDotStyle(this._dtpSettings.get_string('dot-style-focused')) && this._dtpSettings.get_string('dot-position') == "BOTTOM") ? this._dtpSettings.get_int('dot-size') : this._dtpSettings.get_int('dot-size'))) + "px;" + (containerWidth - ((isWide && pos == DOT_POSITION.BOTTOM) ? size : 0)) + "px;"; } // graphical glitches if i dont set this on a timeout @@ -1519,7 +1528,7 @@ const taskbarAppIcon = new Lang.Class({ _isWideDotStyle: function(dotStyle) { return dotStyle == DOT_STYLE.SEGMENTED || - dotStyle == DOT_STYLE.DOTTED || + dotStyle == DOT_STYLE.CILIORA || dotStyle == DOT_STYLE.METRO || dotStyle == DOT_STYLE.SOLID; }, @@ -1675,7 +1684,7 @@ const taskbarAppIcon = new Lang.Class({ let n = this._nWindows; let size = this._dtpSettings.get_int('dot-size'); let padding = 0; // distance from the margin - let yOffset = this._dtpSettings.get_string('dot-position') == "TOP" ? 0 : (height - padding - size); + let yOffset = this._dtpSettings.get_string('dot-position') == DOT_POSITION.TOP ? 0 : (height - padding - size); if(type == DOT_STYLE.DOTS) { // Draw the required numbers of dots @@ -1725,7 +1734,7 @@ const taskbarAppIcon = new Lang.Class({ cr.rectangle(i*dashLength + i*spacing, 0, dashLength, size); } cr.fill(); - } else if (type == DOT_STYLE.DOTTED) { + } else if (type == DOT_STYLE.CILIORA) { let spacing = size; // separation between the dots let lineLength = width - (size*(n-1)) - (spacing*(n-1));