Add option to open panel menu buttons on click only

This commit is contained in:
Charles Gagnon
2019-02-02 12:32:41 -05:00
parent 36b3d27e61
commit 29e970009e
4 changed files with 44 additions and 0 deletions

View File

@@ -6040,6 +6040,31 @@
<property name="top_attach">0</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="stockgs_panelbtn_label">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hexpand">True</property>
<property name="label" translatable="yes">Activate panel menu buttons (e.g. date menu) on click only</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="GtkSwitch" id="stockgs_panelbtn_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="left_attach">1</property>
<property name="top_attach">1</property>
</packing>
</child>
</object>
</child>
</object>

View File

@@ -136,6 +136,13 @@ var dtpPanelWrapper = new Lang.Class({
}
}
this.panel.menuManager._oldChangeMenu = this.panel.menuManager._changeMenu;
this.panel.menuManager._changeMenu = (menu) => {
if (!this._dtpSettings.get_boolean('stockgs-panelbtn-click-only')) {
this.panel.menuManager._oldChangeMenu(menu);
}
};
if(this.appMenu)
this.panel._leftBox.remove_child(this.appMenu.container);
@@ -292,6 +299,8 @@ var dtpPanelWrapper = new Lang.Class({
this._injectionsHandler.destroy();
}
this.panel.menuManager._changeMenu = this.panel.menuManager._oldChangeMenu;
if (!this.isSecondary) {
this.panel.actor.set_height(this._oldPanelHeight);

View File

@@ -1409,6 +1409,11 @@ const Settings = new Lang.Class({
this._builder.get_object('stockgs_dash_switch'),
'active',
Gio.SettingsBindFlags.DEFAULT);
this._settings.bind('stockgs-panelbtn-click-only',
this._builder.get_object('stockgs_panelbtn_switch'),
'active',
Gio.SettingsBindFlags.DEFAULT);
// About Panel

View File

@@ -165,6 +165,11 @@
<summary>Keep dash</summary>
<description>Whether to keep the stock gnome-shell dash while in overview</description>
</key>
<key type="b" name="stockgs-panelbtn-click-only">
<default>false</default>
<summary>Panel menu buttons require click</summary>
<description>Whether to activate the panel menu buttons on hover or on click</description>
</key>
<key name="location-clock" enum="org.gnome.shell.extensions.dash-to-panel.statusAreaPosition">
<default>'STATUSLEFT'</default>
<summary>Location of the clock</summary>