mirror of
https://github.com/morgan9e/dash-to-panel
synced 2026-04-14 00:04:17 +09:00
add option to change Show Desktop line color
This commit is contained in:
55
Settings.ui
55
Settings.ui
@@ -3972,6 +3972,7 @@
|
||||
<property name="margin_right">12</property>
|
||||
<property name="margin_top">12</property>
|
||||
<property name="margin_bottom">12</property>
|
||||
<property name="row_spacing">4</property>
|
||||
<property name="column_spacing">32</property>
|
||||
<child>
|
||||
<object class="GtkLabel" id="show_showdesktop_width_label">
|
||||
@@ -4001,6 +4002,60 @@
|
||||
<property name="top_attach">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="override_show_desktop_line_color_label">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="hexpand">True</property>
|
||||
<property name="label" translatable="yes">Override Show Desktop line color</property>
|
||||
<property name="xalign">0</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkBox" id="override_show_desktop_line_color_box">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="spacing">12</property>
|
||||
<property name="halign">end</property>
|
||||
<child>
|
||||
<object class="GtkColorButton" id="override_show_desktop_line_color_colorbutton">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="halign">end</property>
|
||||
<property name="use_alpha">True</property>
|
||||
<property name="show_editor">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSwitch" id="override_show_desktop_line_color_switch">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="halign">end</property>
|
||||
<property name="valign">center</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="top_attach">0</property>
|
||||
<property name="top_attach">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
|
||||
23
panel.js
23
panel.js
@@ -664,7 +664,17 @@ var dtpPanel = Utils.defineClass({
|
||||
[
|
||||
Me.settings,
|
||||
'changed::showdesktop-button-width',
|
||||
() => this._setShowDesktopButtonSize()
|
||||
() => this._setShowDesktopButtonStyle()
|
||||
],
|
||||
[
|
||||
Me.settings,
|
||||
'changed::desktop-line-use-custom-color',
|
||||
() => this._setShowDesktopButtonStyle()
|
||||
],
|
||||
[
|
||||
Me.settings,
|
||||
'changed::desktop-line-custom-color',
|
||||
() => this._setShowDesktopButtonStyle()
|
||||
],
|
||||
[
|
||||
Me.desktopSettings,
|
||||
@@ -1253,7 +1263,7 @@ var dtpPanel = Utils.defineClass({
|
||||
y_fill: true,
|
||||
track_hover: true });
|
||||
|
||||
this._setShowDesktopButtonSize();
|
||||
this._setShowDesktopButtonStyle();
|
||||
|
||||
this._showDesktopButton.connect('button-press-event', () => this._onShowDesktopButtonPress());
|
||||
this._showDesktopButton.connect('enter-event', () => {
|
||||
@@ -1290,11 +1300,16 @@ var dtpPanel = Utils.defineClass({
|
||||
}
|
||||
},
|
||||
|
||||
_setShowDesktopButtonSize: function() {
|
||||
_setShowDesktopButtonStyle: function() {
|
||||
if (this._showDesktopButton) {
|
||||
let buttonSize = Me.settings.get_int('showdesktop-button-width') + 'px;';
|
||||
let isVertical = this.checkIfVertical();
|
||||
let sytle = isVertical ? 'border-top-width:1px;height:' + buttonSize : 'border-left-width:1px;width:' + buttonSize;
|
||||
|
||||
let lineRgbaColor = Me.settings.get_string('desktop-line-custom-color');
|
||||
let isLineCustom = Me.settings.get_boolean('desktop-line-use-custom-color');
|
||||
|
||||
let sytle = isLineCustom ? 'border:0 solid ' + lineRgbaColor + ';' : '';
|
||||
sytle += isVertical ? 'border-top-width:1px;height:' + buttonSize : 'border-left-width:1px;width:' + buttonSize;
|
||||
|
||||
this._showDesktopButton.set_style(sytle);
|
||||
this._showDesktopButton[(isVertical ? 'x' : 'y') + '_expand'] = true;
|
||||
|
||||
18
prefs.js
18
prefs.js
@@ -921,6 +921,24 @@ const Settings = new Lang.Class({
|
||||
|
||||
}));
|
||||
|
||||
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',
|
||||
this._builder.get_object('intellihide_switch'),
|
||||
|
||||
@@ -92,6 +92,16 @@
|
||||
<summary>Panel size</summary>
|
||||
<description>Set the size of the panel.</description>
|
||||
</key>
|
||||
<key type="b" name="desktop-line-use-custom-color">
|
||||
<default>false</default>
|
||||
<summary>Override Show Desktop line color</summary>
|
||||
<description>Replace current Show Desktop button line color</description>
|
||||
</key>
|
||||
<key type="s" name="desktop-line-custom-color">
|
||||
<default>"rgba(200,200,200,0.2)"</default>
|
||||
<summary>Custom Show Desktop line color</summary>
|
||||
<description>Custom Show Desktop button line color</description>
|
||||
</key>
|
||||
<key name="dot-position" enum="org.gnome.shell.extensions.dash-to-panel.position">
|
||||
<default>'BOTTOM'</default>
|
||||
<summary>Dot position</summary>
|
||||
|
||||
Reference in New Issue
Block a user