extensions-app: Enable/disable an extension by activating the row

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2114>
This commit is contained in:
Romain Vigier 2022-01-18 13:04:55 +01:00 committed by Marge Bot
parent 859ded5790
commit 77bd26fe07
2 changed files with 6 additions and 1 deletions

View File

@ -1,7 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<interface> <interface>
<template class="ExtensionRow" parent="GtkListBoxRow"> <template class="ExtensionRow" parent="GtkListBoxRow">
<property name="activatable">false</property>
<style> <style>
<class name="extension"/> <class name="extension"/>
</style> </style>

View File

@ -134,6 +134,7 @@ var ExtensionsWindow = GObject.registerClass({
margin_top: 12, margin_top: 12,
margin_bottom: 12, margin_bottom: 12,
})); }));
this._userList.connect('row-activated', (_list, row) => row.activate());
this._systemList.set_sort_func(this._sortList.bind(this)); this._systemList.set_sort_func(this._sortList.bind(this));
this._systemList.set_filter_func(this._filterList.bind(this)); this._systemList.set_filter_func(this._filterList.bind(this));
@ -144,6 +145,7 @@ var ExtensionsWindow = GObject.registerClass({
margin_top: 12, margin_top: 12,
margin_bottom: 12, margin_bottom: 12,
})); }));
this._systemList.connect('row-activated', (_list, row) => row.activate());
this._shellProxy.connectSignal('ExtensionStateChanged', this._shellProxy.connectSignal('ExtensionStateChanged',
this._onExtensionStateChanged.bind(this)); this._onExtensionStateChanged.bind(this));
@ -425,6 +427,10 @@ var ExtensionRow = GObject.registerClass({
this._updateState(); this._updateState();
} }
vfunc_activate() {
this._switch.mnemonic_activate(false);
}
get uuid() { get uuid() {
return this._extension.uuid; return this._extension.uuid;
} }