[gnome] Update gnome extensions
This commit is contained in:
@ -0,0 +1,46 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg
|
||||
viewBox="0 0 16 16"
|
||||
version="1.1"
|
||||
id="svg2"
|
||||
sodipodi:docname="custom-icons-symbolic.svg"
|
||||
inkscape:version="1.4 (1:1.4+202410161351+e7c3feb100)"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:svg="http://www.w3.org/2000/svg">
|
||||
<defs
|
||||
id="defs2" />
|
||||
<sodipodi:namedview
|
||||
id="namedview2"
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#000000"
|
||||
borderopacity="0.25"
|
||||
inkscape:showpageshadow="2"
|
||||
inkscape:pageopacity="0.0"
|
||||
inkscape:pagecheckerboard="0"
|
||||
inkscape:deskcolor="#d1d1d1"
|
||||
inkscape:zoom="31.404053"
|
||||
inkscape:cx="7.4671891"
|
||||
inkscape:cy="8.9001252"
|
||||
inkscape:window-width="1860"
|
||||
inkscape:window-height="1011"
|
||||
inkscape:window-x="0"
|
||||
inkscape:window-y="0"
|
||||
inkscape:window-maximized="1"
|
||||
inkscape:current-layer="svg2" />
|
||||
<g
|
||||
fill="#222222"
|
||||
id="g3"
|
||||
transform="translate(-0.16009403)">
|
||||
<path
|
||||
d="m 5.207031,1.292969 c -0.390625,-0.390625 -1.023437,-0.390625 -1.414062,0 l -2.5,2.5 c -0.390625,0.390625 -0.390625,1.023437 0,1.414062 l 2.5,2.5 c 0.390625,0.390625 1.023437,0.390625 1.414062,0 l 2.496094,-2.5 c 0.390625,-0.390625 0.390625,-1.023437 0,-1.414062 z m 0,0"
|
||||
id="path1-3" />
|
||||
<path
|
||||
d="m 10,12 c 0,1.65625 -1.34375,3 -3,3 -1.660156,0 -3,-1.34375 -3,-3 0,-1.65625 1.339844,-3 3,-3 1.65625,0 3,1.34375 3,3 z m 0,0"
|
||||
id="path2-6" />
|
||||
<path
|
||||
d="M 11.945312,2.003906 C 11.605469,2.019531 11.300781,2.207031 11.132812,2.5 L 8.8125,6.5 C 8.425781,7.164062 8.90625,8 9.675781,8 h 4.644531 c 0.769532,0 1.25,-0.835938 0.863282,-1.5 l -2.320313,-4 C 12.675781,2.171875 12.320312,1.980469 11.945312,2.003906 Z m 0,0"
|
||||
id="path3" />
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.8 KiB |
@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path d="M12.5 2A2.5 2.5 0 0 0 10 4.5 2.5 2.5 0 0 0 12.5 7 2.5 2.5 0 0 0 15 4.5 2.5 2.5 0 0 0 12.5 2zm0 1A1.5 1.5 0 0 1 14 4.5 1.5 1.5 0 0 1 12.5 6 1.5 1.5 0 0 1 11 4.5 1.5 1.5 0 0 1 12.5 3zm-9 5A2.5 2.5 0 0 0 1 10.5 2.5 2.5 0 0 0 3.5 13a2.5 2.5 0 0 0 2.443-2H15v-1H5.95A2.5 2.5 0 0 0 3.5 8zm0 1A1.5 1.5 0 0 1 5 10.5 1.5 1.5 0 0 1 3.5 12 1.5 1.5 0 0 1 2 10.5 1.5 1.5 0 0 1 3.5 9z" style="fill:gray;stroke-width:.70228"/><path d="M-9 4h8v1h-8z" style="fill:gray;fill-opacity:1;stroke-width:1.05153;opacity:.5" transform="scale(-1 1)"/></svg>
|
||||
|
After Width: | Height: | Size: 600 B |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -8,9 +8,10 @@
|
||||
"45",
|
||||
"46",
|
||||
"47",
|
||||
"48"
|
||||
"48",
|
||||
"49"
|
||||
],
|
||||
"url": "https://github.com/ubuntu/gnome-shell-extension-appindicator",
|
||||
"uuid": "appindicatorsupport@rgcjonas.gmail.com",
|
||||
"version": 60
|
||||
"version": 61
|
||||
}
|
||||
@ -0,0 +1,240 @@
|
||||
/* exported GeneralPage*/
|
||||
|
||||
import Adw from 'gi://Adw';
|
||||
import Gtk from 'gi://Gtk';
|
||||
import GObject from 'gi://GObject';
|
||||
import Gio from 'gi://Gio';
|
||||
import GLib from 'gi://GLib';
|
||||
import {gettext as _} from 'resource:///org/gnome/Shell/Extensions/js/extensions/prefs.js';
|
||||
|
||||
const IconData = GObject.registerClass({
|
||||
GTypeName: 'IconData',
|
||||
Properties: {
|
||||
'id': GObject.ParamSpec.string(
|
||||
'id',
|
||||
'Id',
|
||||
'A read and write string property',
|
||||
GObject.ParamFlags.READWRITE,
|
||||
''
|
||||
),
|
||||
'name': GObject.ParamSpec.string(
|
||||
'name',
|
||||
'Name',
|
||||
'A read and write string property',
|
||||
GObject.ParamFlags.READWRITE,
|
||||
''
|
||||
),
|
||||
'at-name': GObject.ParamSpec.string(
|
||||
'at-name',
|
||||
'At Name',
|
||||
'A read and write string property',
|
||||
GObject.ParamFlags.READWRITE,
|
||||
''
|
||||
),
|
||||
|
||||
},
|
||||
}, class IconData extends GObject.Object {
|
||||
constructor(props = {}) {
|
||||
super(props);
|
||||
}
|
||||
|
||||
get id() {
|
||||
if (this._id === 'undefined')
|
||||
this._id = null;
|
||||
return this._id;
|
||||
}
|
||||
|
||||
set id(value) {
|
||||
if (this.id === value)
|
||||
return;
|
||||
|
||||
this._id = value;
|
||||
this.notify('id');
|
||||
}
|
||||
|
||||
get name() {
|
||||
if (this._name === 'undefined')
|
||||
this._name = null;
|
||||
return this._name;
|
||||
}
|
||||
|
||||
set name(value) {
|
||||
if (this.name === value)
|
||||
return;
|
||||
|
||||
this._name = value;
|
||||
this.notify('name');
|
||||
}
|
||||
|
||||
get atName() {
|
||||
if (this._atName === 'undefined')
|
||||
this._atName = null;
|
||||
return this._atName;
|
||||
}
|
||||
|
||||
set atName(value) {
|
||||
if (this.atName === value)
|
||||
return;
|
||||
|
||||
this._atName = value;
|
||||
this.notify('at-name');
|
||||
}
|
||||
});
|
||||
|
||||
export var CustomIconPage = GObject.registerClass(
|
||||
class AppIndicatorCustomIconPage extends Adw.PreferencesPage {
|
||||
_init(settings, settingsKey) {
|
||||
super._init({
|
||||
title: _('Custom Icons'),
|
||||
icon_name: 'custom-icons-symbolic',
|
||||
name: 'Custom Icons Page',
|
||||
});
|
||||
this._settings = settings;
|
||||
this._settingsKey = settingsKey;
|
||||
|
||||
this.group = new Adw.PreferencesGroup();
|
||||
|
||||
this.container = new Gtk.Box({
|
||||
halign: Gtk.Align.FILL,
|
||||
hexpand: true,
|
||||
orientation: Gtk.Orientation.VERTICAL,
|
||||
});
|
||||
|
||||
this.listStore = new Gio.ListStore({
|
||||
item_type: IconData,
|
||||
});
|
||||
|
||||
const initList = this._settings.get_value(this._settingsKey.CUSTOM_ICONS).deep_unpack();
|
||||
initList.forEach(pair => {
|
||||
let data = new IconData({
|
||||
id: pair[0],
|
||||
name: pair[1],
|
||||
atName: pair[2],
|
||||
});
|
||||
this.listStore.append(data);
|
||||
});
|
||||
|
||||
this.listStore.append(new IconData({id: '', name: '', atName: ''}));
|
||||
|
||||
this.selectionModel = new Gtk.SingleSelection({
|
||||
model: this.listStore,
|
||||
});
|
||||
|
||||
this.columnView = new Gtk.ColumnView({
|
||||
hexpand: true,
|
||||
model: this.selectionModel,
|
||||
reorderable: false,
|
||||
});
|
||||
|
||||
const columnTitles = [
|
||||
_('Indicator ID'),
|
||||
_('Icon Name'),
|
||||
_('Attention Icon Name'),
|
||||
];
|
||||
const indicatorIdColumn = new Gtk.ColumnViewColumn({
|
||||
title: columnTitles[0],
|
||||
expand: true,
|
||||
});
|
||||
const iconNameColumn = new Gtk.ColumnViewColumn({
|
||||
title: columnTitles[1],
|
||||
expand: true,
|
||||
});
|
||||
const attentionIconNameColumn = new Gtk.ColumnViewColumn({
|
||||
title: columnTitles[2],
|
||||
expand: true,
|
||||
});
|
||||
|
||||
|
||||
const factoryId = new Gtk.SignalListItemFactory();
|
||||
factoryId.connect('setup', (_widget, item) => {
|
||||
const label = new Gtk.EditableLabel({text: ''});
|
||||
item.set_child(label);
|
||||
});
|
||||
factoryId.connect('bind', (_widget, item) => {
|
||||
const label = item.get_child();
|
||||
const data = item.get_item();
|
||||
label.set_text(data.id);
|
||||
label.bind_property('text', data, 'id', GObject.BindingFlags.SYNC_CREATE);
|
||||
label.connect('changed', () => this._autoSave(item));
|
||||
});
|
||||
|
||||
const factoryName = new Gtk.SignalListItemFactory();
|
||||
factoryName.connect('setup', (_widget, item) => {
|
||||
const label = new Gtk.EditableLabel({text: ''});
|
||||
item.set_child(label);
|
||||
});
|
||||
factoryName.connect('bind', (_widget, item) => {
|
||||
const label = item.get_child();
|
||||
const data = item.get_item();
|
||||
label.set_text(data.name);
|
||||
label.bind_property('text', data, 'name', GObject.BindingFlags.SYNC_CREATE);
|
||||
label.connect('changed', () => this._autoSave(item));
|
||||
});
|
||||
|
||||
const factoryItName = new Gtk.SignalListItemFactory();
|
||||
factoryItName.connect('setup', (_widget, item) => {
|
||||
const label = new Gtk.EditableLabel({text: ''});
|
||||
item.set_child(label);
|
||||
});
|
||||
factoryItName.connect('bind', (_widget, item) => {
|
||||
const label = item.get_child();
|
||||
const data = item.get_item();
|
||||
label.set_text(data.atName);
|
||||
label.bind_property('text', data, 'at-name', GObject.BindingFlags.SYNC_CREATE);
|
||||
label.connect('changed', () => this._autoSave(item));
|
||||
});
|
||||
|
||||
indicatorIdColumn.set_factory(factoryId);
|
||||
iconNameColumn.set_factory(factoryName);
|
||||
attentionIconNameColumn.set_factory(factoryItName);
|
||||
|
||||
this.columnView.append_column(indicatorIdColumn);
|
||||
this.columnView.append_column(iconNameColumn);
|
||||
this.columnView.append_column(attentionIconNameColumn);
|
||||
|
||||
this.container.append(this.columnView);
|
||||
|
||||
this.group.add(this.container);
|
||||
this.add(this.group);
|
||||
}
|
||||
|
||||
_autoSave(item) {
|
||||
const storeLength = this.listStore.get_n_items();
|
||||
const newStore = [];
|
||||
|
||||
for (let i = 0; i < storeLength; i++) {
|
||||
const currentItem = this.listStore.get_item(i);
|
||||
const id = currentItem.id;
|
||||
const name = currentItem.name;
|
||||
const atName = currentItem.atName;
|
||||
if (id && name)
|
||||
newStore.push([id, name, atName || '']);
|
||||
}
|
||||
|
||||
this._settings.set_value(this._settingsKey.CUSTOM_ICONS,
|
||||
new GLib.Variant('a(sss)', newStore));
|
||||
|
||||
const id = item.get_item().id;
|
||||
const name = item.get_item().name;
|
||||
|
||||
/* dynamic new entry*/
|
||||
if (storeLength === 1 && (id || name))
|
||||
this.listStore.append(new IconData({id: '', name: '', atName: ''}));
|
||||
|
||||
if (storeLength > 1) {
|
||||
if ((id || name) && item.get_position() >= storeLength - 1)
|
||||
this.listStore.append(new IconData({id: '', name: '', atName: ''}));
|
||||
}
|
||||
}
|
||||
|
||||
_autoDelete(item) {
|
||||
const storeLength = this.listStore.get_n_items();
|
||||
const id = item.get_item().id;
|
||||
const name = item.get_item().name;
|
||||
if (storeLength > 1 && !id && !name &&
|
||||
item.get_position() < storeLength - 1)
|
||||
this.listStore.remove(item.get_position());
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@ -0,0 +1,141 @@
|
||||
/* exported GeneralPage*/
|
||||
|
||||
import Adw from 'gi://Adw';
|
||||
import Gtk from 'gi://Gtk';
|
||||
import GObject from 'gi://GObject';
|
||||
import {gettext as _} from 'resource:///org/gnome/Shell/Extensions/js/extensions/prefs.js';
|
||||
|
||||
|
||||
export var GeneralPage = GObject.registerClass(
|
||||
class AppIndicatorGeneralPage extends Adw.PreferencesPage {
|
||||
_init(settings, settingsKey) {
|
||||
super._init({
|
||||
title: _('General'),
|
||||
icon_name: 'general-preferences-symbolic',
|
||||
name: 'General Page',
|
||||
});
|
||||
|
||||
this._settings = settings;
|
||||
this._settingsKey = settingsKey;
|
||||
|
||||
this.group = new Adw.PreferencesGroup(); // no title since only single group
|
||||
|
||||
const legacyTraySwitch = new Adw.SwitchRow({
|
||||
title: _('Enable Legacy Tray Icons support'),
|
||||
subtitle: _('Add X11 legacy tray icons to the panel area'),
|
||||
active: this._settings.get_boolean(this._settingsKey.LEGACY_TRAY_ENABLED),
|
||||
});
|
||||
|
||||
legacyTraySwitch.connect('notify::active', widget =>
|
||||
this._settings.set_boolean(this._settingsKey.LEGACY_TRAY_ENABLED,
|
||||
widget.get_active()));
|
||||
|
||||
this.group.add(legacyTraySwitch);
|
||||
|
||||
this._createSpinRow({
|
||||
title: _('Opacity'),
|
||||
settingsKey: this._settingsKey.ICON_OPACITY,
|
||||
from: 0,
|
||||
to: 255,
|
||||
step: 1,
|
||||
round: true,
|
||||
});
|
||||
|
||||
this._createSpinRow({
|
||||
title: _('Desaturation'),
|
||||
settingsKey: this._settingsKey.ICON_SATURATION,
|
||||
from: 0.0,
|
||||
to: 1.0,
|
||||
step: 0.1,
|
||||
});
|
||||
|
||||
this._createSpinRow({
|
||||
title: _('Brightness'),
|
||||
settingsKey: this._settingsKey.ICON_BRIGHTNESS,
|
||||
from: -1.0,
|
||||
to: 1.0,
|
||||
step: 0.1,
|
||||
});
|
||||
|
||||
this._createSpinRow({
|
||||
title: _('Contrast'),
|
||||
settingsKey: this._settingsKey.ICON_CONTRAST,
|
||||
from: -1.0,
|
||||
to: 1.0,
|
||||
step: 0.1,
|
||||
});
|
||||
|
||||
this._createSpinRow({
|
||||
title: _('Icon Size'),
|
||||
settingsKey: this._settingsKey.ICON_SIZE,
|
||||
from: 0,
|
||||
to: 96,
|
||||
step: 2,
|
||||
round: true,
|
||||
});
|
||||
|
||||
const alignmentList = new Gtk.StringList();
|
||||
const comboItems = [
|
||||
{pos: 'center', label: _('Center')},
|
||||
{pos: 'left', label: _('Left')},
|
||||
{pos: 'right', label: _('Right')},
|
||||
];
|
||||
|
||||
comboItems.forEach(item => alignmentList.append(item.label));
|
||||
|
||||
const combo = new Adw.ComboRow({
|
||||
title: _('Tray Horizontal Alignment'),
|
||||
model: alignmentList,
|
||||
});
|
||||
const trayPos = this._settings.get_string(this._settingsKey.TRAY_POS);
|
||||
combo.set_selected(comboItems.findIndex(item => trayPos === item.pos));
|
||||
|
||||
combo.connect('notify::selected', widget => this._settings.set_string(
|
||||
this._settingsKey.TRAY_POS, comboItems[widget.get_selected()].pos));
|
||||
|
||||
this.group.add(combo);
|
||||
this.add(this.group);
|
||||
}
|
||||
|
||||
_createSpinRow(args) {
|
||||
let title = args.title || 'Default Title';
|
||||
let subtitle = args.subtitle || null;
|
||||
let settingsKey = args.settingsKey || '';
|
||||
let from = args.from || 0;
|
||||
let to = args.to || 100;
|
||||
let step = args.step || 1;
|
||||
let round = args.round || false;
|
||||
|
||||
let spin = Adw.SpinRow.new_with_range(from, to, step);
|
||||
spin.title = title;
|
||||
if (subtitle !== null)
|
||||
spin.subtitle = subtitle;
|
||||
|
||||
if (round)
|
||||
spin.set_value(this._settings.get_int(settingsKey));
|
||||
else
|
||||
spin.set_value(this._settings.get_int(settingsKey));
|
||||
|
||||
|
||||
spin.connect('input', widget => {
|
||||
if (round)
|
||||
this._settings.set_int(settingsKey, parseInt(widget.get_value(), 10));
|
||||
else
|
||||
this._settings.set_double(settingsKey, widget.get_value());
|
||||
|
||||
return false;
|
||||
});
|
||||
spin.connect('output', widget => {
|
||||
if (round)
|
||||
this._settings.set_int(settingsKey, parseInt(widget.get_value(), 10));
|
||||
else
|
||||
this._settings.set_double(settingsKey, widget.get_value());
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
this.group.add(spin);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user