[gnome] Updating extensions, back to Forge

This commit is contained in:
2026-02-18 11:13:53 -05:00
parent 9d4dd2863c
commit ede0687e11
107 changed files with 9856 additions and 4216 deletions

View File

@ -882,7 +882,11 @@ const StTextureCacheSkippingFileIcon = GObject.registerClass({
export const IconActor = GObject.registerClass(
class AppIndicatorsIconActor extends St.Icon {
static get DEFAULT_STYLE() {
return 'padding: 0';
const settings = SettingsManager.getDefaultGSettings();
if (!settings.get_boolean('compact-mode-enabled'))
return 'padding: 0';
else
return 'padding: 0; margin: 0';
}
static get USER_WRITABLE_PATHS() {

View File

@ -188,6 +188,10 @@ export class DbusMenuItem extends Signals.EventEmitter {
return this._children_ids.map(el => this._client.getItem(el));
}
hasChildren() {
return this._children_ids.length > 0;
}
handleEvent(event, data, timestamp) {
if (!data)
data = GLib.Variant.new_int32(0);
@ -477,14 +481,14 @@ export const DBusClient = GObject.registerClass({
_onSignal(_sender, signal, params) {
if (signal === 'LayoutUpdated') {
if (!this._active) {
if (!this._active && this.getRoot()?.hasChildren()) {
this._flagLayoutUpdateRequired = true;
return;
}
this._requestLayoutUpdate();
} else if (signal === 'ItemsPropertiesUpdated') {
if (!this._active) {
if (!this._active && this.getRoot()?.hasChildren()) {
this._flagItemsUpdateRequired = true;
return;
}

View File

@ -81,6 +81,8 @@ class IndicatorBaseStatusIcon extends PanelMenu.Button {
this._setIconActor(iconActor);
this._showIfReady();
this.set_style(IndicatorBaseStatusIcon.DEFAULT_STYLE);
}
_setIconActor(icon) {
@ -169,6 +171,9 @@ class IndicatorBaseStatusIcon extends PanelMenu.Button {
Util.disconnectSmart(settings, this, this._iconContrastIds);
delete this._iconContrastIds;
Util.disconnectSmart(settings, this, this._compactModeEnabledIds);
delete this._compactModeEnabledIds;
} else if (this._icon && !monitoring) {
this._iconSaturationIds =
Util.connectSmart(settings, 'changed::icon-saturation', this,
@ -179,9 +184,25 @@ class IndicatorBaseStatusIcon extends PanelMenu.Button {
this._iconContrastIds =
Util.connectSmart(settings, 'changed::icon-contrast', this,
this._updateBrightnessContrast);
this._compactModeEnabledIds =
Util.connectSmart(settings, 'changed::compact-mode-enabled', this,
this._updateCompactMode);
}
}
static get DEFAULT_STYLE() {
const settings = SettingsManager.getDefaultGSettings();
if (!settings.get_boolean('compact-mode-enabled'))
return null; // drop to default -natural-hpadding.
return '-natural-hpadding: 10px';
}
_updateCompactMode() {
this._icon.set_style(AppIndicator.IconActor.DEFAULT_STYLE);
this.set_style(IndicatorBaseStatusIcon.DEFAULT_STYLE);
}
_updateSaturation() {
const settings = SettingsManager.getDefaultGSettings();
const desaturationValue = settings.get_double('icon-saturation');

View File

@ -9,9 +9,10 @@
"46",
"47",
"48",
"49"
"49",
"50"
],
"url": "https://github.com/ubuntu/gnome-shell-extension-appindicator",
"uuid": "appindicatorsupport@rgcjonas.gmail.com",
"version": 61
"version": 63
}

View File

@ -27,11 +27,29 @@ class AppIndicatorGeneralPage extends Adw.PreferencesPage {
});
legacyTraySwitch.connect('notify::active', widget =>
this._settings.set_boolean(this._settingsKey.LEGACY_TRAY_ENABLED,
widget.get_active()));
this._settings.set_boolean(
this._settingsKey.LEGACY_TRAY_ENABLED,
widget.get_active()
)
);
this.group.add(legacyTraySwitch);
const compactModeSwitch = new Adw.SwitchRow({
title: _('Compact Mode'),
subtitle: _('Puts tray indicators closer together'),
active: this._settings.get_boolean(this._settingsKey.COMPACT_MODE_ENABLED),
});
compactModeSwitch.connect('notify::active', widget =>
this._settings.set_boolean(
this._settingsKey.COMPACT_MODE_ENABLED,
widget.get_active()
)
);
this.group.add(compactModeSwitch);
this._createSpinRow({
title: _('Opacity'),
settingsKey: this._settingsKey.ICON_OPACITY,

View File

@ -14,6 +14,7 @@ import {
const SettingsKey = {
LEGACY_TRAY_ENABLED: 'legacy-tray-enabled',
COMPACT_MODE_ENABLED: 'compact-mode-enabled',
ICON_SIZE: 'icon-size',
ICON_OPACITY: 'icon-opacity',
ICON_SATURATION: 'icon-saturation',

View File

@ -25,10 +25,10 @@
<summary>Icon size</summary>
<description>Icon size in pixel</description>
</key>
<key name="icon-spacing" type="i">
<default>12</default>
<summary>Icon spacing</summary>
<description>Icon spacing within the tray</description>
<key name="compact-mode-enabled" type="b">
<default>true</default>
<summary>Compact Mode</summary>
<description>Reduces the Spacing Between Indicators</description>
</key>
<key name="tray-pos" type="s">
<default>"right"</default>

View File

@ -45,19 +45,6 @@ export class TrayIconsManager extends Signals.EventEmitter {
this._changedId = SettingsManager.getDefaultGSettings().connect(
'changed::legacy-tray-enabled', () => this._toggle());
// On theme changed, need to update the bg color to match style,
// This may not be required anymore on newer shell versions that use
// ARGBA visuals.
this._styleChangedID = Main.panel.connect('style-changed', () => {
const panelBgColor = this._getPanelBgColor();
const {bgColor} = this._tray ?? {bgColor: null};
if (bgColor === panelBgColor || bgColor?.equal(panelBgColor))
return;
this._disable();
this._toggle();
});
this._toggle();
}
@ -110,7 +97,6 @@ export class TrayIconsManager extends Signals.EventEmitter {
destroy() {
this.emit('destroy');
SettingsManager.getDefaultGSettings().disconnect(this._changedId);
Main.panel.disconnect(this._styleChangedID);
this._disable();
trayIconsManager = null;
}