mirror of
https://github.com/morgan9e/dash-to-panel
synced 2026-04-14 00:04:17 +09:00
Set show desktop button label with panel position
This commit is contained in:
@@ -3927,7 +3927,6 @@
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="hexpand">True</property>
|
||||
<property name="label" translatable="yes">Show Desktop button width (px)</property>
|
||||
<property name="xalign">0</property>
|
||||
</object>
|
||||
<packing>
|
||||
|
||||
11
panel.js
11
panel.js
@@ -969,9 +969,8 @@ var dtpPanel = Utils.defineClass({
|
||||
|
||||
this._setShowDesktopButtonSize();
|
||||
|
||||
this._signalsHandler.add([this._showDesktopButton, 'button-press-event', () => this._onShowDesktopButtonPress()]);
|
||||
|
||||
this._signalsHandler.add([this._showDesktopButton, 'enter-event', () => {
|
||||
this._showDesktopButton.connect('button-press-event', () => this._onShowDesktopButtonPress());
|
||||
this._showDesktopButton.connect('enter-event', () => {
|
||||
this._showDesktopButton.add_style_class_name('showdesktop-button-hovered');
|
||||
|
||||
if (Me.settings.get_boolean('show-showdesktop-hover')) {
|
||||
@@ -981,9 +980,9 @@ var dtpPanel = Utils.defineClass({
|
||||
this._showDesktopTimeoutId = 0;
|
||||
});
|
||||
}
|
||||
}]);
|
||||
});
|
||||
|
||||
this._signalsHandler.add([this._showDesktopButton, 'leave-event', () => {
|
||||
this._showDesktopButton.connect('leave-event', () => {
|
||||
this._showDesktopButton.remove_style_class_name('showdesktop-button-hovered');
|
||||
|
||||
if (Me.settings.get_boolean('show-showdesktop-hover')) {
|
||||
@@ -994,7 +993,7 @@ var dtpPanel = Utils.defineClass({
|
||||
this._toggleWorkspaceWindows(false, this._hiddenDesktopWorkspace);
|
||||
}
|
||||
}
|
||||
}]);
|
||||
});
|
||||
|
||||
this._rightBox.insert_child_at_index(this._showDesktopButton, this._rightBox.get_children().length);
|
||||
} else {
|
||||
|
||||
17
prefs.js
17
prefs.js
@@ -201,6 +201,7 @@ const Settings = new Lang.Class({
|
||||
let isVertical = position == 'LEFT' || position == 'RIGHT';
|
||||
let taskbarLocationCombo = this._builder.get_object('taskbar_position_combo');
|
||||
let clockLocationCombo = this._builder.get_object('location_clock_combo');
|
||||
let showDesktopWidthLabel = this._builder.get_object('show_showdesktop_width_label');
|
||||
|
||||
taskbarLocationCombo.remove_all();
|
||||
clockLocationCombo.remove_all();
|
||||
@@ -221,9 +222,11 @@ const Settings = new Lang.Class({
|
||||
['TASKBARLEFT', isVertical ? _('Top of taskbar') : _('Left of taskbar')],
|
||||
['TASKBARRIGHT', isVertical ? _('Bottom of taskbar') : _('Right of taskbar')]
|
||||
].forEach(cl => clockLocationCombo.append.apply(clockLocationCombo, cl));
|
||||
|
||||
|
||||
taskbarLocationCombo.set_active_id(this._settings.get_string('taskbar-position'));
|
||||
clockLocationCombo.set_active_id(this._settings.get_string('location-clock'));
|
||||
|
||||
showDesktopWidthLabel.set_text(isVertical ? _('Show Desktop button height (px)') : _('Show Desktop button width (px)'));
|
||||
},
|
||||
|
||||
_bindSettings: function() {
|
||||
@@ -252,10 +255,18 @@ const Settings = new Lang.Class({
|
||||
this._updateVerticalRelatedOptions();
|
||||
|
||||
this._builder.get_object('location_clock_combo').connect('changed', Lang.bind (this, function(widget) {
|
||||
this._settings.set_string('location-clock', widget.get_active_id());
|
||||
let activeId = widget.get_active_id();
|
||||
|
||||
if (activeId) {
|
||||
this._settings.set_string('location-clock', activeId);
|
||||
}
|
||||
}));
|
||||
this._builder.get_object('taskbar_position_combo').connect('changed', Lang.bind (this, function(widget) {
|
||||
this._settings.set_string('taskbar-position', widget.get_active_id());
|
||||
let activeId = widget.get_active_id();
|
||||
|
||||
if (activeId) {
|
||||
this._settings.set_string('taskbar-position', activeId);
|
||||
}
|
||||
}));
|
||||
|
||||
// size options
|
||||
|
||||
Reference in New Issue
Block a user