mirror of
https://github.com/morgan9e/dash-to-panel
synced 2026-04-14 00:04:17 +09:00
Reset app details menu on setting change
gh-2244
This commit is contained in:
@@ -1904,6 +1904,12 @@ export class TaskbarSecondaryMenu extends AppMenu.AppMenu {
|
|||||||
// replace quit item
|
// replace quit item
|
||||||
delete this._quitItem
|
delete this._quitItem
|
||||||
this._quitItem = this.addAction(_('Quit'), () => this._quitFromTaskbar())
|
this._quitItem = this.addAction(_('Quit'), () => this._quitFromTaskbar())
|
||||||
|
|
||||||
|
source._signalsHandler.add([
|
||||||
|
SETTINGS,
|
||||||
|
'changed::secondarymenu-contains-showdetails',
|
||||||
|
() => this._setAppDetailsVisibility(source.app),
|
||||||
|
])
|
||||||
}
|
}
|
||||||
|
|
||||||
updateQuitText() {
|
updateQuitText() {
|
||||||
@@ -1946,7 +1952,19 @@ export class TaskbarSecondaryMenu extends AppMenu.AppMenu {
|
|||||||
super.setApp(app)
|
super.setApp(app)
|
||||||
|
|
||||||
// set "App Details" menu item visibility
|
// set "App Details" menu item visibility
|
||||||
|
this._setAppDetailsVisibility(app)
|
||||||
|
}
|
||||||
|
|
||||||
|
_setAppDetailsVisibility(app) {
|
||||||
|
// This next line sets the app details menu to visible if Gnome Software is
|
||||||
|
// installed. If it isn't, no point of showing the menu anymay because
|
||||||
|
// its only purpose is to opens Gnome Software
|
||||||
|
super._updateDetailsVisibility()
|
||||||
|
|
||||||
|
let gnomeSoftwareIsInstalled = this._detailsItem.visible
|
||||||
|
|
||||||
this._detailsItem.visible =
|
this._detailsItem.visible =
|
||||||
|
gnomeSoftwareIsInstalled &&
|
||||||
!app.hideDetails &&
|
!app.hideDetails &&
|
||||||
SETTINGS.get_boolean('secondarymenu-contains-showdetails')
|
SETTINGS.get_boolean('secondarymenu-contains-showdetails')
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,6 +28,7 @@
|
|||||||
<child>
|
<child>
|
||||||
<object class="AdwActionRow">
|
<object class="AdwActionRow">
|
||||||
<property name="title" translatable="yes"><i>App Details</i> menu item</property>
|
<property name="title" translatable="yes"><i>App Details</i> menu item</property>
|
||||||
|
<property name="subtitle" translatable="yes"><i>App Details</i> is only available when Gnome Software is installed</property>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkSwitch" id="secondarymenu_showdetails_switch">
|
<object class="GtkSwitch" id="secondarymenu_showdetails_switch">
|
||||||
<property name="valign">center</property>
|
<property name="valign">center</property>
|
||||||
|
|||||||
Reference in New Issue
Block a user