diff --git a/Settings.ui b/Settings.ui index 8e8ca2c..79b221b 100644 --- a/Settings.ui +++ b/Settings.ui @@ -4064,6 +4064,7 @@ 12 12 12 + 4 32 @@ -4093,6 +4094,60 @@ 0 + + + True + False + True + Override Show Desktop line color + 0 + + + 0 + 1 + + + + + True + False + 12 + end + + + True + True + True + end + True + True + + + False + True + 0 + + + + + True + True + end + center + + + False + True + 1 + + + + + 1 + 0 + 1 + + diff --git a/panel.js b/panel.js index fe0b991..5ab395d 100644 --- a/panel.js +++ b/panel.js @@ -666,6 +666,8 @@ var dtpPanel = Utils.defineClass({ [ 'changed::showdesktop-button-width', 'changed::trans-use-custom-bg', + 'changed::desktop-line-use-custom-color', + 'changed::desktop-line-custom-color', 'changed::trans-bg-color' ], () => this._setShowDesktopButtonStyle() @@ -1297,12 +1299,16 @@ var dtpPanel = Utils.defineClass({ }, _setShowDesktopButtonStyle: function() { - let rgb = this._getBackgroundBrightness() ? "55, 55, 55" : "200, 200, 200"; + let rgb = this._getBackgroundBrightness() ? "rgba(55, 55, 55, .2)" : "rgba(200, 200, 200, .2)"; + + let isLineCustom = Me.settings.get_boolean('desktop-line-use-custom-color'); + rgb = isLineCustom ? Me.settings.get_string('desktop-line-custom-color') : rgb; if (this._showDesktopButton) { let buttonSize = Me.settings.get_int('showdesktop-button-width') + 'px;'; let isVertical = this.checkIfVertical(); - let sytle = "border: 0 solid rgba(" + rgb + ", .2);" + + let sytle = "border: 0 solid " + rgb + ";"; sytle += isVertical ? 'border-top-width:1px;height:' + buttonSize : 'border-left-width:1px;width:' + buttonSize; this._showDesktopButton.set_style(sytle); diff --git a/prefs.js b/prefs.js index 26fb97b..99bdd36 100644 --- a/prefs.js +++ b/prefs.js @@ -920,6 +920,24 @@ const Settings = new Lang.Class({ dialog.show_all(); })); + + this._settings.bind('desktop-line-use-custom-color', + this._builder.get_object('override_show_desktop_line_color_switch'), + 'active', + Gio.SettingsBindFlags.DEFAULT); + + this._settings.bind('desktop-line-use-custom-color', + this._builder.get_object('override_show_desktop_line_color_colorbutton'), + 'sensitive', + Gio.SettingsBindFlags.DEFAULT); + + rgba.parse(this._settings.get_string('desktop-line-custom-color')); + this._builder.get_object('override_show_desktop_line_color_colorbutton').set_rgba(rgba); + this._builder.get_object('override_show_desktop_line_color_colorbutton').connect('notify::color', Lang.bind(this, function (button) { + let rgba = button.get_rgba(); + let css = rgba.to_string(); + this._settings.set_string('desktop-line-custom-color', css); + })); this._settings.bind('intellihide', 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 f111611..ba7d1f2 100644 --- a/schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml +++ b/schemas/org.gnome.shell.extensions.dash-to-panel.gschema.xml @@ -92,6 +92,16 @@ Panel size Set the size of the panel. + + false + Override Show Desktop line color + Replace current Show Desktop button line color + + + "rgba(200,200,200,0.2)" + Custom Show Desktop line color + Custom Show Desktop button line color + 'BOTTOM' Dot position