Fix "App Details" context menu hiding

Upstream changed label in GNOME 44.

[appmenu: Change "Show Details" entry label to "App Details"](https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2585)

---

Let's use the appmenu property directly instead of finding it using the label, so that would work for every language.

We keep the same schema setting name, so users don't loose their configuration.
This commit is contained in:
Yevhen Popok
2025-02-23 15:46:29 +02:00
parent 3733d0bd02
commit 644de41a79
3 changed files with 8 additions and 18 deletions

View File

@@ -861,7 +861,7 @@
</key>
<key type="b" name="secondarymenu-contains-showdetails">
<default>false</default>
<summary>Display Show Details to open Gnome Software from right click menu</summary>
<summary>Display App Details to open Gnome Software from right click menu</summary>
</key>
<key type="s" name="shortcut-text">
<default>"&lt;Super&gt;q"</default>

View File

@@ -1888,7 +1888,7 @@ export function getIconPadding(dtpPanel) {
/**
* Extend AppMenu (AppIconMenu for pre gnome 41)
*
* - hide 'Show Details' according to setting
* - hide 'App Details' according to setting
* - show windows header only if show-window-previews is disabled
* - Add close windows option based on quitfromdash extension
* (https://github.com/deuill/shell-extension-quitfromdash)
@@ -1901,19 +1901,6 @@ export class TaskbarSecondaryMenu extends AppMenu.AppMenu {
this._enableFavorites = true
this._showSingleWindows = true
// Remove "Show Details" menu item
if (!SETTINGS.get_boolean('secondarymenu-contains-showdetails')) {
let existingMenuItems = this._getMenuItems()
for (let i = 0; i < existingMenuItems.length; i++) {
let item = existingMenuItems[i]
if (item !== undefined && item.label !== undefined) {
if (item.label.text == 'Show Details') {
this.box.remove_child(item.actor)
}
}
}
}
// replace quit item
delete this._quitItem
this._quitItem = this.addAction(_('Quit'), () => this._quitFromTaskbar())
@@ -1958,7 +1945,10 @@ export class TaskbarSecondaryMenu extends AppMenu.AppMenu {
setApp(app) {
super.setApp(app)
this._detailsItem.visible = !app.hideDetails
// set "App Details" menu item visibility
this._detailsItem.visible =
!app.hideDetails &&
SETTINGS.get_boolean('secondarymenu-contains-showdetails')
}
}

View File

@@ -27,7 +27,7 @@
<child>
<object class="AdwActionRow">
<property name="title" translatable="yes">&lt;i&gt;Show Details&lt;/i&gt; menu item</property>
<property name="title" translatable="yes">&lt;i&gt;App Details&lt;/i&gt; menu item</property>
<child>
<object class="GtkSwitch" id="secondarymenu_showdetails_switch">
<property name="valign">center</property>