From b08c7cdf4134f2be14ef8242b6951e36d9ed5923 Mon Sep 17 00:00:00 2001 From: jderose9 Date: Fri, 30 Dec 2016 18:24:22 -0500 Subject: [PATCH] running indicators configure top/bottom --- Settings.ui | 134 ++++++++++++++---- prefs.js | 23 +++ ...shell.extensions.dash-to-panel.gschema.xml | 9 ++ taskbar.js | 9 +- 4 files changed, 147 insertions(+), 28 deletions(-) diff --git a/Settings.ui b/Settings.ui index 9e78af2..421317f 100644 --- a/Settings.ui +++ b/Settings.ui @@ -314,7 +314,7 @@ True False True - Position on screen + Panel screen position 0 @@ -377,29 +377,6 @@ - - - - - - - - False - True - 0 - - - - - True - False - 0 - in - - - True - False - none 100 @@ -409,8 +386,6 @@ True False - 12 - 12 12 12 32 @@ -454,6 +429,111 @@ + + False + True + 0 + + + + + True + False + 0 + in + + + True + False + none + + + 100 + 80 + True + True + + + True + False + 12 + 12 + 32 + + + True + False + True + Running indicator (dots) position + 0 + + + False + True + 0 + + + + + True + False + 32 + + + Bottom + True + True + False + center + center + 0 + True + True + + + + False + True + 1 + + + + + Top + True + True + False + center + center + 0 + bottom + True + dots_bottom_button + + + + False + True + 2 + + + + + False + True + 1 + + + + + + + + + + + + False True @@ -533,7 +613,7 @@ - + True False Position and size diff --git a/prefs.js b/prefs.js index 5447a49..3b253c6 100644 --- a/prefs.js +++ b/prefs.js @@ -108,6 +108,19 @@ const Settings = new Lang.Class({ panel_size_scale.set_inverted(true); } + // Dots Position option + let dotPosition = this._settings.get_string('dot-position'); + + switch (dotPosition) { + case 'BOTTOM': + this._builder.get_object('dots_bottom_button').set_active(true); + break; + case 'TOP': + this._builder.get_object('dots_top_button').set_active(true); + break; + + } + // Behavior panel this._settings.bind('show-show-apps-button', @@ -237,6 +250,16 @@ const Settings = new Lang.Class({ position_top_button_toggled_cb: function(button) { if (button.get_active()) this._settings.set_string('panel-position', "TOP"); + }, + + dots_bottom_button_toggled_cb: function(button) { + if (button.get_active()) + this._settings.set_string('dot-position', "BOTTOM"); + }, + + dots_top_button_toggled_cb: function(button) { + if (button.get_active()) + this._settings.set_string('dot-position', "TOP"); }, panel_size_scale_format_value_cb: function(scale, value) { 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 8f22161..ef07a6f 100644 --- a/schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml +++ b/schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml @@ -19,6 +19,10 @@ + + + + 'BOTTOM' @@ -30,6 +34,11 @@ Panel size Set the size of the panel. + + 'BOTTOM' + Dot position + Running indicators are shown on the Bottom or Top of the screen. + 'STATUSRIGHT' Location of the clock diff --git a/taskbar.js b/taskbar.js index 5efc1b8..aa89920 100644 --- a/taskbar.js +++ b/taskbar.js @@ -1180,6 +1180,8 @@ const taskbarAppIcon = new Lang.Class({ this._dots = null; + this._dtpSettings.connect('changed::dot-position', Lang.bind(this, this._showDots)); + this._showDots(); // Creating a new menu manager for window previews as adding it to the @@ -1440,6 +1442,11 @@ const taskbarAppIcon = new Lang.Class({ _updateCounterClass: function() { + if(this._dtpSettings.get_string('dot-position') == "TOP") + this._dot.set_y_align(Clutter.ActorAlign.START); + else + this._dot.set_y_align(Clutter.ActorAlign.END); + let maxN = 4; this._nWindows = Math.min(getAppInterestingWindows(this.app).length, maxN); @@ -1472,7 +1479,7 @@ const taskbarAppIcon = new Lang.Class({ Clutter.cairo_set_source_color(cr, bodyColor); - cr.translate((width - (2*n)*radius - (n-1)*spacing)/2, height- padding- 2*radius); + cr.translate((width - (2*n)*radius - (n-1)*spacing)/2, this._dtpSettings.get_string('dot-position') == "TOP" ? 0 : (height- padding- 2*radius)); for (let i = 0; i < n; i++) { cr.newSubPath(); cr.arc((2*i+1)*radius + i*spacing, radius, radius, 0, 2*Math.PI);