Refactor preferences
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
// SPDX-FileCopyrightText: 2021 Romain Vigier <contact AT romainvigier.fr>
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
const { Gio, GLib, GObject, Gtk } = imports.gi;
|
||||
const { extensionUtils } = imports.misc;
|
||||
|
||||
const Me = extensionUtils.getCurrentExtension();
|
||||
|
||||
const utils = Me.imports.utils;
|
||||
|
||||
|
||||
var Appearance = GObject.registerClass({
|
||||
GTypeName: 'Appearance',
|
||||
Template: `file://${GLib.build_filenamev([Me.path, 'preferences', 'ui', 'Appearance.ui'])}`,
|
||||
}, class Appearance extends Gtk.ScrolledWindow {});
|
||||
@@ -0,0 +1,59 @@
|
||||
// SPDX-FileCopyrightText: 2021 Romain Vigier <contact AT romainvigier.fr>
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
const { Gdk, GLib, GObject, Gtk } = imports.gi;
|
||||
const { extensionUtils } = imports.misc;
|
||||
|
||||
const Me = extensionUtils.getCurrentExtension();
|
||||
|
||||
const utils = Me.imports.utils;
|
||||
|
||||
|
||||
var BackgroundButton = GObject.registerClass({
|
||||
GTypeName: 'BackgroundButton',
|
||||
Template: `file://${GLib.build_filenamev([Me.path, 'preferences', 'ui', 'BackgroundButton.ui'])}`,
|
||||
InternalChildren: ['choose_button', 'change_button', 'clear_button', 'filechooser'],
|
||||
Properties: {
|
||||
path: GObject.ParamSpec.string(
|
||||
'path',
|
||||
'Path',
|
||||
'Path to the background file',
|
||||
GObject.ParamFlags.READWRITE,
|
||||
null
|
||||
),
|
||||
},
|
||||
}, class BackgroundButton extends Gtk.Stack {
|
||||
activate() {
|
||||
if (this.path)
|
||||
return this._change_button.activate();
|
||||
else
|
||||
return this._choose_button.activate();
|
||||
}
|
||||
|
||||
openFileChooser() {
|
||||
this._filechooser.transient_for = this.get_root();
|
||||
this._filechooser.show();
|
||||
}
|
||||
|
||||
onFileChooserResponse(fileChooser, responseId) {
|
||||
if (responseId !== Gtk.ResponseType.ACCEPT)
|
||||
return;
|
||||
this.path = fileChooser.get_file().get_uri();
|
||||
}
|
||||
|
||||
onPathChanged(button) {
|
||||
button.visible_child_name = button.path ? 'edit' : 'choose';
|
||||
}
|
||||
|
||||
onChooseButtonClicked(_button) {
|
||||
this.openFileChooser();
|
||||
}
|
||||
|
||||
onChangeButtonClicked(_button) {
|
||||
this.openFileChooser();
|
||||
}
|
||||
|
||||
onClearButtonClicked(_button) {
|
||||
this.path = '';
|
||||
}
|
||||
});
|
||||
@@ -1,96 +0,0 @@
|
||||
// SPDX-FileCopyrightText: 2020, 2021 Romain Vigier <contact AT romainvigier.fr>
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
const { GdkPixbuf, Gio, GLib, Gtk } = imports.gi;
|
||||
const { extensionUtils } = imports.misc;
|
||||
|
||||
const Me = extensionUtils.getCurrentExtension();
|
||||
|
||||
const Gettext = imports.gettext.domain(Me.metadata['gettext-domain']);
|
||||
const _ = Gettext.gettext;
|
||||
|
||||
|
||||
var BackgroundsPreferences = class {
|
||||
constructor(settings) {
|
||||
this._builder = new Gtk.Builder();
|
||||
this._builder.add_from_file(GLib.build_filenamev([Me.path, 'preferences', 'ui', 'backgrounds.ui']));
|
||||
|
||||
this.widget = this._builder.get_object('backgrounds');
|
||||
this.name = 'backgrounds';
|
||||
this.title = _('Backgrounds');
|
||||
|
||||
this._connectSettings(settings);
|
||||
}
|
||||
|
||||
_connectSettings(settings) {
|
||||
const enabledSwitch = this._builder.get_object('enabled_switch');
|
||||
settings.backgrounds.settings.bind(
|
||||
'enabled',
|
||||
enabledSwitch,
|
||||
'active',
|
||||
Gio.SettingsBindFlags.DEFAULT
|
||||
);
|
||||
|
||||
const choosers = this._builder.get_object('choosers');
|
||||
settings.backgrounds.settings.bind(
|
||||
'enabled',
|
||||
choosers,
|
||||
'sensitive',
|
||||
Gio.SettingsBindFlags.DEFAULT
|
||||
);
|
||||
|
||||
const dayChooserButton = this._builder.get_object('day_chooser_button');
|
||||
const dayChooser = this._builder.get_object('day_chooser');
|
||||
const updateDayChooserButtonLabel = () => {
|
||||
dayChooserButton.set_label(settings.backgrounds.day ? GLib.filename_display_basename(settings.backgrounds.day) : _('Choose...'));
|
||||
};
|
||||
settings.backgrounds.connect('day-changed', () => updateDayChooserButtonLabel());
|
||||
dayChooser.connect('response', (_fileChooser, responseId) => {
|
||||
if (responseId !== Gtk.ResponseType.ACCEPT)
|
||||
return;
|
||||
settings.backgrounds.day = dayChooser.get_file().get_uri();
|
||||
});
|
||||
dayChooserButton.connect('clicked', () => {
|
||||
dayChooser.set_transient_for(dayChooserButton.get_root());
|
||||
dayChooser.show();
|
||||
});
|
||||
updateDayChooserButtonLabel();
|
||||
|
||||
const dayClearButton = this._builder.get_object('day_clear_button');
|
||||
dayClearButton.connect('clicked', () => {
|
||||
settings.backgrounds.day = '';
|
||||
});
|
||||
const updateDayClearButtonSensitivity = () => {
|
||||
dayClearButton.sensitive = !!settings.backgrounds.day;
|
||||
};
|
||||
settings.backgrounds.connect('day-changed', () => updateDayClearButtonSensitivity());
|
||||
updateDayClearButtonSensitivity();
|
||||
|
||||
const nightChooserButton = this._builder.get_object('night_chooser_button');
|
||||
const nightChooser = this._builder.get_object('night_chooser');
|
||||
const updateNightChooserButtonLabel = () => {
|
||||
nightChooserButton.set_label(settings.backgrounds.night ? GLib.filename_display_basename(settings.backgrounds.night) : _('Choose...'));
|
||||
};
|
||||
settings.backgrounds.connect('night-changed', () => updateNightChooserButtonLabel());
|
||||
nightChooser.connect('response', (_fileChooser, responseId) => {
|
||||
if (responseId !== Gtk.ResponseType.ACCEPT)
|
||||
return;
|
||||
settings.backgrounds.night = nightChooser.get_file().get_uri();
|
||||
});
|
||||
nightChooserButton.connect('clicked', () => {
|
||||
nightChooser.set_transient_for(nightChooserButton.get_root());
|
||||
nightChooser.show();
|
||||
});
|
||||
updateNightChooserButtonLabel();
|
||||
|
||||
const nightClearButton = this._builder.get_object('night_clear_button');
|
||||
nightClearButton.connect('clicked', () => {
|
||||
settings.backgrounds.night = '';
|
||||
});
|
||||
const updateNightClearButtonSensitivity = () => {
|
||||
nightClearButton.sensitive = !!settings.backgrounds.night;
|
||||
};
|
||||
settings.backgrounds.connect('night-changed', () => updateNightClearButtonSensitivity());
|
||||
updateNightClearButtonSensitivity();
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,55 @@
|
||||
// SPDX-FileCopyrightText: 2021 Romain Vigier <contact AT romainvigier.fr>
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
const { Gio, GLib, GObject, Gtk } = imports.gi;
|
||||
const { extensionUtils } = imports.misc;
|
||||
|
||||
const Me = extensionUtils.getCurrentExtension();
|
||||
|
||||
const utils = Me.imports.utils;
|
||||
|
||||
|
||||
var BackgroundsPreferences = GObject.registerClass({
|
||||
GTypeName: 'BackgroundsPreferences',
|
||||
Template: `file://${GLib.build_filenamev([Me.path, 'preferences', 'ui', 'BackgroundsPreferences.ui'])}`,
|
||||
InternalChildren: [
|
||||
'enabled_switch',
|
||||
'day_button',
|
||||
'night_button',
|
||||
],
|
||||
Properties: {
|
||||
settings: GObject.ParamSpec.object(
|
||||
'settings',
|
||||
'Settings',
|
||||
'Backgrounds GSettings',
|
||||
GObject.ParamFlags.READWRITE,
|
||||
Gio.Settings.$gtype
|
||||
),
|
||||
},
|
||||
}, class BackgroundsPreferences extends Gtk.Box {
|
||||
_init(props = {}) {
|
||||
super._init(props);
|
||||
this.settings = extensionUtils.getSettings(utils.getSettingsSchema('backgrounds'));
|
||||
|
||||
this.settings.bind(
|
||||
'enabled',
|
||||
this._enabled_switch,
|
||||
'active',
|
||||
Gio.SettingsBindFlags.DEFAULT
|
||||
);
|
||||
|
||||
this.settings.bind(
|
||||
'day',
|
||||
this._day_button,
|
||||
'path',
|
||||
Gio.SettingsBindFlags.DEFAULT
|
||||
);
|
||||
|
||||
this.settings.bind(
|
||||
'night',
|
||||
this._night_button,
|
||||
'path',
|
||||
Gio.SettingsBindFlags.DEFAULT
|
||||
);
|
||||
}
|
||||
});
|
||||
@@ -0,0 +1,18 @@
|
||||
// SPDX-FileCopyrightText: 2021 Romain Vigier <contact AT romainvigier.fr>
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
const { Gio, GLib, GObject, Gtk } = imports.gi;
|
||||
const { extensionUtils } = imports.misc;
|
||||
|
||||
const Me = extensionUtils.getCurrentExtension();
|
||||
|
||||
|
||||
var ClearableEntry = GObject.registerClass({
|
||||
GTypeName: 'ClearableEntry',
|
||||
Template: `file://${GLib.build_filenamev([Me.path, 'preferences', 'ui', 'ClearableEntry.ui'])}`,
|
||||
}, class ClearableEntry extends Gtk.Entry {
|
||||
onIconReleased(entry, position) {
|
||||
if (position === Gtk.EntryIconPosition.SECONDARY)
|
||||
entry.text = '';
|
||||
}
|
||||
});
|
||||
+26
-53
@@ -1,78 +1,51 @@
|
||||
// SPDX-FileCopyrightText: 2020, 2021 Romain Vigier <contact AT romainvigier.fr>
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
const { Gio, GLib, Gtk } = imports.gi;
|
||||
const { Gio, GLib, GObject, Gtk } = imports.gi;
|
||||
const { extensionUtils } = imports.misc;
|
||||
|
||||
const Me = extensionUtils.getCurrentExtension();
|
||||
|
||||
const Gettext = imports.gettext.domain(Me.metadata['gettext-domain']);
|
||||
const _ = Gettext.gettext;
|
||||
const utils = Me.imports.utils;
|
||||
|
||||
|
||||
var CommandsPreferences = class {
|
||||
constructor(settings) {
|
||||
this._builder = new Gtk.Builder();
|
||||
this._builder.add_from_file(GLib.build_filenamev([Me.path, 'preferences', 'ui', 'commands.ui']));
|
||||
var Commands = GObject.registerClass({
|
||||
GTypeName: 'Commands',
|
||||
Template: `file://${GLib.build_filenamev([Me.path, 'preferences', 'ui', 'Commands.ui'])}`,
|
||||
InternalChildren: ['enabled_switch', 'sunrise_entry', 'sunset_entry'],
|
||||
Properties: {
|
||||
settings: GObject.ParamSpec.object(
|
||||
'settings',
|
||||
'Settings',
|
||||
'Command GSettings',
|
||||
GObject.ParamFlags.READWRITE,
|
||||
Gio.Settings.$gtype
|
||||
),
|
||||
},
|
||||
}, class Commands extends Gtk.ScrolledWindow {
|
||||
_init(props = {}) {
|
||||
super._init(props);
|
||||
this.settings = extensionUtils.getSettings(utils.getSettingsSchema('commands'));
|
||||
|
||||
this.widget = this._builder.get_object('commands');
|
||||
this.name = 'commands';
|
||||
this.title = _('Commands');
|
||||
|
||||
this._connectSettings(settings);
|
||||
}
|
||||
|
||||
_connectSettings(settings) {
|
||||
const enabledSwitch = this._builder.get_object('enabled_switch');
|
||||
settings.commands.settings.bind(
|
||||
this.settings.bind(
|
||||
'enabled',
|
||||
enabledSwitch,
|
||||
this._enabled_switch,
|
||||
'active',
|
||||
Gio.SettingsBindFlags.DEFAULT
|
||||
);
|
||||
|
||||
const entries = this._builder.get_object('entries');
|
||||
settings.commands.settings.bind(
|
||||
'enabled',
|
||||
entries,
|
||||
'sensitive',
|
||||
Gio.SettingsBindFlags.DEFAULT
|
||||
);
|
||||
|
||||
const sunriseEntry = this._builder.get_object('sunrise_entry');
|
||||
settings.commands.settings.bind(
|
||||
this.settings.bind(
|
||||
'sunrise',
|
||||
sunriseEntry,
|
||||
this._sunrise_entry,
|
||||
'text',
|
||||
Gio.SettingsBindFlags.DEFAULT
|
||||
);
|
||||
|
||||
const sunriseClearButton = this._builder.get_object('sunrise_clear_button');
|
||||
sunriseClearButton.connect('clicked', () => {
|
||||
settings.commands.sunrise = '';
|
||||
});
|
||||
const updateSunriseClearButtonSensitivity = () => {
|
||||
sunriseClearButton.sensitive = !!settings.commands.sunrise;
|
||||
};
|
||||
settings.commands.connect('sunrise-changed', () => updateSunriseClearButtonSensitivity());
|
||||
updateSunriseClearButtonSensitivity();
|
||||
|
||||
const sunsetEntry = this._builder.get_object('sunset_entry');
|
||||
settings.commands.settings.bind(
|
||||
this.settings.bind(
|
||||
'sunset',
|
||||
sunsetEntry,
|
||||
this._sunset_entry,
|
||||
'text',
|
||||
Gio.SettingsBindFlags.DEFAULT
|
||||
);
|
||||
|
||||
const sunsetClearButton = this._builder.get_object('sunset_clear_button');
|
||||
sunsetClearButton.connect('clicked', () => {
|
||||
settings.commands.sunset = '';
|
||||
});
|
||||
const updateSunsetClearButtonSensitivity = () => {
|
||||
sunsetClearButton.sensitive = !!settings.commands.sunset;
|
||||
};
|
||||
settings.commands.connect('sunset-changed', () => updateSunsetClearButtonSensitivity());
|
||||
updateSunsetClearButtonSensitivity();
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
@@ -0,0 +1,64 @@
|
||||
// SPDX-FileCopyrightText: 2021 Romain Vigier <contact AT romainvigier.fr>
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
const { Gio, GLib, GObject, Gtk } = imports.gi;
|
||||
const { extensionUtils } = imports.misc;
|
||||
|
||||
const Me = extensionUtils.getCurrentExtension();
|
||||
|
||||
const utils = Me.imports.utils;
|
||||
|
||||
const { DropDownChoice } = Me.imports.preferences.DropDownChoice;
|
||||
|
||||
|
||||
var CursorPreferences = GObject.registerClass({
|
||||
GTypeName: 'CursorPreferences',
|
||||
Template: `file://${GLib.build_filenamev([Me.path, 'preferences', 'ui', 'CursorPreferences.ui'])}`,
|
||||
InternalChildren: [
|
||||
'enabled_switch',
|
||||
'day_dropdown',
|
||||
'night_dropdown',
|
||||
],
|
||||
Properties: {
|
||||
settings: GObject.ParamSpec.object(
|
||||
'settings',
|
||||
'Settings',
|
||||
'Cursor GSettings',
|
||||
GObject.ParamFlags.READWRITE,
|
||||
Gio.Settings.$gtype
|
||||
),
|
||||
},
|
||||
}, class CursorPreferences extends Gtk.Box {
|
||||
_init(props = {}) {
|
||||
super._init(props);
|
||||
this.settings = extensionUtils.getSettings(utils.getSettingsSchema('cursor-variants'));
|
||||
|
||||
this.settings.bind(
|
||||
'enabled',
|
||||
this._enabled_switch,
|
||||
'active',
|
||||
Gio.SettingsBindFlags.DEFAULT
|
||||
);
|
||||
|
||||
const themeChoices = Gio.ListStore.new(DropDownChoice);
|
||||
themeChoices.splice(0, 0, Array.from(utils.getInstalledCursorThemes()).sort().map(theme => new DropDownChoice({ id: theme, title: theme })));
|
||||
|
||||
this._day_dropdown.model = themeChoices;
|
||||
this._day_dropdown.expression = Gtk.PropertyExpression.new(DropDownChoice, null, 'title');
|
||||
this._day_dropdown.connect('notify::selected-item', () => this.settings.set_string('day', this._day_dropdown.selected_item.id));
|
||||
const updateDayDropDownSelected = () => {
|
||||
this._day_dropdown.selected = utils.findItemPositionInModel(this._day_dropdown.model, item => item.id === this.settings.get_string('day'));
|
||||
};
|
||||
this.settings.connect('changed::day', () => updateDayDropDownSelected());
|
||||
updateDayDropDownSelected();
|
||||
|
||||
this._night_dropdown.model = themeChoices;
|
||||
this._night_dropdown.expression = Gtk.PropertyExpression.new(DropDownChoice, null, 'title');
|
||||
this._night_dropdown.connect('notify::selected-item', () => this.settings.set_string('night', this._night_dropdown.selected_item.id));
|
||||
const updateNightDropDownSelected = () => {
|
||||
this._night_dropdown.selected = utils.findItemPositionInModel(this._night_dropdown.model, item => item.id === this.settings.get_string('night'));
|
||||
};
|
||||
this.settings.connect('changed::night', () => updateNightDropDownSelected());
|
||||
updateNightDropDownSelected();
|
||||
}
|
||||
});
|
||||
@@ -1,64 +0,0 @@
|
||||
// SPDX-FileCopyrightText: 2020, 2021 Romain Vigier <contact AT romainvigier.fr>
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
const { Gio, GLib, Gtk } = imports.gi;
|
||||
const { extensionUtils } = imports.misc;
|
||||
|
||||
const Me = extensionUtils.getCurrentExtension();
|
||||
|
||||
const utils = Me.imports.utils;
|
||||
|
||||
const Gettext = imports.gettext.domain(Me.metadata['gettext-domain']);
|
||||
const _ = Gettext.gettext;
|
||||
|
||||
|
||||
var CursorThemePreferences = class {
|
||||
constructor(settings) {
|
||||
this._builder = new Gtk.Builder();
|
||||
this._builder.add_from_file(GLib.build_filenamev([Me.path, 'preferences', 'ui', 'cursor_theme.ui']));
|
||||
|
||||
this.widget = this._builder.get_object('cursor_theme');
|
||||
this.name = 'cursor-theme';
|
||||
this.title = _('Cursor theme');
|
||||
|
||||
this._connectSettings(settings);
|
||||
}
|
||||
|
||||
_connectSettings(settings) {
|
||||
const enabledSwitch = this._builder.get_object('enabled_switch');
|
||||
settings.cursorVariants.settings.bind(
|
||||
'enabled',
|
||||
enabledSwitch,
|
||||
'active',
|
||||
Gio.SettingsBindFlags.DEFAULT
|
||||
);
|
||||
|
||||
const variants = this._builder.get_object('variants');
|
||||
settings.cursorVariants.settings.bind(
|
||||
'enabled',
|
||||
variants,
|
||||
'sensitive',
|
||||
Gio.SettingsBindFlags.DEFAULT
|
||||
);
|
||||
|
||||
const installedCursorThemes = Array.from(utils.getInstalledCursorThemes()).sort();
|
||||
const dayCombo = this._builder.get_object('day_combo');
|
||||
const nightCombo = this._builder.get_object('night_combo');
|
||||
installedCursorThemes.forEach(theme => {
|
||||
dayCombo.append(theme, theme);
|
||||
nightCombo.append(theme, theme);
|
||||
});
|
||||
settings.cursorVariants.settings.bind(
|
||||
'day',
|
||||
dayCombo,
|
||||
'active-id',
|
||||
Gio.SettingsBindFlags.DEFAULT
|
||||
);
|
||||
settings.cursorVariants.settings.bind(
|
||||
'night',
|
||||
nightCombo,
|
||||
'active-id',
|
||||
Gio.SettingsBindFlags.DEFAULT
|
||||
);
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,32 @@
|
||||
// SPDX-FileCopyrightText: 2020, 2021 Romain Vigier <contact AT romainvigier.fr>
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
const { GObject } = imports.gi;
|
||||
|
||||
|
||||
var DropDownChoice = GObject.registerClass({
|
||||
GTypeName: 'DropDownChoice',
|
||||
Properties: {
|
||||
id: GObject.ParamSpec.string(
|
||||
'id',
|
||||
'ID',
|
||||
'Identifier',
|
||||
GObject.ParamFlags.READWRITE,
|
||||
null
|
||||
),
|
||||
title: GObject.ParamSpec.string(
|
||||
'title',
|
||||
'Title',
|
||||
'Displayed title',
|
||||
GObject.ParamFlags.READWRITE,
|
||||
null
|
||||
),
|
||||
enabled: GObject.ParamSpec.boolean(
|
||||
'enabled',
|
||||
'Enabled',
|
||||
'If the choice is enabled',
|
||||
GObject.ParamFlags.READWRITE,
|
||||
true
|
||||
),
|
||||
},
|
||||
}, class DropDownChoice extends GObject.Object {});
|
||||
@@ -0,0 +1,72 @@
|
||||
// SPDX-FileCopyrightText: 2021 Romain Vigier <contact AT romainvigier.fr>
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
const { Gio, GLib, GObject, Gtk } = imports.gi;
|
||||
const { extensionUtils } = imports.misc;
|
||||
|
||||
const Me = extensionUtils.getCurrentExtension();
|
||||
|
||||
const utils = Me.imports.utils;
|
||||
|
||||
const { DropDownChoice } = Me.imports.preferences.DropDownChoice;
|
||||
|
||||
|
||||
var GtkPreferences = GObject.registerClass({
|
||||
GTypeName: 'GtkPreferences',
|
||||
Template: `file://${GLib.build_filenamev([Me.path, 'preferences', 'ui', 'GtkPreferences.ui'])}`,
|
||||
InternalChildren: [
|
||||
'enabled_switch',
|
||||
'manual_switch',
|
||||
'day_dropdown',
|
||||
'night_dropdown',
|
||||
],
|
||||
Properties: {
|
||||
settings: GObject.ParamSpec.object(
|
||||
'settings',
|
||||
'Settings',
|
||||
'GTK GSettings',
|
||||
GObject.ParamFlags.READWRITE,
|
||||
Gio.Settings.$gtype
|
||||
),
|
||||
},
|
||||
}, class GtkPreferences extends Gtk.Box {
|
||||
_init(props = {}) {
|
||||
super._init(props);
|
||||
this.settings = extensionUtils.getSettings(utils.getSettingsSchema('gtk-variants'));
|
||||
|
||||
this.settings.bind(
|
||||
'enabled',
|
||||
this._enabled_switch,
|
||||
'active',
|
||||
Gio.SettingsBindFlags.DEFAULT
|
||||
);
|
||||
|
||||
this.settings.bind(
|
||||
'manual',
|
||||
this._manual_switch,
|
||||
'active',
|
||||
Gio.SettingsBindFlags.DEFAULT
|
||||
);
|
||||
|
||||
const themeChoices = Gio.ListStore.new(DropDownChoice);
|
||||
themeChoices.splice(0, 0, Array.from(utils.getInstalledGtkThemes()).sort().map(theme => new DropDownChoice({ id: theme, title: theme })));
|
||||
|
||||
this._day_dropdown.model = themeChoices;
|
||||
this._day_dropdown.expression = Gtk.PropertyExpression.new(DropDownChoice, null, 'title');
|
||||
this._day_dropdown.connect('notify::selected-item', () => this.settings.set_string('day', this._day_dropdown.selected_item.id));
|
||||
const updateDayDropDownSelected = () => {
|
||||
this._day_dropdown.selected = utils.findItemPositionInModel(this._day_dropdown.model, item => item.id === this.settings.get_string('day'));
|
||||
};
|
||||
this.settings.connect('changed::day', () => updateDayDropDownSelected());
|
||||
updateDayDropDownSelected();
|
||||
|
||||
this._night_dropdown.model = themeChoices;
|
||||
this._night_dropdown.expression = Gtk.PropertyExpression.new(DropDownChoice, null, 'title');
|
||||
this._night_dropdown.connect('notify::selected-item', () => this.settings.set_string('night', this._night_dropdown.selected_item.id));
|
||||
const updateNightDropDownSelected = () => {
|
||||
this._night_dropdown.selected = utils.findItemPositionInModel(this._night_dropdown.model, item => item.id === this.settings.get_string('night'));
|
||||
};
|
||||
this.settings.connect('changed::night', () => updateNightDropDownSelected());
|
||||
updateNightDropDownSelected();
|
||||
}
|
||||
});
|
||||
@@ -1,80 +0,0 @@
|
||||
// SPDX-FileCopyrightText: 2020, 2021 Romain Vigier <contact AT romainvigier.fr>
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
const { Gio, GLib, Gtk } = imports.gi;
|
||||
const { extensionUtils } = imports.misc;
|
||||
|
||||
const Me = extensionUtils.getCurrentExtension();
|
||||
|
||||
const utils = Me.imports.utils;
|
||||
|
||||
const Gettext = imports.gettext.domain(Me.metadata['gettext-domain']);
|
||||
const _ = Gettext.gettext;
|
||||
|
||||
|
||||
var GtkThemePreferences = class {
|
||||
constructor(settings) {
|
||||
this._builder = new Gtk.Builder();
|
||||
this._builder.add_from_file(GLib.build_filenamev([Me.path, 'preferences', 'ui', 'gtk_theme.ui']));
|
||||
|
||||
this.widget = this._builder.get_object('gtk_theme');
|
||||
this.name = 'gtk-theme';
|
||||
this.title = _('GTK theme');
|
||||
|
||||
this._connectSettings(settings);
|
||||
}
|
||||
|
||||
_connectSettings(settings) {
|
||||
const enabledSwitch = this._builder.get_object('enabled_switch');
|
||||
settings.gtkVariants.settings.bind(
|
||||
'enabled',
|
||||
enabledSwitch,
|
||||
'active',
|
||||
Gio.SettingsBindFlags.DEFAULT
|
||||
);
|
||||
|
||||
const manual = this._builder.get_object('manual');
|
||||
settings.gtkVariants.settings.bind(
|
||||
'enabled',
|
||||
manual,
|
||||
'sensitive',
|
||||
Gio.SettingsBindFlags.DEFAULT
|
||||
);
|
||||
|
||||
const manualSwitch = this._builder.get_object('manual_switch');
|
||||
settings.gtkVariants.settings.bind(
|
||||
'manual',
|
||||
manualSwitch,
|
||||
'active',
|
||||
Gio.SettingsBindFlags.DEFAULT
|
||||
);
|
||||
|
||||
const variants = this._builder.get_object('variants');
|
||||
const updateVariantsSensitivity = () => {
|
||||
variants.sensitive = !!(settings.gtkVariants.enabled && settings.gtkVariants.manual);
|
||||
};
|
||||
settings.gtkVariants.connect('status-changed', () => updateVariantsSensitivity());
|
||||
settings.gtkVariants.connect('manual-changed', () => updateVariantsSensitivity());
|
||||
updateVariantsSensitivity();
|
||||
|
||||
const dayCombo = this._builder.get_object('day_combo');
|
||||
const nightCombo = this._builder.get_object('night_combo');
|
||||
const installedGtkThemes = Array.from(utils.getInstalledGtkThemes()).sort();
|
||||
installedGtkThemes.forEach(theme => {
|
||||
dayCombo.append(theme, theme);
|
||||
nightCombo.append(theme, theme);
|
||||
});
|
||||
settings.gtkVariants.settings.bind(
|
||||
'day',
|
||||
dayCombo,
|
||||
'active-id',
|
||||
Gio.SettingsBindFlags.DEFAULT
|
||||
);
|
||||
settings.gtkVariants.settings.bind(
|
||||
'night',
|
||||
nightCombo,
|
||||
'active-id',
|
||||
Gio.SettingsBindFlags.DEFAULT
|
||||
);
|
||||
}
|
||||
};
|
||||
@@ -1,49 +1,47 @@
|
||||
// SPDX-FileCopyrightText: 2020, 2021 Romain Vigier <contact AT romainvigier.fr>
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
const { GLib, Gtk } = imports.gi;
|
||||
const { GLib, GObject, Gtk } = imports.gi;
|
||||
const { extensionUtils } = imports.misc;
|
||||
|
||||
const Me = extensionUtils.getCurrentExtension();
|
||||
|
||||
const Gettext = imports.gettext.domain(Me.metadata['gettext-domain']);
|
||||
const _ = Gettext.gettext;
|
||||
|
||||
const utils = Me.imports.utils;
|
||||
|
||||
|
||||
var Headerbar = class {
|
||||
constructor(stack) {
|
||||
this._builder = new Gtk.Builder();
|
||||
this._builder.add_from_file(GLib.build_filenamev([Me.path, 'preferences', 'ui', 'headerbar.ui']));
|
||||
|
||||
this.widget = this._builder.get_object('headerbar');
|
||||
|
||||
this._connect(stack);
|
||||
|
||||
return this.widget;
|
||||
var Headerbar = GObject.registerClass({
|
||||
GTypeName: 'Headerbar',
|
||||
Template: `file://${GLib.build_filenamev([Me.path, 'preferences', 'ui', 'Headerbar.ui'])}`,
|
||||
Properties: {
|
||||
preferences: GObject.ParamSpec.object(
|
||||
'preferences',
|
||||
'Preferences',
|
||||
'A Preferences stack',
|
||||
GObject.ParamFlags.READWRITE,
|
||||
Gtk.Stack.$gtype
|
||||
),
|
||||
},
|
||||
}, class Headerbar extends Gtk.HeaderBar {
|
||||
onPreferencesChanged(headerbar) {
|
||||
headerbar.title_widget = null;
|
||||
if (!headerbar.preferences)
|
||||
return;
|
||||
const pages = headerbar.preferences.pages;
|
||||
const box = new Gtk.Box({ orientation: 'horizontal', css_classes: ['linked'] });
|
||||
for (let i = 0; i < pages.get_n_items(); i++) {
|
||||
const page = pages.get_item(i);
|
||||
const button = new Gtk.ToggleButton({ active: pages.is_selected(i) });
|
||||
const buttonBox = new Gtk.Box({ orientation: 'horizontal', margin_start: 12, margin_end: 12, spacing: 6 });
|
||||
buttonBox.append(new Gtk.Image({ icon_name: page.icon_name }));
|
||||
buttonBox.append(new Gtk.Label({ label: page.title }));
|
||||
button.set_child(buttonBox);
|
||||
button.connect('clicked', () => {
|
||||
pages.select_item(i, true);
|
||||
button.active = true;
|
||||
});
|
||||
pages.connect('selection-changed', () => {
|
||||
button.active = pages.is_selected(i);
|
||||
});
|
||||
box.append(button);
|
||||
}
|
||||
headerbar.title_widget = box;
|
||||
}
|
||||
|
||||
_connect(stack) {
|
||||
const scheduleRadio = this._builder.get_object('schedule_radio');
|
||||
scheduleRadio.connect('clicked', () => stack.set_visible_child_name('schedule'));
|
||||
|
||||
const gtkThemeRadio = this._builder.get_object('gtk_theme_radio');
|
||||
gtkThemeRadio.connect('clicked', () => stack.set_visible_child_name('gtk-theme'));
|
||||
|
||||
const shellThemeRadio = this._builder.get_object('shell_theme_radio');
|
||||
shellThemeRadio.connect('clicked', () => stack.set_visible_child_name('shell-theme'));
|
||||
|
||||
const iconThemeRadio = this._builder.get_object('icon_theme_radio');
|
||||
iconThemeRadio.connect('clicked', () => stack.set_visible_child_name('icon-theme'));
|
||||
|
||||
const cursorThemeRadio = this._builder.get_object('cursor_theme_radio');
|
||||
cursorThemeRadio.connect('clicked', () => stack.set_visible_child_name('cursor-theme'));
|
||||
|
||||
const backgroundsRadio = this._builder.get_object('backgrounds_radio');
|
||||
backgroundsRadio.connect('clicked', () => stack.set_visible_child_name('backgrounds'));
|
||||
|
||||
const commandsRadio = this._builder.get_object('commands_radio');
|
||||
commandsRadio.connect('clicked', () => stack.set_visible_child_name('commands'));
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
@@ -0,0 +1,64 @@
|
||||
// SPDX-FileCopyrightText: 2021 Romain Vigier <contact AT romainvigier.fr>
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
const { Gio, GLib, GObject, Gtk } = imports.gi;
|
||||
const { extensionUtils } = imports.misc;
|
||||
|
||||
const Me = extensionUtils.getCurrentExtension();
|
||||
|
||||
const utils = Me.imports.utils;
|
||||
|
||||
const { DropDownChoice } = Me.imports.preferences.DropDownChoice;
|
||||
|
||||
|
||||
var IconPreferences = GObject.registerClass({
|
||||
GTypeName: 'IconPreferences',
|
||||
Template: `file://${GLib.build_filenamev([Me.path, 'preferences', 'ui', 'IconPreferences.ui'])}`,
|
||||
InternalChildren: [
|
||||
'enabled_switch',
|
||||
'day_dropdown',
|
||||
'night_dropdown',
|
||||
],
|
||||
Properties: {
|
||||
settings: GObject.ParamSpec.object(
|
||||
'settings',
|
||||
'Settings',
|
||||
'Icon GSettings',
|
||||
GObject.ParamFlags.READWRITE,
|
||||
Gio.Settings.$gtype
|
||||
),
|
||||
},
|
||||
}, class IconPreferences extends Gtk.Box {
|
||||
_init(props = {}) {
|
||||
super._init(props);
|
||||
this.settings = extensionUtils.getSettings(utils.getSettingsSchema('icon-variants'));
|
||||
|
||||
this.settings.bind(
|
||||
'enabled',
|
||||
this._enabled_switch,
|
||||
'active',
|
||||
Gio.SettingsBindFlags.DEFAULT
|
||||
);
|
||||
|
||||
const themeChoices = Gio.ListStore.new(DropDownChoice);
|
||||
themeChoices.splice(0, 0, Array.from(utils.getInstalledIconThemes()).sort().map(theme => new DropDownChoice({ id: theme, title: theme })));
|
||||
|
||||
this._day_dropdown.model = themeChoices;
|
||||
this._day_dropdown.expression = Gtk.PropertyExpression.new(DropDownChoice, null, 'title');
|
||||
this._day_dropdown.connect('notify::selected-item', () => this.settings.set_string('day', this._day_dropdown.selected_item.id));
|
||||
const updateDayDropDownSelected = () => {
|
||||
this._day_dropdown.selected = utils.findItemPositionInModel(this._day_dropdown.model, item => item.id === this.settings.get_string('day'));
|
||||
};
|
||||
this.settings.connect('changed::day', () => updateDayDropDownSelected());
|
||||
updateDayDropDownSelected();
|
||||
|
||||
this._night_dropdown.model = themeChoices;
|
||||
this._night_dropdown.expression = Gtk.PropertyExpression.new(DropDownChoice, null, 'title');
|
||||
this._night_dropdown.connect('notify::selected-item', () => this.settings.set_string('night', this._night_dropdown.selected_item.id));
|
||||
const updateNightDropDownSelected = () => {
|
||||
this._night_dropdown.selected = utils.findItemPositionInModel(this._night_dropdown.model, item => item.id === this.settings.get_string('night'));
|
||||
};
|
||||
this.settings.connect('changed::night', () => updateNightDropDownSelected());
|
||||
updateNightDropDownSelected();
|
||||
}
|
||||
});
|
||||
@@ -1,64 +0,0 @@
|
||||
// SPDX-FileCopyrightText: 2020, 2021 Romain Vigier <contact AT romainvigier.fr>
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
const { Gio, GLib, Gtk } = imports.gi;
|
||||
const { extensionUtils } = imports.misc;
|
||||
|
||||
const Me = extensionUtils.getCurrentExtension();
|
||||
|
||||
const utils = Me.imports.utils;
|
||||
|
||||
const Gettext = imports.gettext.domain(Me.metadata['gettext-domain']);
|
||||
const _ = Gettext.gettext;
|
||||
|
||||
|
||||
var IconThemePreferences = class {
|
||||
constructor(settings) {
|
||||
this._builder = new Gtk.Builder();
|
||||
this._builder.add_from_file(GLib.build_filenamev([Me.path, 'preferences', 'ui', 'icon_theme.ui']));
|
||||
|
||||
this.widget = this._builder.get_object('icon_theme');
|
||||
this.name = 'icon-theme';
|
||||
this.title = _('Icon theme');
|
||||
|
||||
this._connectSettings(settings);
|
||||
}
|
||||
|
||||
_connectSettings(settings) {
|
||||
const enabledSwitch = this._builder.get_object('enabled_switch');
|
||||
settings.iconVariants.settings.bind(
|
||||
'enabled',
|
||||
enabledSwitch,
|
||||
'active',
|
||||
Gio.SettingsBindFlags.DEFAULT
|
||||
);
|
||||
|
||||
const variants = this._builder.get_object('variants');
|
||||
settings.iconVariants.settings.bind(
|
||||
'enabled',
|
||||
variants,
|
||||
'sensitive',
|
||||
Gio.SettingsBindFlags.DEFAULT
|
||||
);
|
||||
|
||||
const installedIconThemes = Array.from(utils.getInstalledIconThemes()).sort();
|
||||
const dayCombo = this._builder.get_object('day_combo');
|
||||
const nightCombo = this._builder.get_object('night_combo');
|
||||
installedIconThemes.forEach(theme => {
|
||||
dayCombo.append(theme, theme);
|
||||
nightCombo.append(theme, theme);
|
||||
});
|
||||
settings.iconVariants.settings.bind(
|
||||
'day',
|
||||
dayCombo,
|
||||
'active-id',
|
||||
Gio.SettingsBindFlags.DEFAULT
|
||||
);
|
||||
settings.iconVariants.settings.bind(
|
||||
'night',
|
||||
nightCombo,
|
||||
'active-id',
|
||||
Gio.SettingsBindFlags.DEFAULT
|
||||
);
|
||||
}
|
||||
};
|
||||
@@ -1,55 +0,0 @@
|
||||
// SPDX-FileCopyrightText: 2020, 2021 Romain Vigier <contact AT romainvigier.fr>
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
const { Gdk, GLib, Gtk } = imports.gi;
|
||||
const { extensionUtils } = imports.misc;
|
||||
|
||||
const Me = extensionUtils.getCurrentExtension();
|
||||
|
||||
const Gettext = imports.gettext.domain(Me.metadata['gettext-domain']);
|
||||
const _ = Gettext.gettext;
|
||||
|
||||
const utils = Me.imports.utils;
|
||||
|
||||
|
||||
var OndemandKeyboardShortcutDialog = class {
|
||||
constructor(settings) {
|
||||
this._builder = new Gtk.Builder();
|
||||
this._builder.add_from_file(GLib.build_filenamev([Me.path, 'preferences', 'ui', 'ondemand_keyboard_shortcut_dialog.ui']));
|
||||
|
||||
this.widget = this._builder.get_object('dialog');
|
||||
|
||||
this._connectSettings(settings);
|
||||
|
||||
return this.widget;
|
||||
}
|
||||
|
||||
_connectSettings(settings) {
|
||||
const eventController = this._builder.get_object('event-controller');
|
||||
eventController.connect('key-pressed', (_widget, keyval, keycode, state) => {
|
||||
let mask = state & Gtk.accelerator_get_default_mod_mask();
|
||||
mask &= ~Gdk.ModifierType.LOCK_MASK;
|
||||
|
||||
if (mask === 0 && keyval === Gdk.KEY_Escape) {
|
||||
this.widget.visible = false;
|
||||
return Gdk.EVENT_STOP;
|
||||
}
|
||||
|
||||
if (
|
||||
!utils.isBindingValid({ mask, keycode, keyval }) ||
|
||||
!utils.isAccelValid({ mask, keyval })
|
||||
)
|
||||
return Gdk.EVENT_STOP;
|
||||
|
||||
const binding = Gtk.accelerator_name_with_keycode(
|
||||
null,
|
||||
keyval,
|
||||
keycode,
|
||||
mask
|
||||
);
|
||||
settings.time.ondemandKeybinding = binding;
|
||||
this.widget.close();
|
||||
return Gdk.EVENT_STOP;
|
||||
});
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,58 @@
|
||||
// SPDX-FileCopyrightText: 2021 Romain Vigier <contact AT romainvigier.fr>
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
const { GLib, GObject, Gtk } = imports.gi;
|
||||
const { extensionUtils } = imports.misc;
|
||||
|
||||
const Me = extensionUtils.getCurrentExtension();
|
||||
|
||||
|
||||
var PreferenceRow = GObject.registerClass({
|
||||
GTypeName: 'PreferenceRow',
|
||||
Template: `file://${GLib.build_filenamev([Me.path, 'preferences', 'ui', 'PreferenceRow.ui'])}`,
|
||||
InternalChildren: ['subtitle_label', 'end_box'],
|
||||
Properties: {
|
||||
title: GObject.ParamSpec.string(
|
||||
'title',
|
||||
'Title',
|
||||
'Title of the preference',
|
||||
GObject.ParamFlags.READWRITE,
|
||||
null
|
||||
),
|
||||
subtitle: GObject.ParamSpec.string(
|
||||
'subtitle',
|
||||
'Subtitle',
|
||||
'Description of the preference',
|
||||
GObject.ParamFlags.READWRITE,
|
||||
null
|
||||
),
|
||||
activatable_widget: GObject.ParamSpec.object(
|
||||
'activatable-widget',
|
||||
'Activatable widget',
|
||||
'The widget to activate when the row is activated',
|
||||
GObject.ParamFlags.READWRITE,
|
||||
Gtk.Widget.$gtype
|
||||
),
|
||||
},
|
||||
}, class PreferenceRow extends Gtk.ListBoxRow {
|
||||
activate() {
|
||||
if (this.activatable_widget)
|
||||
return this.activatable_widget.activate();
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
onSubtitleChanged(list) {
|
||||
list._subtitle_label.visible = !!list.subtitle;
|
||||
}
|
||||
|
||||
onActivatableWidgetChanged(list) {
|
||||
while (list._end_box.get_last_child())
|
||||
list._end_box.remove(list._end_box.get_last_child());
|
||||
list.activatable = false;
|
||||
if (list.activatable_widget) {
|
||||
list._end_box.append(list.activatable_widget);
|
||||
list.activatable = true;
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -1,57 +1,28 @@
|
||||
// SPDX-FileCopyrightText: 2020, 2021 Romain Vigier <contact AT romainvigier.fr>
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
const { Gtk } = imports.gi;
|
||||
const { GLib, GObject, Gtk } = imports.gi;
|
||||
const { extensionUtils } = imports.misc;
|
||||
|
||||
const Me = extensionUtils.getCurrentExtension();
|
||||
|
||||
const { Settings } = Me.imports.settings.Settings;
|
||||
|
||||
const { BackgroundsPreferences } = Me.imports.preferences.Backgrounds;
|
||||
const { CommandsPreferences } = Me.imports.preferences.Commands;
|
||||
const { CursorThemePreferences } = Me.imports.preferences.CursorTheme;
|
||||
const { GtkThemePreferences } = Me.imports.preferences.GtkTheme;
|
||||
const { IconThemePreferences } = Me.imports.preferences.IconTheme;
|
||||
const { SchedulePreferences } = Me.imports.preferences.Schedule;
|
||||
const { ShellThemePreferences } = Me.imports.preferences.ShellTheme;
|
||||
|
||||
const { Headerbar } = Me.imports.preferences.Headerbar;
|
||||
const { Appearance } = Me.imports.preferences.Appearance;
|
||||
const { BackgroundButton } = Me.imports.preferences.BackgroundButton;
|
||||
const { BackgroundsPreferences } = Me.imports.preferences.BackgroundsPreferences;
|
||||
const { ClearableEntry } = Me.imports.preferences.ClearableEntry;
|
||||
const { Commands } = Me.imports.preferences.Commands;
|
||||
const { CursorPreferences } = Me.imports.preferences.CursorPreferences;
|
||||
const { GtkPreferences } = Me.imports.preferences.GtkPreferences;
|
||||
const { IconPreferences } = Me.imports.preferences.IconPreferences;
|
||||
const { PreferenceRow } = Me.imports.preferences.PreferenceRow;
|
||||
const { PreferencesList } = Me.imports.preferences.PreferencesList;
|
||||
const { Schedule } = Me.imports.preferences.Schedule;
|
||||
const { ShellPreferences } = Me.imports.preferences.ShellPreferences;
|
||||
const { ShortcutButton } = Me.imports.preferences.ShortcutButton;
|
||||
const { TimeChooser } = Me.imports.preferences.TimeChooser;
|
||||
|
||||
|
||||
var Preferences = class {
|
||||
constructor() {
|
||||
this.settings = new Settings();
|
||||
this.settings.enable();
|
||||
|
||||
this.widget = new Gtk.Stack({
|
||||
interpolate_size: true,
|
||||
vhomogeneous: false,
|
||||
transition_type: Gtk.StackTransitionType.SLIDE_LEFT_RIGHT,
|
||||
visible: true,
|
||||
});
|
||||
|
||||
const schedulePreferences = new SchedulePreferences(this.settings);
|
||||
this.widget.add_titled(schedulePreferences.widget, schedulePreferences.name, schedulePreferences.title);
|
||||
|
||||
const gtkThemePreferences = new GtkThemePreferences(this.settings);
|
||||
this.widget.add_titled(gtkThemePreferences.widget, gtkThemePreferences.name, gtkThemePreferences.title);
|
||||
|
||||
const shellThemePreferences = new ShellThemePreferences(this.settings);
|
||||
this.widget.add_titled(shellThemePreferences.widget, shellThemePreferences.name, shellThemePreferences.title);
|
||||
|
||||
const iconThemePreferences = new IconThemePreferences(this.settings);
|
||||
this.widget.add_titled(iconThemePreferences.widget, iconThemePreferences.name, iconThemePreferences.title);
|
||||
|
||||
const cursorThemePreferences = new CursorThemePreferences(this.settings);
|
||||
this.widget.add_titled(cursorThemePreferences.widget, cursorThemePreferences.name, cursorThemePreferences.title);
|
||||
|
||||
const backgroundsPreferences = new BackgroundsPreferences(this.settings);
|
||||
this.widget.add_titled(backgroundsPreferences.widget, backgroundsPreferences.name, backgroundsPreferences.title);
|
||||
|
||||
const commandsPreferences = new CommandsPreferences(this.settings);
|
||||
this.widget.add_titled(commandsPreferences.widget, commandsPreferences.name, commandsPreferences.title);
|
||||
|
||||
this.headerbar = new Headerbar(this.widget);
|
||||
}
|
||||
};
|
||||
var Preferences = GObject.registerClass({
|
||||
GTypeName: 'Preferences',
|
||||
Template: `file://${GLib.build_filenamev([Me.path, 'preferences', 'ui', 'Preferences.ui'])}`,
|
||||
}, class Preferences extends Gtk.Stack {});
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
// SPDX-FileCopyrightText: 2021 Romain Vigier <contact AT romainvigier.fr>
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
const { Gio, GLib, GObject, Gtk } = imports.gi;
|
||||
const { extensionUtils } = imports.misc;
|
||||
|
||||
const Me = extensionUtils.getCurrentExtension();
|
||||
|
||||
|
||||
var PreferencesList = GObject.registerClass({
|
||||
GTypeName: 'PreferencesList',
|
||||
Template: `file://${GLib.build_filenamev([Me.path, 'preferences', 'ui', 'PreferencesList.ui'])}`,
|
||||
}, class PreferencesList extends Gtk.ListBox {
|
||||
onRowActivated(_list, row) {
|
||||
row.activate();
|
||||
}
|
||||
});
|
||||
+109
-189
@@ -1,229 +1,149 @@
|
||||
// SPDX-FileCopyrightText: 2020, 2021 Romain Vigier <contact AT romainvigier.fr>
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
const { Gio, GLib, Gtk } = imports.gi;
|
||||
const { Gio, GLib, GObject, Gtk } = imports.gi;
|
||||
const { extensionUtils } = imports.misc;
|
||||
|
||||
const Me = extensionUtils.getCurrentExtension();
|
||||
|
||||
const { OndemandKeyboardShortcutDialog } = Me.imports.preferences.OndemandKeyboardShortcutDialog;
|
||||
const utils = Me.imports.utils;
|
||||
|
||||
const { DropDownChoice } = Me.imports.preferences.DropDownChoice;
|
||||
|
||||
const Gettext = imports.gettext.domain(Me.metadata['gettext-domain']);
|
||||
const _ = Gettext.gettext;
|
||||
|
||||
|
||||
var SchedulePreferences = class {
|
||||
constructor(settings) {
|
||||
this._builder = new Gtk.Builder();
|
||||
this._builder.add_from_file(GLib.build_filenamev([Me.path, 'preferences', 'ui', 'schedule.ui']));
|
||||
var Schedule = GObject.registerClass({
|
||||
GTypeName: 'Schedule',
|
||||
Template: `file://${GLib.build_filenamev([Me.path, 'preferences', 'ui', 'Schedule.ui'])}`,
|
||||
InternalChildren: [
|
||||
'manual_time_source_switch',
|
||||
'time_source_dropdown',
|
||||
'always_show_ondemand_switch',
|
||||
'nightlight_preferences_revealer',
|
||||
'nightlight_follow_disable_switch',
|
||||
'schedule_preferences_revealer',
|
||||
'schedule_sunrise_time_chooser',
|
||||
'schedule_sunset_time_chooser',
|
||||
'ondemand_preferences_revealer',
|
||||
'ondemand_shortcut_button',
|
||||
'ondemand_button_location_combo',
|
||||
],
|
||||
Properties: {
|
||||
settings: GObject.ParamSpec.object(
|
||||
'settings',
|
||||
'Settings',
|
||||
'Time GSettings',
|
||||
GObject.ParamFlags.READWRITE,
|
||||
Gio.Settings.$gtype
|
||||
),
|
||||
},
|
||||
}, class Schedule extends Gtk.ScrolledWindow {
|
||||
_init(props = {}) {
|
||||
super._init(props);
|
||||
this.settings = extensionUtils.getSettings(utils.getSettingsSchema('time'));
|
||||
|
||||
this.widget = this._builder.get_object('schedule');
|
||||
this.name = 'schedule';
|
||||
this.title = _('Schedule');
|
||||
|
||||
this._connectSettings(settings);
|
||||
}
|
||||
|
||||
_connectSettings(settings) {
|
||||
const autoSwitch = this._builder.get_object('auto_switch');
|
||||
settings.time.settings.bind(
|
||||
this.settings.bind(
|
||||
'manual-time-source',
|
||||
autoSwitch,
|
||||
'active',
|
||||
Gio.SettingsBindFlags.INVERT_BOOLEAN
|
||||
);
|
||||
|
||||
const alwaysEnableOndemandSwitch = this._builder.get_object('always_enable_ondemand_switch');
|
||||
settings.time.settings.bind(
|
||||
'always-enable-ondemand',
|
||||
alwaysEnableOndemandSwitch,
|
||||
this._manual_time_source_switch,
|
||||
'active',
|
||||
Gio.SettingsBindFlags.DEFAULT
|
||||
);
|
||||
|
||||
const manual = this._builder.get_object('manual');
|
||||
settings.time.settings.bind(
|
||||
'manual-time-source',
|
||||
manual,
|
||||
'sensitive',
|
||||
Gio.SettingsBindFlags.DEFAULT
|
||||
);
|
||||
const choiceFilter = new Gtk.BoolFilter({ expression: Gtk.PropertyExpression.new(DropDownChoice, null, 'enabled') });
|
||||
|
||||
const manualNightlightRadio = this._builder.get_object('manual_nightlight_radio');
|
||||
const updateManualNightlightRadioActivity = () => {
|
||||
manualNightlightRadio.active = settings.time.timeSource === 'nightlight';
|
||||
};
|
||||
settings.time.connect('time-source-changed', () => updateManualNightlightRadioActivity());
|
||||
settings.system.colorSettings.bind(
|
||||
const colorSettings = new Gio.Settings({ schema: 'org.gnome.settings-daemon.plugins.color' });
|
||||
const nightlightChoice = new DropDownChoice({ id: 'nightlight', title: _('Night Light') });
|
||||
nightlightChoice.connect('notify::enabled', () => choiceFilter.changed(Gtk.FilterChange.DIFFERENT));
|
||||
colorSettings.bind(
|
||||
'night-light-enabled',
|
||||
manualNightlightRadio,
|
||||
'sensitive',
|
||||
Gio.SettingsBindFlags.DEFAULT
|
||||
);
|
||||
manualNightlightRadio.connect('toggled', () => {
|
||||
if (manualNightlightRadio.active)
|
||||
settings.time.timeSource = 'nightlight';
|
||||
});
|
||||
updateManualNightlightRadioActivity();
|
||||
|
||||
const manualLocationRadio = this._builder.get_object('manual_location_radio');
|
||||
const updateManualLocationRadioActivity = () => {
|
||||
manualLocationRadio.active = settings.time.timeSource === 'location';
|
||||
};
|
||||
settings.time.connect('time-source-changed', () => updateManualLocationRadioActivity());
|
||||
settings.system.locationSettings.bind(
|
||||
nightlightChoice,
|
||||
'enabled',
|
||||
manualLocationRadio,
|
||||
'sensitive',
|
||||
Gio.SettingsBindFlags.DEFAULT
|
||||
Gio.SettingsBindFlags.GET
|
||||
);
|
||||
manualLocationRadio.connect('toggled', () => {
|
||||
if (manualLocationRadio.active)
|
||||
settings.time.timeSource = 'location';
|
||||
|
||||
const locationSettings = new Gio.Settings({ schema: 'org.gnome.system.location' });
|
||||
const locationChoice = new DropDownChoice({ id: 'location', title: _('Location Services') });
|
||||
locationChoice.connect('notify::enabled', () => choiceFilter.changed(Gtk.FilterChange.DIFFERENT));
|
||||
locationSettings.bind(
|
||||
'enabled',
|
||||
locationChoice,
|
||||
'enabled',
|
||||
Gio.SettingsBindFlags.GET
|
||||
);
|
||||
|
||||
const timeSources = Gio.ListStore.new(DropDownChoice);
|
||||
timeSources.splice(0, 0, [
|
||||
nightlightChoice,
|
||||
locationChoice,
|
||||
new DropDownChoice({ id: 'schedule', title: _('Manual schedule') }),
|
||||
new DropDownChoice({ id: 'ondemand', title: _('On-demand') }),
|
||||
]);
|
||||
|
||||
this._time_source_dropdown.model = new Gtk.FilterListModel({
|
||||
model: timeSources,
|
||||
filter: choiceFilter,
|
||||
});
|
||||
updateManualLocationRadioActivity();
|
||||
|
||||
const manualScheduleRadio = this._builder.get_object('manual_schedule_radio');
|
||||
const updateManualScheduleRadioActivity = () => {
|
||||
manualScheduleRadio.active = settings.time.timeSource === 'schedule';
|
||||
this._time_source_dropdown.expression = Gtk.PropertyExpression.new(DropDownChoice, null, 'title');
|
||||
this._time_source_dropdown.connect('notify::selected-item', () => this.settings.set_string('time-source', this._time_source_dropdown.selected_item.id));
|
||||
const updateTimeSourceDropDownSelected = () => {
|
||||
this._time_source_dropdown.selected = utils.findItemPositionInModel(this._time_source_dropdown.model, item => item.id === this.settings.get_string('time-source'));
|
||||
};
|
||||
settings.time.connect('time-source-changed', () => updateManualScheduleRadioActivity());
|
||||
manualScheduleRadio.connect('toggled', () => {
|
||||
if (manualScheduleRadio.active)
|
||||
settings.time.timeSource = 'schedule';
|
||||
});
|
||||
updateManualScheduleRadioActivity();
|
||||
this.settings.connect('changed::time-source', () => updateTimeSourceDropDownSelected());
|
||||
updateTimeSourceDropDownSelected();
|
||||
|
||||
const manualOndemandRadio = this._builder.get_object('manual_ondemand_radio');
|
||||
const updateManualOndemandRadioActivity = () => {
|
||||
manualOndemandRadio.active = settings.time.timeSource === 'ondemand';
|
||||
};
|
||||
settings.time.connect('time-source-changed', () => updateManualOndemandRadioActivity());
|
||||
manualOndemandRadio.connect('toggled', () => {
|
||||
if (manualOndemandRadio.active)
|
||||
settings.time.timeSource = 'ondemand';
|
||||
});
|
||||
updateManualOndemandRadioActivity();
|
||||
|
||||
const manualPrefsStack = this._builder.get_object('manual_prefs_stack');
|
||||
const updateManualPrefsStackVisible = () => {
|
||||
switch (settings.time.timeSource) {
|
||||
case 'nightlight':
|
||||
manualPrefsStack.set_visible_child_name('nightlight');
|
||||
break;
|
||||
case 'schedule':
|
||||
manualPrefsStack.set_visible_child_name('schedule_times');
|
||||
break;
|
||||
default:
|
||||
manualPrefsStack.set_visible_child_name('none');
|
||||
}
|
||||
};
|
||||
settings.time.connect('time-source-changed', () => updateManualPrefsStackVisible());
|
||||
updateManualPrefsStackVisible();
|
||||
|
||||
const nightlightFollowDisableSwitch = this._builder.get_object('nightlight_follow_disable_switch');
|
||||
settings.time.settings.bind(
|
||||
'nightlight-follow-disable',
|
||||
nightlightFollowDisableSwitch,
|
||||
this.settings.bind(
|
||||
'always-enable-ondemand',
|
||||
this._always_show_ondemand_switch,
|
||||
'active',
|
||||
Gio.SettingsBindFlags.DEFAULT
|
||||
);
|
||||
|
||||
const scheduleTimesSunriseHoursSpin = this._builder.get_object('schedule_times_sunrise_hours_spin');
|
||||
scheduleTimesSunriseHoursSpin.value = Math.trunc(settings.time.scheduleSunrise);
|
||||
scheduleTimesSunriseHoursSpin.connect('output', () => {
|
||||
const text = scheduleTimesSunriseHoursSpin.adjustment.value.toString().padStart(2, '0');
|
||||
scheduleTimesSunriseHoursSpin.set_text(text);
|
||||
return true;
|
||||
});
|
||||
scheduleTimesSunriseHoursSpin.connect('value-changed', () => {
|
||||
const oldTime = settings.time.scheduleSunrise;
|
||||
const oldHour = Math.trunc(oldTime);
|
||||
const newMinutes = oldTime - oldHour;
|
||||
const newTime = scheduleTimesSunriseHoursSpin.value + newMinutes;
|
||||
settings.time.scheduleSunrise = newTime;
|
||||
});
|
||||
this.settings.bind(
|
||||
'nightlight-follow-disable',
|
||||
this._nightlight_follow_disable_switch,
|
||||
'active',
|
||||
Gio.SettingsBindFlags.DEFAULT
|
||||
);
|
||||
|
||||
const scheduleTimesSunriseMinutesSpin = this._builder.get_object('schedule_times_sunrise_minutes_spin');
|
||||
scheduleTimesSunriseMinutesSpin.value = Math.round((settings.time.scheduleSunrise - Math.trunc(settings.time.scheduleSunrise)) * 60);
|
||||
scheduleTimesSunriseMinutesSpin.connect('output', () => {
|
||||
const text = scheduleTimesSunriseMinutesSpin.adjustment.value.toString().padStart(2, '0');
|
||||
scheduleTimesSunriseMinutesSpin.set_text(text);
|
||||
return true;
|
||||
});
|
||||
scheduleTimesSunriseMinutesSpin.connect('value-changed', () => {
|
||||
const hour = Math.trunc(settings.time.scheduleSunrise);
|
||||
const newMinutes = scheduleTimesSunriseMinutesSpin.value / 60;
|
||||
const newTime = hour + newMinutes;
|
||||
settings.time.scheduleSunrise = newTime;
|
||||
});
|
||||
this.settings.bind(
|
||||
'schedule-sunrise',
|
||||
this._schedule_sunrise_time_chooser,
|
||||
'time',
|
||||
Gio.SettingsBindFlags.DEFAULT
|
||||
);
|
||||
|
||||
const scheduleTimesSunsetHoursSpin = this._builder.get_object('schedule_times_sunset_hours_spin');
|
||||
scheduleTimesSunsetHoursSpin.value = Math.trunc(settings.time.scheduleSunset);
|
||||
scheduleTimesSunsetHoursSpin.connect('output', () => {
|
||||
const text = scheduleTimesSunsetHoursSpin.adjustment.value.toString().padStart(2, '0');
|
||||
scheduleTimesSunsetHoursSpin.set_text(text);
|
||||
return true;
|
||||
});
|
||||
scheduleTimesSunsetHoursSpin.connect('value-changed', () => {
|
||||
const oldTime = settings.time.scheduleSunset;
|
||||
const oldHour = Math.trunc(oldTime);
|
||||
const newMinutes = oldTime - oldHour;
|
||||
const newTime = scheduleTimesSunsetHoursSpin.value + newMinutes;
|
||||
settings.time.scheduleSunset = newTime;
|
||||
});
|
||||
this.settings.bind(
|
||||
'schedule-sunset',
|
||||
this._schedule_sunset_time_chooser,
|
||||
'time',
|
||||
Gio.SettingsBindFlags.DEFAULT
|
||||
);
|
||||
|
||||
const scheduleTimesSunsetMinutesSpin = this._builder.get_object('schedule_times_sunset_minutes_spin');
|
||||
scheduleTimesSunsetMinutesSpin.value = Math.round((settings.time.scheduleSunset - Math.trunc(settings.time.scheduleSunset)) * 60);
|
||||
scheduleTimesSunsetMinutesSpin.connect('output', () => {
|
||||
const text = scheduleTimesSunsetMinutesSpin.adjustment.value.toString().padStart(2, '0');
|
||||
scheduleTimesSunsetMinutesSpin.set_text(text);
|
||||
return true;
|
||||
this.settings.connect('changed::nightthemeswitcher-ondemand-keybinding', () => {
|
||||
this._ondemand_shortcut_button.keybinding = this.settings.get_strv('nightthemeswitcher-ondemand-keybinding')[0];
|
||||
});
|
||||
scheduleTimesSunsetMinutesSpin.connect('value-changed', () => {
|
||||
const hour = Math.trunc(settings.time.scheduleSunset);
|
||||
const newMinutes = scheduleTimesSunsetMinutesSpin.value / 60;
|
||||
const newTime = hour + newMinutes;
|
||||
settings.time.scheduleSunset = newTime;
|
||||
this._ondemand_shortcut_button.connect('notify::keybinding', () => {
|
||||
this.settings.set_strv('nightthemeswitcher-ondemand-keybinding', [this._ondemand_shortcut_button.keybinding]);
|
||||
});
|
||||
this._ondemand_shortcut_button.keybinding = this.settings.get_strv('nightthemeswitcher-ondemand-keybinding')[0];
|
||||
|
||||
const ondemand = this._builder.get_object('ondemand');
|
||||
const updateOndemandVisibility = () => {
|
||||
ondemand.visible = settings.time.alwaysEnableOndemand || settings.time.timeSource === 'ondemand';
|
||||
};
|
||||
settings.time.connect('always-enable-ondemand-changed', () => updateOndemandVisibility());
|
||||
settings.time.connect('time-source-changed', () => updateOndemandVisibility());
|
||||
updateOndemandVisibility();
|
||||
|
||||
const ondemandShortcutButton = this._builder.get_object('ondemand_shortcut_button');
|
||||
const updateOndemandShortcutButtonLabel = () => {
|
||||
const label = settings.time.ondemandKeybinding;
|
||||
ondemandShortcutButton.label = label || _('Choose');
|
||||
};
|
||||
settings.time.connect('ondemand-keybinding-changed', () => updateOndemandShortcutButtonLabel());
|
||||
ondemandShortcutButton.connect('clicked', () => {
|
||||
const dialog = new OndemandKeyboardShortcutDialog(settings);
|
||||
dialog.set_transient_for(this.widget.get_root());
|
||||
dialog.present();
|
||||
});
|
||||
updateOndemandShortcutButtonLabel();
|
||||
|
||||
const ondemandShortcutClearButton = this._builder.get_object('ondemand_shortcut_clear_button');
|
||||
ondemandShortcutClearButton.connect('clicked', () => {
|
||||
settings.time.ondemandKeybinding = '';
|
||||
});
|
||||
const updateOndemandShortcutClearButtonVisibility = () => {
|
||||
ondemandShortcutClearButton.visible = !!settings.time.ondemandKeybinding;
|
||||
};
|
||||
settings.time.connect('ondemand-keybinding-changed', () => updateOndemandShortcutClearButtonVisibility());
|
||||
updateOndemandShortcutClearButtonVisibility();
|
||||
|
||||
const ondemandButtonPlacementCombo = this._builder.get_object('ondemand_button_placement_combo');
|
||||
settings.time.settings.bind(
|
||||
this.settings.bind(
|
||||
'ondemand-button-placement',
|
||||
ondemandButtonPlacementCombo,
|
||||
this._ondemand_button_location_combo,
|
||||
'active-id',
|
||||
Gio.SettingsBindFlags.DEFAULT
|
||||
);
|
||||
|
||||
const updatePreferencesVisibility = () => {
|
||||
const timeSource = this.settings.get_string('time-source');
|
||||
this._nightlight_preferences_revealer.reveal_child = timeSource === 'nightlight';
|
||||
this._schedule_preferences_revealer.reveal_child = timeSource === 'schedule';
|
||||
this._ondemand_preferences_revealer.reveal_child = timeSource === 'ondemand' || this.settings.get_boolean('always-enable-ondemand');
|
||||
};
|
||||
this.settings.connect('changed::time-source', () => updatePreferencesVisibility());
|
||||
this.settings.connect('changed::always-enable-ondemand', () => updatePreferencesVisibility());
|
||||
updatePreferencesVisibility();
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
@@ -0,0 +1,75 @@
|
||||
// SPDX-FileCopyrightText: 2021 Romain Vigier <contact AT romainvigier.fr>
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
const { Gio, GLib, GObject, Gtk } = imports.gi;
|
||||
const { extensionUtils } = imports.misc;
|
||||
|
||||
const Me = extensionUtils.getCurrentExtension();
|
||||
|
||||
const utils = Me.imports.utils;
|
||||
|
||||
const { DropDownChoice } = Me.imports.preferences.DropDownChoice;
|
||||
|
||||
const Gettext = imports.gettext.domain(Me.metadata['gettext-domain']);
|
||||
const _ = Gettext.gettext;
|
||||
|
||||
|
||||
var ShellPreferences = GObject.registerClass({
|
||||
GTypeName: 'ShellPreferences',
|
||||
Template: `file://${GLib.build_filenamev([Me.path, 'preferences', 'ui', 'ShellPreferences.ui'])}`,
|
||||
InternalChildren: [
|
||||
'enabled_switch',
|
||||
'manual_switch',
|
||||
'day_dropdown',
|
||||
'night_dropdown',
|
||||
],
|
||||
Properties: {
|
||||
settings: GObject.ParamSpec.object(
|
||||
'settings',
|
||||
'Settings',
|
||||
'Shell GSettings',
|
||||
GObject.ParamFlags.READWRITE,
|
||||
Gio.Settings.$gtype
|
||||
),
|
||||
},
|
||||
}, class ShellPreferences extends Gtk.Box {
|
||||
_init(props = {}) {
|
||||
super._init(props);
|
||||
this.settings = extensionUtils.getSettings(utils.getSettingsSchema('shell-variants'));
|
||||
|
||||
this.settings.bind(
|
||||
'enabled',
|
||||
this._enabled_switch,
|
||||
'active',
|
||||
Gio.SettingsBindFlags.DEFAULT
|
||||
);
|
||||
|
||||
this.settings.bind(
|
||||
'manual',
|
||||
this._manual_switch,
|
||||
'active',
|
||||
Gio.SettingsBindFlags.DEFAULT
|
||||
);
|
||||
|
||||
const themeChoices = Gio.ListStore.new(DropDownChoice);
|
||||
themeChoices.splice(0, 0, Array.from(utils.getInstalledShellThemes()).sort().map(theme => new DropDownChoice({ id: theme, title: theme || _('Default') })));
|
||||
|
||||
this._day_dropdown.model = themeChoices;
|
||||
this._day_dropdown.expression = Gtk.PropertyExpression.new(DropDownChoice, null, 'title');
|
||||
this._day_dropdown.connect('notify::selected-item', () => this.settings.set_string('day', this._day_dropdown.selected_item.id));
|
||||
const updateDayDropDownSelected = () => {
|
||||
this._day_dropdown.selected = utils.findItemPositionInModel(this._day_dropdown.model, item => item.id === this.settings.get_string('day'));
|
||||
};
|
||||
this.settings.connect('changed::day', () => updateDayDropDownSelected());
|
||||
updateDayDropDownSelected();
|
||||
|
||||
this._night_dropdown.model = themeChoices;
|
||||
this._night_dropdown.expression = Gtk.PropertyExpression.new(DropDownChoice, null, 'title');
|
||||
this._night_dropdown.connect('notify::selected-item', () => this.settings.set_string('night', this._night_dropdown.selected_item.id));
|
||||
const updateNightDropDownSelected = () => {
|
||||
this._night_dropdown.selected = utils.findItemPositionInModel(this._night_dropdown.model, item => item.id === this.settings.get_string('night'));
|
||||
};
|
||||
this.settings.connect('changed::night', () => updateNightDropDownSelected());
|
||||
updateNightDropDownSelected();
|
||||
}
|
||||
});
|
||||
@@ -1,81 +0,0 @@
|
||||
// SPDX-FileCopyrightText: 2020, 2021 Romain Vigier <contact AT romainvigier.fr>
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
const { Gio, GLib, Gtk } = imports.gi;
|
||||
const { extensionUtils } = imports.misc;
|
||||
|
||||
const Me = extensionUtils.getCurrentExtension();
|
||||
|
||||
const utils = Me.imports.utils;
|
||||
|
||||
const Gettext = imports.gettext.domain(Me.metadata['gettext-domain']);
|
||||
const _ = Gettext.gettext;
|
||||
|
||||
|
||||
var ShellThemePreferences = class {
|
||||
constructor(settings) {
|
||||
this._builder = new Gtk.Builder();
|
||||
this._builder.add_from_file(GLib.build_filenamev([Me.path, 'preferences', 'ui', 'shell_theme.ui']));
|
||||
|
||||
this.widget = this._builder.get_object('shell_theme');
|
||||
this.name = 'shell-theme';
|
||||
this.title = _('Shell theme');
|
||||
|
||||
this._connectSettings(settings);
|
||||
}
|
||||
|
||||
_connectSettings(settings) {
|
||||
const enabledSwitch = this._builder.get_object('enabled_switch');
|
||||
settings.shellVariants.settings.bind(
|
||||
'enabled',
|
||||
enabledSwitch,
|
||||
'active',
|
||||
Gio.SettingsBindFlags.DEFAULT
|
||||
);
|
||||
|
||||
const manual = this._builder.get_object('manual');
|
||||
settings.shellVariants.settings.bind(
|
||||
'enabled',
|
||||
manual,
|
||||
'sensitive',
|
||||
Gio.SettingsBindFlags.DEFAULT
|
||||
);
|
||||
|
||||
const manualSwitch = this._builder.get_object('manual_switch');
|
||||
settings.shellVariants.settings.bind(
|
||||
'manual',
|
||||
manualSwitch,
|
||||
'active',
|
||||
Gio.SettingsBindFlags.DEFAULT
|
||||
);
|
||||
|
||||
const variants = this._builder.get_object('variants');
|
||||
const updateVariantsSensitivity = () => {
|
||||
variants.sensitive = !!(settings.shellVariants.enabled && settings.shellVariants.manual);
|
||||
};
|
||||
settings.shellVariants.connect('status-changed', () => updateVariantsSensitivity());
|
||||
settings.shellVariants.connect('manual-changed', () => updateVariantsSensitivity());
|
||||
updateVariantsSensitivity();
|
||||
|
||||
const dayCombo = this._builder.get_object('day_combo');
|
||||
const nightCombo = this._builder.get_object('night_combo');
|
||||
const installedShellThemes = Array.from(utils.getInstalledShellThemes()).sort();
|
||||
installedShellThemes.forEach(theme => {
|
||||
const themeName = theme === '' ? _('Default') : theme;
|
||||
dayCombo.append(theme, themeName);
|
||||
nightCombo.append(theme, themeName);
|
||||
});
|
||||
settings.shellVariants.settings.bind(
|
||||
'day',
|
||||
dayCombo,
|
||||
'active-id',
|
||||
Gio.SettingsBindFlags.DEFAULT
|
||||
);
|
||||
settings.shellVariants.settings.bind(
|
||||
'night',
|
||||
nightCombo,
|
||||
'active-id',
|
||||
Gio.SettingsBindFlags.DEFAULT
|
||||
);
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,78 @@
|
||||
// SPDX-FileCopyrightText: 2021 Romain Vigier <contact AT romainvigier.fr>
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
const { Gdk, GLib, GObject, Gtk } = imports.gi;
|
||||
const { extensionUtils } = imports.misc;
|
||||
|
||||
const Me = extensionUtils.getCurrentExtension();
|
||||
|
||||
const utils = Me.imports.utils;
|
||||
|
||||
|
||||
var ShortcutButton = GObject.registerClass({
|
||||
GTypeName: 'ShortcutButton',
|
||||
Template: `file://${GLib.build_filenamev([Me.path, 'preferences', 'ui', 'ShortcutButton.ui'])}`,
|
||||
InternalChildren: ['choose_button', 'change_button', 'clear_button', 'dialog'],
|
||||
Properties: {
|
||||
keybinding: GObject.ParamSpec.string(
|
||||
'keybinding',
|
||||
'Keybinding',
|
||||
'Key sequence',
|
||||
GObject.ParamFlags.READWRITE,
|
||||
null
|
||||
),
|
||||
},
|
||||
}, class ShortcutButton extends Gtk.Stack {
|
||||
activate() {
|
||||
if (this.keybinding)
|
||||
return this._change_button.activate();
|
||||
else
|
||||
return this._choose_button.activate();
|
||||
}
|
||||
|
||||
openDialog() {
|
||||
this._dialog.transient_for = this.get_root();
|
||||
this._dialog.present();
|
||||
}
|
||||
|
||||
onKeybindingChanged(button) {
|
||||
button.visible_child_name = button.keybinding ? 'edit' : 'choose';
|
||||
}
|
||||
|
||||
onChooseButtonClicked(_button) {
|
||||
this.openDialog();
|
||||
}
|
||||
|
||||
onChangeButtonClicked(_button) {
|
||||
this.openDialog();
|
||||
}
|
||||
|
||||
onClearButtonClicked(_button) {
|
||||
this.keybinding = '';
|
||||
}
|
||||
|
||||
onKeyPressed(_widget, keyval, keycode, state) {
|
||||
let mask = state & Gtk.accelerator_get_default_mod_mask();
|
||||
mask &= ~Gdk.ModifierType.LOCK_MASK;
|
||||
|
||||
if (mask === 0 && keyval === Gdk.KEY_Escape) {
|
||||
this._dialog.close();
|
||||
return Gdk.EVENT_STOP;
|
||||
}
|
||||
|
||||
if (
|
||||
!utils.isBindingValid({ mask, keycode, keyval }) ||
|
||||
!utils.isAccelValid({ mask, keyval })
|
||||
)
|
||||
return Gdk.EVENT_STOP;
|
||||
|
||||
this.keybinding = Gtk.accelerator_name_with_keycode(
|
||||
null,
|
||||
keyval,
|
||||
keycode,
|
||||
mask
|
||||
);
|
||||
this._dialog.close();
|
||||
return Gdk.EVENT_STOP;
|
||||
}
|
||||
});
|
||||
@@ -0,0 +1,43 @@
|
||||
// SPDX-FileCopyrightText: 2021 Romain Vigier <contact AT romainvigier.fr>
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
const { GLib, GObject, Gtk } = imports.gi;
|
||||
const { extensionUtils } = imports.misc;
|
||||
|
||||
const Me = extensionUtils.getCurrentExtension();
|
||||
|
||||
|
||||
var TimeChooser = GObject.registerClass({
|
||||
GTypeName: 'TimeChooser',
|
||||
Template: `file://${GLib.build_filenamev([Me.path, 'preferences', 'ui', 'TimeChooser.ui'])}`,
|
||||
InternalChildren: ['hours', 'minutes'],
|
||||
Properties: {
|
||||
time: GObject.ParamSpec.double(
|
||||
'time',
|
||||
'Time',
|
||||
'The time of the chooser',
|
||||
GObject.ParamFlags.READWRITE,
|
||||
0,
|
||||
24,
|
||||
0
|
||||
),
|
||||
},
|
||||
}, class TimeChooser extends Gtk.Box {
|
||||
onTimeChanged(chooser) {
|
||||
const hours = Math.trunc(chooser.time);
|
||||
const minutes = Math.round((chooser.time - hours) * 60);
|
||||
chooser._hours.value = hours;
|
||||
chooser._minutes.value = minutes;
|
||||
}
|
||||
|
||||
onValueChanged(_spin) {
|
||||
const hours = this._hours.value;
|
||||
const minutes = this._minutes.value / 60;
|
||||
this.time = hours + minutes;
|
||||
}
|
||||
|
||||
onOutputChanged(spin) {
|
||||
spin.text = spin.value.toString().padStart(2, '0');
|
||||
return true;
|
||||
}
|
||||
});
|
||||
@@ -0,0 +1,42 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
SPDX-FileCopyrightText: 2021 Romain Vigier <contact AT romainvigier.fr>
|
||||
SPDX-License-Identifier: GPL-3.0-or-later
|
||||
-->
|
||||
<interface domain="nightthemeswitcher@romainvigier.fr">
|
||||
<template class="Appearance" parent="GtkScrolledWindow">
|
||||
<property name="propagate-natural-height">True</property>
|
||||
<property name="hscrollbar-policy">never</property>
|
||||
<child>
|
||||
<object class="GtkViewport">
|
||||
<property name="scroll-to-focus">True</property>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="width-request">600</property>
|
||||
<property name="halign">center</property>
|
||||
<property name="margin-start">36</property>
|
||||
<property name="margin-end">36</property>
|
||||
<property name="margin-top">36</property>
|
||||
<property name="margin-bottom">36</property>
|
||||
<child>
|
||||
<object class="GtkPreferences"/>
|
||||
</child>
|
||||
<child>
|
||||
<object class="ShellPreferences"/>
|
||||
</child>
|
||||
<child>
|
||||
<object class="IconPreferences"/>
|
||||
</child>
|
||||
<child>
|
||||
<object class="CursorPreferences"/>
|
||||
</child>
|
||||
<child>
|
||||
<object class="BackgroundsPreferences"/>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</template>
|
||||
</interface>
|
||||
@@ -0,0 +1,75 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
SPDX-FileCopyrightText: 2021 Romain Vigier <contact AT romainvigier.fr>
|
||||
SPDX-License-Identifier: GPL-3.0-or-later
|
||||
-->
|
||||
<interface domain="nightthemeswitcher@romainvigier.fr">
|
||||
<template class="BackgroundButton" parent="GtkStack">
|
||||
<property name="hhomogeneous">False</property>
|
||||
<signal name="notify::path" handler="onPathChanged" swapped="no"/>
|
||||
<child>
|
||||
<object class="GtkStackPage">
|
||||
<property name="name">choose</property>
|
||||
<property name="child">
|
||||
<object class="GtkButton" id="choose_button">
|
||||
<property name="label" translatable="yes">Choose…</property>
|
||||
<signal name="clicked" handler="onChooseButtonClicked" swapped="no"/>
|
||||
</object>
|
||||
</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkStackPage">
|
||||
<property name="name">edit</property>
|
||||
<property name="child">
|
||||
<object class="GtkBox">
|
||||
<property name="orientation">horizontal</property>
|
||||
<style>
|
||||
<class name="linked"/>
|
||||
</style>
|
||||
<child>
|
||||
<object class="GtkButton" id="change_button">
|
||||
<property name="tooltip-text" translatable="yes">Change background</property>
|
||||
<signal name="clicked" handler="onChangeButtonClicked" swapped="no"/>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="label" bind-source="BackgroundButton" bind-property="path"/>
|
||||
<property name="ellipsize">middle</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="clear_button">
|
||||
<property name="label" translatable="yes">Clear</property>
|
||||
<property name="icon-name">edit-delete-symbolic</property>
|
||||
<property name="tooltip-text" translatable="yes">Clear</property>
|
||||
<signal name="clicked" handler="onClearButtonClicked" swapped="no"/>
|
||||
<style>
|
||||
<class name="destructive-action"/>
|
||||
</style>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</property>
|
||||
</object>
|
||||
</child>
|
||||
</template>
|
||||
<object class="GtkFileChooserNative" id="filechooser">
|
||||
<property name="modal">True</property>
|
||||
<property name="action">open</property>
|
||||
<property name="title" translatable="yes">Select your background image</property>
|
||||
<property name="select-multiple">False</property>
|
||||
<signal name="response" handler="onFileChooserResponse" swapped="no"/>
|
||||
<property name="filter">
|
||||
<object class="GtkFileFilter">
|
||||
<mime-types>
|
||||
<mime-type>image/jpeg</mime-type>
|
||||
<mime-type>image/png</mime-type>
|
||||
<mime-type>image/tiff</mime-type>
|
||||
<mime-type>application/xml</mime-type>
|
||||
</mime-types>
|
||||
</object>
|
||||
</property>
|
||||
</object>
|
||||
</interface>
|
||||
@@ -0,0 +1,58 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
SPDX-FileCopyrightText: 2021 Romain Vigier <contact AT romainvigier.fr>
|
||||
SPDX-License-Identifier: GPL-3.0-or-later
|
||||
-->
|
||||
<interface domain="nightthemeswitcher@romainvigier.fr">
|
||||
<template class="BackgroundsPreferences" parent="GtkBox">
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="spacing">8</property>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="orientation">horizontal</property>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="label" translatable="yes">Switch backgrounds</property>
|
||||
<property name="valign">center</property>
|
||||
<property name="hexpand">True</property>
|
||||
<property name="xalign">0</property>
|
||||
<style>
|
||||
<class name="heading"/>
|
||||
</style>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSwitch" id="enabled_switch">
|
||||
<property name="valign">center</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkRevealer">
|
||||
<property name="reveal-child" bind-source="enabled_switch" bind-property="active" bind-flags="sync-create"/>
|
||||
<child>
|
||||
<object class="PreferencesList">
|
||||
<property name="margin-bottom">36</property>
|
||||
<child>
|
||||
<object class="PreferenceRow">
|
||||
<property name="title" translatable="yes">Day background</property>
|
||||
<property name="activatable-widget">
|
||||
<object class="BackgroundButton" id="day_button"/>
|
||||
</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="PreferenceRow">
|
||||
<property name="title" translatable="yes">Night background</property>
|
||||
<property name="activatable-widget">
|
||||
<object class="BackgroundButton" id="night_button"/>
|
||||
</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</template>
|
||||
</interface>
|
||||
@@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
SPDX-FileCopyrightText: 2021 Romain Vigier <contact AT romainvigier.fr>
|
||||
SPDX-License-Identifier: GPL-3.0-or-later
|
||||
-->
|
||||
<interface domain="nightthemeswitcher@romainvigier.fr">
|
||||
<template class="ClearableEntry" parent="GtkEntry">
|
||||
<property name="secondary-icon-name">edit-clear-symbolic</property>
|
||||
<property name="secondary-icon-activatable">True</property>
|
||||
<property name="secondary-icon-tooltip-text" translatable="yes">Clear</property>
|
||||
<signal name="icon-release" handler="onIconReleased" swapped="no"/>
|
||||
</template>
|
||||
</interface>
|
||||
@@ -0,0 +1,88 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
SPDX-FileCopyrightText: 2021 Romain Vigier <contact AT romainvigier.fr>
|
||||
SPDX-License-Identifier: GPL-3.0-or-later
|
||||
-->
|
||||
<interface domain="nightthemeswitcher@romainvigier.fr">
|
||||
<template class="Commands" parent="GtkScrolledWindow">
|
||||
<property name="propagate-natural-height">True</property>
|
||||
<property name="hscrollbar-policy">never</property>
|
||||
<child>
|
||||
<object class="GtkViewport">
|
||||
<property name="scroll-to-focus">True</property>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="width-request">600</property>
|
||||
<property name="halign">center</property>
|
||||
<property name="margin-start">36</property>
|
||||
<property name="margin-end">36</property>
|
||||
<property name="margin-top">36</property>
|
||||
<property name="margin-bottom">36</property>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="spacing">8</property>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="orientation">horizontal</property>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="label" translatable="yes">Run commands</property>
|
||||
<property name="valign">center</property>
|
||||
<property name="hexpand">True</property>
|
||||
<property name="xalign">0</property>
|
||||
<style>
|
||||
<class name="heading"/>
|
||||
</style>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSwitch" id="enabled_switch">
|
||||
<property name="valign">center</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkRevealer">
|
||||
<property name="reveal-child" bind-source="enabled_switch" bind-property="active" bind-flags="sync-create"/>
|
||||
<child>
|
||||
<object class="PreferencesList">
|
||||
<property name="margin-bottom">36</property>
|
||||
<child>
|
||||
<object class="PreferenceRow">
|
||||
<property name="title" translatable="yes">Sunrise</property>
|
||||
<property name="activatable-widget">
|
||||
<object class="ClearableEntry" id="sunrise_entry">
|
||||
<property name="placeholder-text" translatable="yes" comments="Don't translate the `notify-send` command.">notify-send "Hello sunshine!"</property>
|
||||
<property name="input-purpose">terminal</property>
|
||||
<property name="width-chars">28</property>
|
||||
</object>
|
||||
</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="PreferenceRow">
|
||||
<property name="title" translatable="yes">Sunset</property>
|
||||
<property name="activatable-widget">
|
||||
<object class="ClearableEntry" id="sunset_entry">
|
||||
<property name="placeholder-text" translatable="yes" comments="Don't translate the `notify-send` command.">notify-send "Hello moonshine!"</property>
|
||||
<property name="input-purpose">terminal</property>
|
||||
<property name="width-chars">28</property>
|
||||
</object>
|
||||
</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</template>
|
||||
</interface>
|
||||
@@ -0,0 +1,62 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
SPDX-FileCopyrightText: 2021 Romain Vigier <contact AT romainvigier.fr>
|
||||
SPDX-License-Identifier: GPL-3.0-or-later
|
||||
-->
|
||||
<interface domain="nightthemeswitcher@romainvigier.fr">
|
||||
<template class="CursorPreferences" parent="GtkBox">
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="spacing">8</property>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="orientation">horizontal</property>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="label" translatable="yes">Switch cursor theme variants</property>
|
||||
<property name="valign">center</property>
|
||||
<property name="hexpand">True</property>
|
||||
<property name="xalign">0</property>
|
||||
<style>
|
||||
<class name="heading"/>
|
||||
</style>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSwitch" id="enabled_switch">
|
||||
<property name="valign">center</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkRevealer">
|
||||
<property name="reveal-child" bind-source="enabled_switch" bind-property="active" bind-flags="sync-create"/>
|
||||
<child>
|
||||
<object class="PreferencesList">
|
||||
<property name="margin-bottom">36</property>
|
||||
<child>
|
||||
<object class="PreferenceRow">
|
||||
<property name="title" translatable="yes">Day variant</property>
|
||||
<property name="activatable-widget">
|
||||
<object class="GtkDropDown" id="day_dropdown">
|
||||
<property name="enable-search">True</property>
|
||||
</object>
|
||||
</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="PreferenceRow">
|
||||
<property name="title" translatable="yes">Night variant</property>
|
||||
<property name="activatable-widget">
|
||||
<object class="GtkDropDown" id="night_dropdown">
|
||||
<property name="enable-search">True</property>
|
||||
</object>
|
||||
</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</template>
|
||||
</interface>
|
||||
@@ -0,0 +1,73 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
SPDX-FileCopyrightText: 2021 Romain Vigier <contact AT romainvigier.fr>
|
||||
SPDX-License-Identifier: GPL-3.0-or-later
|
||||
-->
|
||||
<interface domain="nightthemeswitcher@romainvigier.fr">
|
||||
<template class="GtkPreferences" parent="GtkBox">
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="spacing">8</property>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="orientation">horizontal</property>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="label" translatable="yes">Switch GTK theme variants</property>
|
||||
<property name="valign">center</property>
|
||||
<property name="hexpand">True</property>
|
||||
<property name="xalign">0</property>
|
||||
<style>
|
||||
<class name="heading"/>
|
||||
</style>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSwitch" id="enabled_switch">
|
||||
<property name="valign">center</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkRevealer">
|
||||
<property name="reveal-child" bind-source="enabled_switch" bind-property="active" bind-flags="sync-create"/>
|
||||
<child>
|
||||
<object class="PreferencesList">
|
||||
<property name="margin-bottom">36</property>
|
||||
<child>
|
||||
<object class="PreferenceRow">
|
||||
<property name="title" translatable="yes">Manual variants</property>
|
||||
<property name="subtitle"><![CDATA[You can manually set variants if the extension cannot automatically detect the day and night variants of your GTK theme. Please <a href="https://gitlab.com/rmnvgr/nightthemeswitcher-gnome-shell-extension/-/issues">submit a request</a> to get your theme supported.]]></property>
|
||||
<property name="activatable-widget">
|
||||
<object class="GtkSwitch" id="manual_switch"/>
|
||||
</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="PreferenceRow">
|
||||
<property name="title" translatable="yes">Day variant</property>
|
||||
<property name="sensitive" bind-source="manual_switch" bind-property="active" bind-flags="sync-create"/>
|
||||
<property name="activatable-widget">
|
||||
<object class="GtkDropDown" id="day_dropdown">
|
||||
<property name="enable-search">True</property>
|
||||
</object>
|
||||
</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="PreferenceRow">
|
||||
<property name="title" translatable="yes">Night variant</property>
|
||||
<property name="sensitive" bind-source="manual_switch" bind-property="active" bind-flags="sync-create"/>
|
||||
<property name="activatable-widget">
|
||||
<object class="GtkDropDown" id="night_dropdown">
|
||||
<property name="enable-search">True</property>
|
||||
</object>
|
||||
</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</template>
|
||||
</interface>
|
||||
@@ -0,0 +1,108 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
SPDX-FileCopyrightText: 2021 Romain Vigier <contact AT romainvigier.fr>
|
||||
SPDX-License-Identifier: GPL-3.0-or-later
|
||||
-->
|
||||
<interface domain="nightthemeswitcher@romainvigier.fr">
|
||||
<template class="Headerbar" parent="GtkHeaderBar">
|
||||
<signal name="notify::preferences" handler="onPreferencesChanged" swapped="no"/>
|
||||
<child type="start">
|
||||
<object class="GtkMenuButton">
|
||||
<property name="icon-name">face-smile-big-symbolic</property>
|
||||
<property name="tooltip-text" translatable="yes">Support us</property>
|
||||
<property name="popover">
|
||||
<object class="GtkPopover">
|
||||
<style>
|
||||
<class name="support"/>
|
||||
</style>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="spacing">6</property>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="label" translatable="yes">Support us</property>
|
||||
<property name="margin-top">6</property>
|
||||
<property name="margin-bottom">6</property>
|
||||
<style>
|
||||
<class name="heading"/>
|
||||
</style>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLinkButton">
|
||||
<property name="uri">https://gitlab.com/rmnvgr/nightthemeswitcher-gnome-shell-extension</property>
|
||||
<style>
|
||||
<class name="gitlab"/>
|
||||
</style>
|
||||
<child>
|
||||
<object class="GtkCenterBox">
|
||||
<child type="start">
|
||||
<object class="GtkImage">
|
||||
<property name="icon-name">nightthemeswitcher-code-symbolic</property>
|
||||
<property name="margin-end">12</property>
|
||||
</object>
|
||||
</child>
|
||||
<child type="center">
|
||||
<object class="GtkLabel">
|
||||
<property name="label" translatable="yes">View code on GitLab</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLinkButton">
|
||||
<property name="uri">https://hosted.weblate.org/engage/night-theme-switcher/</property>
|
||||
<style>
|
||||
<class name="weblate"/>
|
||||
</style>
|
||||
<child>
|
||||
<object class="GtkCenterBox">
|
||||
<child type="start">
|
||||
<object class="GtkImage">
|
||||
<property name="icon-name">nightthemeswitcher-translate-symbolic</property>
|
||||
<property name="margin-end">12</property>
|
||||
</object>
|
||||
</child>
|
||||
<child type="center">
|
||||
<object class="GtkLabel">
|
||||
<property name="label" translatable="yes">Translate on Weblate</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLinkButton">
|
||||
<property name="uri">https://liberapay.com/rmnvgr/donate</property>
|
||||
<style>
|
||||
<class name="liberapay"/>
|
||||
</style>
|
||||
<child>
|
||||
<object class="GtkCenterBox">
|
||||
<child type="start">
|
||||
<object class="GtkImage">
|
||||
<property name="icon-name">nightthemeswitcher-support-symbolic</property>
|
||||
<property name="margin-end">12</property>
|
||||
</object>
|
||||
</child>
|
||||
<child type="center">
|
||||
<object class="GtkLabel">
|
||||
<property name="label" translatable="yes">Donate on Liberapay</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</property>
|
||||
</object>
|
||||
</child>
|
||||
</template>
|
||||
</interface>
|
||||
@@ -0,0 +1,62 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
SPDX-FileCopyrightText: 2021 Romain Vigier <contact AT romainvigier.fr>
|
||||
SPDX-License-Identifier: GPL-3.0-or-later
|
||||
-->
|
||||
<interface domain="nightthemeswitcher@romainvigier.fr">
|
||||
<template class="IconPreferences" parent="GtkBox">
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="spacing">8</property>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="orientation">horizontal</property>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="label" translatable="yes">Switch icon theme variants</property>
|
||||
<property name="valign">center</property>
|
||||
<property name="hexpand">True</property>
|
||||
<property name="xalign">0</property>
|
||||
<style>
|
||||
<class name="heading"/>
|
||||
</style>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSwitch" id="enabled_switch">
|
||||
<property name="valign">center</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkRevealer">
|
||||
<property name="reveal-child" bind-source="enabled_switch" bind-property="active" bind-flags="sync-create"/>
|
||||
<child>
|
||||
<object class="PreferencesList">
|
||||
<property name="margin-bottom">36</property>
|
||||
<child>
|
||||
<object class="PreferenceRow">
|
||||
<property name="title" translatable="yes">Day variant</property>
|
||||
<property name="activatable-widget">
|
||||
<object class="GtkDropDown" id="day_dropdown">
|
||||
<property name="enable-search">True</property>
|
||||
</object>
|
||||
</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="PreferenceRow">
|
||||
<property name="title" translatable="yes">Night variant</property>
|
||||
<property name="activatable-widget">
|
||||
<object class="GtkDropDown" id="night_dropdown">
|
||||
<property name="enable-search">True</property>
|
||||
</object>
|
||||
</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</template>
|
||||
</interface>
|
||||
@@ -0,0 +1,56 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
SPDX-FileCopyrightText: 2021 Romain Vigier <contact AT romainvigier.fr>
|
||||
SPDX-License-Identifier: GPL-3.0-or-later
|
||||
-->
|
||||
<interface domain="nightthemeswitcher@romainvigier.fr">
|
||||
<template class="PreferenceRow" parent="GtkListBoxRow">
|
||||
<property name="activatable">False</property>
|
||||
<signal name="notify::subtitle" handler="onSubtitleChanged" swapped="no"/>
|
||||
<signal name="notify::activatable-widget" handler="onActivatableWidgetChanged" swapped="no"/>
|
||||
<property name="child">
|
||||
<object class="GtkBox">
|
||||
<property name="orientation">horizontal</property>
|
||||
<property name="margin-start">6</property>
|
||||
<property name="margin-end">6</property>
|
||||
<property name="margin-top">6</property>
|
||||
<property name="margin-bottom">6</property>
|
||||
<property name="spacing">72</property>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="valign">center</property>
|
||||
<property name="hexpand">True</property>
|
||||
<property name="spacing">4</property>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="label" bind-source="PreferenceRow" bind-property="title"/>
|
||||
<property name="use-markup">True</property>
|
||||
<property name="xalign">0</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="subtitle_label">
|
||||
<property name="visible">False</property>
|
||||
<property name="label" bind-source="PreferenceRow" bind-property="subtitle"/>
|
||||
<property name="use-markup">True</property>
|
||||
<property name="wrap">True</property>
|
||||
<property name="max-width-chars">50</property>
|
||||
<property name="xalign">0</property>
|
||||
<style>
|
||||
<class name="dim-label"/>
|
||||
<class name="caption"/>
|
||||
</style>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkBox" id="end_box">
|
||||
<property name="valign">center</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</property>
|
||||
</template>
|
||||
</interface>
|
||||
@@ -0,0 +1,42 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
SPDX-FileCopyrightText: 2021 Romain Vigier <contact AT romainvigier.fr>
|
||||
SPDX-License-Identifier: GPL-3.0-or-later
|
||||
-->
|
||||
<interface domain="nightthemeswitcher@romainvigier.fr">
|
||||
<template class="Preferences" parent="GtkStack">
|
||||
<property name="interpolate-size">True</property>
|
||||
<property name="vhomogeneous">True</property>
|
||||
<property name="transition-type">crossfade</property>
|
||||
<child>
|
||||
<object class="GtkStackPage">
|
||||
<property name="name">schedule</property>
|
||||
<property name="title" translatable="yes">Schedule</property>
|
||||
<property name="icon-name">nightthemeswitcher-schedule-symbolic</property>
|
||||
<property name="child">
|
||||
<object class="Schedule"/>
|
||||
</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkStackPage">
|
||||
<property name="name">appearance</property>
|
||||
<property name="title" translatable="yes">Appearance</property>
|
||||
<property name="icon-name">nightthemeswitcher-appearance-symbolic</property>
|
||||
<property name="child">
|
||||
<object class="Appearance"/>
|
||||
</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkStackPage">
|
||||
<property name="name">commands</property>
|
||||
<property name="title" translatable="yes">Commands</property>
|
||||
<property name="icon-name">nightthemeswitcher-commands-symbolic</property>
|
||||
<property name="child">
|
||||
<object class="Commands"/>
|
||||
</property>
|
||||
</object>
|
||||
</child>
|
||||
</template>
|
||||
</interface>
|
||||
@@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
SPDX-FileCopyrightText: 2021 Romain Vigier <contact AT romainvigier.fr>
|
||||
SPDX-License-Identifier: GPL-3.0-or-later
|
||||
-->
|
||||
<interface domain="nightthemeswitcher@romainvigier.fr">
|
||||
<template class="PreferencesList" parent="GtkListBox">
|
||||
<signal name="row-activated" handler="onRowActivated" swapped="no"/>
|
||||
<property name="show-separators">True</property>
|
||||
<property name="selection-mode">none</property>
|
||||
<property name="activate-on-single-click">True</property>
|
||||
<style>
|
||||
<class name="rich-list"/>
|
||||
<class name="frame"/>
|
||||
</style>
|
||||
</template>
|
||||
</interface>
|
||||
@@ -0,0 +1,179 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
SPDX-FileCopyrightText: 2021 Romain Vigier <contact AT romainvigier.fr>
|
||||
SPDX-License-Identifier: GPL-3.0-or-later
|
||||
-->
|
||||
<interface domain="nightthemeswitcher@romainvigier.fr">
|
||||
<template class="Schedule" parent="GtkScrolledWindow">
|
||||
<property name="propagate-natural-height">True</property>
|
||||
<property name="hscrollbar-policy">never</property>
|
||||
<child>
|
||||
<object class="GtkViewport">
|
||||
<property name="scroll-to-focus">True</property>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="width-request">600</property>
|
||||
<property name="halign">center</property>
|
||||
<property name="margin-start">36</property>
|
||||
<property name="margin-end">36</property>
|
||||
<property name="margin-top">36</property>
|
||||
<property name="margin-bottom">36</property>
|
||||
<child>
|
||||
<object class="PreferencesList">
|
||||
<property name="margin-bottom">36</property>
|
||||
<child>
|
||||
<object class="PreferenceRow">
|
||||
<property name="title" translatable="yes">Manual time source</property>
|
||||
<property name="subtitle" translatable="yes">The extension will try to use Night Light or Location Services to automatically set your current sunrise and sunset times if they are enabled. If you prefer, you can manually choose a time source.</property>
|
||||
<property name="activatable-widget">
|
||||
<object class="GtkSwitch" id="manual_time_source_switch"/>
|
||||
</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="PreferenceRow">
|
||||
<property name="title" translatable="yes">Time source</property>
|
||||
<property name="sensitive" bind-source="manual_time_source_switch" bind-property="active" bind-flags="sync-create"/>
|
||||
<property name="activatable-widget">
|
||||
<object class="GtkDropDown" id="time_source_dropdown"/>
|
||||
</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="PreferenceRow">
|
||||
<property name="title" translatable="yes">Always show on-demand controls</property>
|
||||
<property name="subtitle" translatable="yes">Allows you to override the current time when using a schedule.</property>
|
||||
<property name="activatable-widget">
|
||||
<object class="GtkSwitch" id="always_show_ondemand_switch"/>
|
||||
</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkRevealer" id="nightlight_preferences_revealer">
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="spacing">8</property>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="label" translatable="yes">Night Light</property>
|
||||
<property name="xalign">0</property>
|
||||
<style>
|
||||
<class name="heading"/>
|
||||
</style>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="PreferencesList">
|
||||
<property name="margin-bottom">36</property>
|
||||
<child>
|
||||
<object class="PreferenceRow">
|
||||
<property name="title" translatable="yes"><![CDATA[Follow <i>Disable until tomorrow</i>]]></property>
|
||||
<property name="subtitle" translatable="yes">When Night Light is temporarily disabled, the extension will switch to day variants.</property>
|
||||
<property name="activatable-widget">
|
||||
<object class="GtkSwitch" id="nightlight_follow_disable_switch"/>
|
||||
</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkRevealer" id="schedule_preferences_revealer">
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="spacing">8</property>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="label" translatable="yes">Manual schedule times</property>
|
||||
<property name="xalign">0</property>
|
||||
<style>
|
||||
<class name="heading"/>
|
||||
</style>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="PreferencesList">
|
||||
<property name="margin-bottom">36</property>
|
||||
<child>
|
||||
<object class="PreferenceRow">
|
||||
<property name="title" translatable="yes">Sunrise</property>
|
||||
<property name="activatable-widget">
|
||||
<object class="TimeChooser" id="schedule_sunrise_time_chooser"/>
|
||||
</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="PreferenceRow">
|
||||
<property name="title" translatable="yes">Sunset</property>
|
||||
<property name="activatable-widget">
|
||||
<object class="TimeChooser" id="schedule_sunset_time_chooser"/>
|
||||
</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkRevealer" id="ondemand_preferences_revealer">
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="spacing">8</property>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="label" translatable="yes">On-demand</property>
|
||||
<property name="xalign">0</property>
|
||||
<style>
|
||||
<class name="heading"/>
|
||||
</style>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="PreferencesList">
|
||||
<property name="margin-bottom">36</property>
|
||||
<child>
|
||||
<object class="PreferenceRow">
|
||||
<property name="title" translatable="yes">Keyboard shortcut</property>
|
||||
<property name="activatable-widget">
|
||||
<object class="ShortcutButton" id="ondemand_shortcut_button"/>
|
||||
</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="PreferenceRow">
|
||||
<property name="title" translatable="yes">Button location</property>
|
||||
<property name="activatable-widget">
|
||||
<object class="GtkComboBoxText" id="ondemand_button_location_combo">
|
||||
<property name="active-id">panel</property>
|
||||
<items>
|
||||
<item id="none" translatable="yes">None</item>
|
||||
<item id="panel" translatable="yes">Top bar</item>
|
||||
<item id="menu" translatable="yes">System menu</item>
|
||||
</items>
|
||||
</object>
|
||||
</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</template>
|
||||
</interface>
|
||||
@@ -0,0 +1,73 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
SPDX-FileCopyrightText: 2021 Romain Vigier <contact AT romainvigier.fr>
|
||||
SPDX-License-Identifier: GPL-3.0-or-later
|
||||
-->
|
||||
<interface domain="nightthemeswitcher@romainvigier.fr">
|
||||
<template class="ShellPreferences" parent="GtkBox">
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="spacing">8</property>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="orientation">horizontal</property>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="label" translatable="yes">Switch Shell theme variants</property>
|
||||
<property name="valign">center</property>
|
||||
<property name="hexpand">True</property>
|
||||
<property name="xalign">0</property>
|
||||
<style>
|
||||
<class name="heading"/>
|
||||
</style>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSwitch" id="enabled_switch">
|
||||
<property name="valign">center</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkRevealer">
|
||||
<property name="reveal-child" bind-source="enabled_switch" bind-property="active" bind-flags="sync-create"/>
|
||||
<child>
|
||||
<object class="PreferencesList">
|
||||
<property name="margin-bottom">36</property>
|
||||
<child>
|
||||
<object class="PreferenceRow">
|
||||
<property name="title" translatable="yes">Manual variants</property>
|
||||
<property name="subtitle"><![CDATA[You can manually set variants if the extension cannot automatically detect the day and night variants of your GNOME Shell theme. Please <a href="https://gitlab.com/rmnvgr/nightthemeswitcher-gnome-shell-extension/-/issues">submit a request</a> to get your theme supported.]]></property>
|
||||
<property name="activatable-widget">
|
||||
<object class="GtkSwitch" id="manual_switch"/>
|
||||
</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="PreferenceRow">
|
||||
<property name="title" translatable="yes">Day variant</property>
|
||||
<property name="sensitive" bind-source="manual_switch" bind-property="active" bind-flags="sync-create"/>
|
||||
<property name="activatable-widget">
|
||||
<object class="GtkDropDown" id="day_dropdown">
|
||||
<property name="enable-search">True</property>
|
||||
</object>
|
||||
</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="PreferenceRow">
|
||||
<property name="title" translatable="yes">Night variant</property>
|
||||
<property name="sensitive" bind-source="manual_switch" bind-property="active" bind-flags="sync-create"/>
|
||||
<property name="activatable-widget">
|
||||
<object class="GtkDropDown" id="night_dropdown">
|
||||
<property name="enable-search">True</property>
|
||||
</object>
|
||||
</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</template>
|
||||
</interface>
|
||||
@@ -0,0 +1,120 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
SPDX-FileCopyrightText: 2021 Romain Vigier <contact AT romainvigier.fr>
|
||||
SPDX-License-Identifier: GPL-3.0-or-later
|
||||
-->
|
||||
<interface domain="nightthemeswitcher@romainvigier.fr">
|
||||
<template class="ShortcutButton" parent="GtkStack">
|
||||
<property name="hhomogeneous">False</property>
|
||||
<signal name="notify::keybinding" handler="onKeybindingChanged" swapped="no"/>
|
||||
<child>
|
||||
<object class="GtkStackPage">
|
||||
<property name="name">choose</property>
|
||||
<property name="child">
|
||||
<object class="GtkButton" id="choose_button">
|
||||
<property name="label" translatable="yes">Choose…</property>
|
||||
<signal name="clicked" handler="onChooseButtonClicked" swapped="no"/>
|
||||
</object>
|
||||
</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkStackPage">
|
||||
<property name="name">edit</property>
|
||||
<property name="child">
|
||||
<object class="GtkBox">
|
||||
<property name="orientation">horizontal</property>
|
||||
<style>
|
||||
<class name="linked"/>
|
||||
</style>
|
||||
<child>
|
||||
<object class="GtkButton" id="change_button">
|
||||
<property name="tooltip-text" translatable="yes">Change keyboard shortcut</property>
|
||||
<signal name="clicked" handler="onChangeButtonClicked" swapped="no"/>
|
||||
<child>
|
||||
<object class="GtkShortcutLabel">
|
||||
<property name="accelerator" bind-source="ShortcutButton" bind-property="keybinding"/>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="clear_button">
|
||||
<property name="label" translatable="yes">Clear</property>
|
||||
<property name="icon-name">edit-delete-symbolic</property>
|
||||
<property name="tooltip-text" translatable="yes">Clear</property>
|
||||
<signal name="clicked" handler="onClearButtonClicked" swapped="no"/>
|
||||
<style>
|
||||
<class name="destructive-action"/>
|
||||
</style>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</property>
|
||||
</object>
|
||||
</child>
|
||||
</template>
|
||||
<object class="GtkWindow" id="dialog">
|
||||
<property name="modal">True</property>
|
||||
<property name="default_width">440</property>
|
||||
<property name="default_height">200</property>
|
||||
<property name="hide-on-close">True</property>
|
||||
<property name="decorated">False</property>
|
||||
<style>
|
||||
<class name="toolbox"/>
|
||||
</style>
|
||||
<child>
|
||||
<object class="GtkWindowHandle">
|
||||
<property name="vexpand">True</property>
|
||||
<property name="hexpand">True</property>
|
||||
<child>
|
||||
<object class="GtkOverlay">
|
||||
<child type="overlay">
|
||||
<object class="GtkCenterBox">
|
||||
<property name="valign">start</property>
|
||||
<property name="margin-start">6</property>
|
||||
<property name="margin-end">6</property>
|
||||
<property name="margin-top">6</property>
|
||||
<child type="start">
|
||||
<object class="GtkWindowControls">
|
||||
<property name="side">start</property>
|
||||
</object>
|
||||
</child>
|
||||
<child type="end">
|
||||
<object class="GtkWindowControls">
|
||||
<property name="side">end</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="vexpand">True</property>
|
||||
<property name="hexpand">True</property>
|
||||
<property name="margin-start">36</property>
|
||||
<property name="margin-end">36</property>
|
||||
<property name="margin-top">36</property>
|
||||
<property name="margin-bottom">36</property>
|
||||
<property name="label" translatable="yes">Press your keyboard shortcut…</property>
|
||||
<property name="justify">center</property>
|
||||
<property name="wrap">True</property>
|
||||
<style>
|
||||
<class name="large-title"/>
|
||||
</style>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkEventControllerKey">
|
||||
<signal name="key-pressed" handler="onKeyPressed" swapped="no"/>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</interface>
|
||||
@@ -0,0 +1,47 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
SPDX-FileCopyrightText: 2021 Romain Vigier <contact AT romainvigier.fr>
|
||||
SPDX-License-Identifier: GPL-3.0-or-later
|
||||
-->
|
||||
<interface domain="nightthemeswitcher@romainvigier.fr">
|
||||
<template class="TimeChooser" parent="GtkBox">
|
||||
<property name="orientation">horizontal</property>
|
||||
<property name="spacing">8</property>
|
||||
<signal name="notify::time" handler="onTimeChanged" swapped="no"/>
|
||||
<child>
|
||||
<object class="GtkSpinButton" id="hours">
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="numeric">True</property>
|
||||
<property name="wrap">True</property>
|
||||
<property name="adjustment">hours_adjustment</property>
|
||||
<signal name="value-changed" handler="onValueChanged" swapped="no"/>
|
||||
<signal name="output" handler="onOutputChanged" swapped="no"/>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="label" translatable="yes" comments="Time separator (eg. 08:27)">:</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSpinButton" id="minutes">
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="numeric">True</property>
|
||||
<property name="wrap">True</property>
|
||||
<property name="adjustment">minutes_adjustment</property>
|
||||
<signal name="value-changed" handler="onValueChanged" swapped="no"/>
|
||||
<signal name="output" handler="onOutputChanged" swapped="no"/>
|
||||
</object>
|
||||
</child>
|
||||
</template>
|
||||
<object class="GtkAdjustment" id="hours_adjustment">
|
||||
<property name="lower">0</property>
|
||||
<property name="upper">23</property>
|
||||
<property name="step-increment">1</property>
|
||||
</object>
|
||||
<object class="GtkAdjustment" id="minutes_adjustment">
|
||||
<property name="lower">0</property>
|
||||
<property name="upper">59</property>
|
||||
<property name="step-increment">1</property>
|
||||
</object>
|
||||
</interface>
|
||||
@@ -1,201 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
SPDX-FileCopyrightText: 2021 Romain Vigier <contact AT romainvigier.fr>
|
||||
SPDX-License-Identifier: GPL-3.0-or-later
|
||||
-->
|
||||
<interface domain="nightthemeswitcher@romainvigier.fr">
|
||||
<requires lib="gtk" version="4.0"/>
|
||||
<object class="GtkFileFilter" id="image_filter">
|
||||
<mime-types>
|
||||
<mime-type>image/jpeg</mime-type>
|
||||
<mime-type>image/png</mime-type>
|
||||
<mime-type>image/tiff</mime-type>
|
||||
<mime-type>application/xml</mime-type>
|
||||
</mime-types>
|
||||
</object>
|
||||
<object class="GtkFileChooserNative" id="day_chooser">
|
||||
<property name="modal">1</property>
|
||||
<property name="action">open</property>
|
||||
<property name="title" translatable="yes">Select your background image</property>
|
||||
<property name="select-multiple">0</property>
|
||||
<property name="filter">image_filter</property>
|
||||
</object>
|
||||
<object class="GtkFileChooserNative" id="night_chooser">
|
||||
<property name="modal">1</property>
|
||||
<property name="action">open</property>
|
||||
<property name="title" translatable="yes">Select your background image</property>
|
||||
<property name="select-multiple">0</property>
|
||||
<property name="filter">image_filter</property>
|
||||
</object>
|
||||
<object class="GtkBox" id="backgrounds">
|
||||
<property name="width_request">600</property>
|
||||
<property name="halign">center</property>
|
||||
<property name="valign">start</property>
|
||||
<property name="margin_start">36</property>
|
||||
<property name="margin_end">36</property>
|
||||
<property name="margin_top">36</property>
|
||||
<property name="margin_bottom">36</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="spacing">30</property>
|
||||
<property name="baseline_position">top</property>
|
||||
<child>
|
||||
<object class="GtkFrame" id="enabled">
|
||||
<property name="child">
|
||||
<object class="GtkListBox">
|
||||
<property name="width_request">600</property>
|
||||
<property name="selection_mode">none</property>
|
||||
<child>
|
||||
<object class="GtkListBoxRow">
|
||||
<property name="activatable">0</property>
|
||||
<property name="child">
|
||||
<object class="GtkBox">
|
||||
<property name="margin_start">16</property>
|
||||
<property name="margin_end">16</property>
|
||||
<property name="margin_top">16</property>
|
||||
<property name="margin_bottom">16</property>
|
||||
<property name="spacing">30</property>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="label" translatable="yes">Switch backgrounds</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSwitch" id="enabled_switch">
|
||||
<property name="hexpand">1</property>
|
||||
<property name="halign">end</property>
|
||||
<property name="valign">center</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkBox" id="choosers">
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="spacing">8</property>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="halign">start</property>
|
||||
<property name="label" translatable="yes">Backgrounds</property>
|
||||
<attributes>
|
||||
<attribute name="weight" value="bold"></attribute>
|
||||
</attributes>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkFrame">
|
||||
<property name="child">
|
||||
<object class="GtkListBox">
|
||||
<property name="width_request">600</property>
|
||||
<property name="selection_mode">none</property>
|
||||
<child>
|
||||
<object class="GtkListBoxRow">
|
||||
<property name="activatable">0</property>
|
||||
<property name="child">
|
||||
<object class="GtkBox">
|
||||
<property name="margin_start">16</property>
|
||||
<property name="margin_end">16</property>
|
||||
<property name="margin_top">16</property>
|
||||
<property name="margin_bottom">16</property>
|
||||
<property name="spacing">30</property>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="label" translatable="yes">Day background</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="hexpand">1</property>
|
||||
<property name="halign">end</property>
|
||||
<child>
|
||||
<object class="GtkButton" id="day_chooser_button">
|
||||
<property name="halign">end</property>
|
||||
<property name="valign">center</property>
|
||||
<property name="label" translatable="yes">Choose...</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="day_clear_button">
|
||||
<property name="label" translatable="yes">Clear</property>
|
||||
<property name="receives_default">1</property>
|
||||
<style>
|
||||
<class name="destructive-action"/>
|
||||
</style>
|
||||
</object>
|
||||
</child>
|
||||
<style>
|
||||
<class name="linked"/>
|
||||
</style>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkListBoxRow">
|
||||
<property name="activatable">0</property>
|
||||
<property name="selectable">0</property>
|
||||
<property name="child">
|
||||
<object class="GtkSeparator">
|
||||
</object>
|
||||
</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkListBoxRow">
|
||||
<property name="activatable">0</property>
|
||||
<property name="child">
|
||||
<object class="GtkBox">
|
||||
<property name="margin_start">16</property>
|
||||
<property name="margin_end">16</property>
|
||||
<property name="margin_top">16</property>
|
||||
<property name="margin_bottom">16</property>
|
||||
<property name="spacing">30</property>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="label" translatable="yes">Night background</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="hexpand">1</property>
|
||||
<property name="halign">end</property>
|
||||
<child>
|
||||
<object class="GtkButton" id="night_chooser_button">
|
||||
<property name="halign">end</property>
|
||||
<property name="valign">center</property>
|
||||
<property name="label" translatable="yes">Choose...</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="night_clear_button">
|
||||
<property name="label" translatable="yes">Clear</property>
|
||||
<property name="receives_default">1</property>
|
||||
<style>
|
||||
<class name="destructive-action"/>
|
||||
</style>
|
||||
</object>
|
||||
</child>
|
||||
<style>
|
||||
<class name="linked"/>
|
||||
</style>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</interface>
|
||||
@@ -1,203 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
SPDX-FileCopyrightText: 2021 Romain Vigier <contact AT romainvigier.fr>
|
||||
SPDX-License-Identifier: GPL-3.0-or-later
|
||||
-->
|
||||
<interface domain="nightthemeswitcher@romainvigier.fr">
|
||||
<requires lib="gtk" version="4.0"/>
|
||||
<object class="GtkBox" id="commands">
|
||||
<property name="width_request">600</property>
|
||||
<property name="halign">center</property>
|
||||
<property name="valign">start</property>
|
||||
<property name="margin_start">36</property>
|
||||
<property name="margin_end">36</property>
|
||||
<property name="margin_top">36</property>
|
||||
<property name="margin_bottom">36</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="spacing">30</property>
|
||||
<property name="baseline_position">top</property>
|
||||
<child>
|
||||
<object class="GtkFrame" id="enabled">
|
||||
<property name="child">
|
||||
<object class="GtkListBox">
|
||||
<property name="width_request">600</property>
|
||||
<property name="selection_mode">none</property>
|
||||
<child>
|
||||
<object class="GtkListBoxRow">
|
||||
<property name="activatable">0</property>
|
||||
<property name="child">
|
||||
<object class="GtkBox">
|
||||
<property name="margin_start">16</property>
|
||||
<property name="margin_end">16</property>
|
||||
<property name="margin_top">16</property>
|
||||
<property name="margin_bottom">16</property>
|
||||
<property name="spacing">30</property>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="orientation">vertical</property>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="halign">start</property>
|
||||
<property name="label" translatable="yes">Run commands</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="valign">center</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="label" translatable="yes"><small>You can set custom commands that will be run when the time of the day changes.</small></property>
|
||||
<property name="use_markup">1</property>
|
||||
<property name="wrap">1</property>
|
||||
<property name="max_width_chars">50</property>
|
||||
<property name="xalign">0</property>
|
||||
<style>
|
||||
<class name="dim-label"/>
|
||||
</style>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSwitch" id="enabled_switch">
|
||||
<property name="hexpand">1</property>
|
||||
<property name="halign">end</property>
|
||||
<property name="valign">center</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkBox" id="entries">
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="spacing">8</property>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="halign">start</property>
|
||||
<property name="label" translatable="yes">Commands</property>
|
||||
<attributes>
|
||||
<attribute name="weight" value="bold"></attribute>
|
||||
</attributes>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkFrame">
|
||||
<property name="child">
|
||||
<object class="GtkListBox">
|
||||
<property name="width_request">600</property>
|
||||
<property name="selection_mode">none</property>
|
||||
<child>
|
||||
<object class="GtkListBoxRow">
|
||||
<property name="activatable">0</property>
|
||||
<property name="child">
|
||||
<object class="GtkBox">
|
||||
<property name="margin_start">16</property>
|
||||
<property name="margin_end">16</property>
|
||||
<property name="margin_top">16</property>
|
||||
<property name="margin_bottom">16</property>
|
||||
<property name="spacing">30</property>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="label" translatable="yes">Sunrise command</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="hexpand">1</property>
|
||||
<property name="halign">end</property>
|
||||
<child>
|
||||
<object class="GtkEntry" id="sunrise_entry">
|
||||
<property name="halign">end</property>
|
||||
<property name="valign">center</property>
|
||||
<property name="width_chars">28</property>
|
||||
<property name="truncate_multiline">1</property>
|
||||
<property name="placeholder_text" translatable="yes">notify-send "Hello sunshine!"</property>
|
||||
<property name="input_purpose">terminal</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="sunrise_clear_button">
|
||||
<property name="label" translatable="yes">Clear</property>
|
||||
<style>
|
||||
<class name="destructive-action"/>
|
||||
</style>
|
||||
</object>
|
||||
</child>
|
||||
<style>
|
||||
<class name="linked"/>
|
||||
</style>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkListBoxRow">
|
||||
<property name="activatable">0</property>
|
||||
<property name="selectable">0</property>
|
||||
<property name="child">
|
||||
<object class="GtkSeparator">
|
||||
</object>
|
||||
</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkListBoxRow">
|
||||
<property name="activatable">0</property>
|
||||
<property name="child">
|
||||
<object class="GtkBox">
|
||||
<property name="margin_start">16</property>
|
||||
<property name="margin_end">16</property>
|
||||
<property name="margin_top">16</property>
|
||||
<property name="margin_bottom">16</property>
|
||||
<property name="spacing">30</property>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="label" translatable="yes">Sunset command</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="hexpand">1</property>
|
||||
<property name="halign">end</property>
|
||||
<child>
|
||||
<object class="GtkEntry" id="sunset_entry">
|
||||
<property name="halign">end</property>
|
||||
<property name="valign">center</property>
|
||||
<property name="width_chars">28</property>
|
||||
<property name="truncate_multiline">1</property>
|
||||
<property name="placeholder_text" translatable="yes">notify-send "Hello moonshine!"</property>
|
||||
<property name="input_purpose">terminal</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="sunset_clear_button">
|
||||
<property name="label" translatable="yes">Clear</property>
|
||||
<style>
|
||||
<class name="destructive-action"/>
|
||||
</style>
|
||||
</object>
|
||||
</child>
|
||||
<style>
|
||||
<class name="linked"/>
|
||||
</style>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</interface>
|
||||
@@ -1,144 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
SPDX-FileCopyrightText: 2021 Romain Vigier <contact AT romainvigier.fr>
|
||||
SPDX-License-Identifier: GPL-3.0-or-later
|
||||
-->
|
||||
<interface domain="nightthemeswitcher@romainvigier.fr">
|
||||
<requires lib="gtk" version="4.0"/>
|
||||
<object class="GtkBox" id="cursor_theme">
|
||||
<property name="width_request">600</property>
|
||||
<property name="halign">center</property>
|
||||
<property name="valign">start</property>
|
||||
<property name="margin_start">36</property>
|
||||
<property name="margin_end">36</property>
|
||||
<property name="margin_top">36</property>
|
||||
<property name="margin_bottom">36</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="spacing">30</property>
|
||||
<property name="baseline_position">top</property>
|
||||
<child>
|
||||
<object class="GtkFrame" id="enabled">
|
||||
<property name="child">
|
||||
<object class="GtkListBox">
|
||||
<property name="width_request">600</property>
|
||||
<property name="selection_mode">none</property>
|
||||
<child>
|
||||
<object class="GtkListBoxRow">
|
||||
<property name="activatable">0</property>
|
||||
<property name="child">
|
||||
<object class="GtkBox">
|
||||
<property name="margin_start">16</property>
|
||||
<property name="margin_end">16</property>
|
||||
<property name="margin_top">16</property>
|
||||
<property name="margin_bottom">16</property>
|
||||
<property name="spacing">30</property>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="label" translatable="yes">Switch cursor variants</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSwitch" id="enabled_switch">
|
||||
<property name="hexpand">1</property>
|
||||
<property name="halign">end</property>
|
||||
<property name="valign">center</property>
|
||||
<property name="active">1</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkBox" id="variants">
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="spacing">8</property>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="halign">start</property>
|
||||
<property name="label" translatable="yes">Variants</property>
|
||||
<attributes>
|
||||
<attribute name="weight" value="bold"></attribute>
|
||||
</attributes>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkFrame">
|
||||
<property name="child">
|
||||
<object class="GtkListBox">
|
||||
<property name="width_request">600</property>
|
||||
<property name="selection_mode">none</property>
|
||||
<child>
|
||||
<object class="GtkListBoxRow">
|
||||
<property name="activatable">0</property>
|
||||
<property name="child">
|
||||
<object class="GtkBox">
|
||||
<property name="margin_start">16</property>
|
||||
<property name="margin_end">16</property>
|
||||
<property name="margin_top">16</property>
|
||||
<property name="margin_bottom">16</property>
|
||||
<property name="spacing">30</property>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="label" translatable="yes">Day variant</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkComboBoxText" id="day_combo">
|
||||
<property name="hexpand">1</property>
|
||||
<property name="halign">end</property>
|
||||
<property name="valign">center</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkListBoxRow">
|
||||
<property name="activatable">0</property>
|
||||
<property name="selectable">0</property>
|
||||
<property name="child">
|
||||
<object class="GtkSeparator">
|
||||
</object>
|
||||
</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkListBoxRow">
|
||||
<property name="activatable">0</property>
|
||||
<property name="child">
|
||||
<object class="GtkBox">
|
||||
<property name="margin_start">16</property>
|
||||
<property name="margin_end">16</property>
|
||||
<property name="margin_top">16</property>
|
||||
<property name="margin_bottom">16</property>
|
||||
<property name="spacing">30</property>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="label" translatable="yes">Night variant</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkComboBoxText" id="night_combo">
|
||||
<property name="hexpand">1</property>
|
||||
<property name="halign">end</property>
|
||||
<property name="valign">center</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</interface>
|
||||
@@ -1,203 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
SPDX-FileCopyrightText: 2021 Romain Vigier <contact AT romainvigier.fr>
|
||||
SPDX-License-Identifier: GPL-3.0-or-later
|
||||
-->
|
||||
<interface domain="nightthemeswitcher@romainvigier.fr">
|
||||
<requires lib="gtk" version="4.0"/>
|
||||
<object class="GtkBox" id="gtk_theme">
|
||||
<property name="width_request">600</property>
|
||||
<property name="halign">center</property>
|
||||
<property name="valign">start</property>
|
||||
<property name="margin_start">36</property>
|
||||
<property name="margin_end">36</property>
|
||||
<property name="margin_top">36</property>
|
||||
<property name="margin_bottom">36</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="spacing">30</property>
|
||||
<property name="baseline_position">top</property>
|
||||
<child>
|
||||
<object class="GtkFrame" id="enabled">
|
||||
<property name="child">
|
||||
<object class="GtkListBox">
|
||||
<property name="width_request">600</property>
|
||||
<property name="selection_mode">none</property>
|
||||
<child>
|
||||
<object class="GtkListBoxRow">
|
||||
<property name="activatable">0</property>
|
||||
<property name="child">
|
||||
<object class="GtkBox">
|
||||
<property name="margin_start">16</property>
|
||||
<property name="margin_end">16</property>
|
||||
<property name="margin_top">16</property>
|
||||
<property name="margin_bottom">16</property>
|
||||
<property name="spacing">30</property>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="label" translatable="yes">Switch GTK variants</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSwitch" id="enabled_switch">
|
||||
<property name="hexpand">1</property>
|
||||
<property name="halign">end</property>
|
||||
<property name="valign">center</property>
|
||||
<property name="active">1</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</property>
|
||||
<child type="label_item">
|
||||
<placeholder/>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkFrame" id="manual">
|
||||
<property name="child">
|
||||
<object class="GtkListBox">
|
||||
<property name="width_request">600</property>
|
||||
<property name="selection_mode">none</property>
|
||||
<child>
|
||||
<object class="GtkListBoxRow">
|
||||
<property name="activatable">0</property>
|
||||
<property name="child">
|
||||
<object class="GtkBox">
|
||||
<property name="margin_start">16</property>
|
||||
<property name="margin_end">16</property>
|
||||
<property name="margin_top">16</property>
|
||||
<property name="margin_bottom">16</property>
|
||||
<property name="spacing">30</property>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="orientation">vertical</property>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="halign">start</property>
|
||||
<property name="label" translatable="yes">Manual variants</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="valign">center</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="label" translatable="yes"><small>You can manually set variants if the extension cannot automatically detect the day and night variants of your GTK theme. Please <a href="https://gitlab.com/rmnvgr/nightthemeswitcher-gnome-shell-extension/-/issues">submit a request</a> to get your theme supported.</small></property>
|
||||
<property name="use_markup">1</property>
|
||||
<property name="wrap">1</property>
|
||||
<property name="max_width_chars">50</property>
|
||||
<property name="xalign">0</property>
|
||||
<style>
|
||||
<class name="dim-label"/>
|
||||
</style>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSwitch" id="manual_switch">
|
||||
<property name="hexpand">1</property>
|
||||
<property name="halign">end</property>
|
||||
<property name="valign">center</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkBox" id="variants">
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="spacing">8</property>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="halign">start</property>
|
||||
<property name="label" translatable="yes">Manual variants</property>
|
||||
<attributes>
|
||||
<attribute name="weight" value="bold"></attribute>
|
||||
</attributes>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkFrame">
|
||||
<property name="child">
|
||||
<object class="GtkListBox">
|
||||
<property name="width_request">600</property>
|
||||
<property name="selection_mode">none</property>
|
||||
<child>
|
||||
<object class="GtkListBoxRow">
|
||||
<property name="activatable">0</property>
|
||||
<property name="child">
|
||||
<object class="GtkBox">
|
||||
<property name="margin_start">16</property>
|
||||
<property name="margin_end">16</property>
|
||||
<property name="margin_top">16</property>
|
||||
<property name="margin_bottom">16</property>
|
||||
<property name="spacing">30</property>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="label" translatable="yes">Day variant</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkComboBoxText" id="day_combo">
|
||||
<property name="hexpand">1</property>
|
||||
<property name="halign">end</property>
|
||||
<property name="valign">center</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkListBoxRow">
|
||||
<property name="activatable">0</property>
|
||||
<property name="selectable">0</property>
|
||||
<property name="child">
|
||||
<object class="GtkSeparator">
|
||||
</object>
|
||||
</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkListBoxRow">
|
||||
<property name="activatable">0</property>
|
||||
<property name="child">
|
||||
<object class="GtkBox">
|
||||
<property name="margin_start">16</property>
|
||||
<property name="margin_end">16</property>
|
||||
<property name="margin_top">16</property>
|
||||
<property name="margin_bottom">16</property>
|
||||
<property name="spacing">30</property>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="label" translatable="yes">Night variant</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkComboBoxText" id="night_combo">
|
||||
<property name="hexpand">1</property>
|
||||
<property name="halign">end</property>
|
||||
<property name="valign">center</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</interface>
|
||||
@@ -1,214 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
SPDX-FileCopyrightText: 2021 Romain Vigier <contact AT romainvigier.fr>
|
||||
SPDX-License-Identifier: GPL-3.0-or-later
|
||||
-->
|
||||
<interface domain="nightthemeswitcher@romainvigier.fr">
|
||||
<requires lib="gtk" version="4.0"/>
|
||||
<object class="GtkHeaderBar" id="headerbar">
|
||||
<child type="title">
|
||||
<object class="GtkBox" id="switcher">
|
||||
<property name="homogeneous">1</property>
|
||||
<child>
|
||||
<object class="GtkToggleButton" id="schedule_radio">
|
||||
<property name="focus_on_click">0</property>
|
||||
<property name="active">1</property>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="margin_top">4</property>
|
||||
<property name="margin_bottom">4</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="spacing">4</property>
|
||||
<child>
|
||||
<object class="GtkImage">
|
||||
<property name="icon_name">nightthemeswitcher-schedule-symbolic</property>
|
||||
<property name="icon_size">1</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="label" translatable="yes">Schedule</property>
|
||||
<attributes>
|
||||
<attribute name="size" value="8192"></attribute>
|
||||
</attributes>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkToggleButton" id="gtk_theme_radio">
|
||||
<property name="focus_on_click">0</property>
|
||||
<property name="group">schedule_radio</property>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="margin_top">4</property>
|
||||
<property name="margin_bottom">4</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="spacing">4</property>
|
||||
<child>
|
||||
<object class="GtkImage">
|
||||
<property name="icon_name">nightthemeswitcher-gtktheme-symbolic</property>
|
||||
<property name="icon_size">1</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="label" translatable="yes">GTK theme</property>
|
||||
<attributes>
|
||||
<attribute name="size" value="8192"></attribute>
|
||||
</attributes>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkToggleButton" id="shell_theme_radio">
|
||||
<property name="focus_on_click">0</property>
|
||||
<property name="group">schedule_radio</property>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="margin_top">4</property>
|
||||
<property name="margin_bottom">4</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="spacing">4</property>
|
||||
<child>
|
||||
<object class="GtkImage">
|
||||
<property name="icon_name">nightthemeswitcher-shelltheme-symbolic</property>
|
||||
<property name="icon_size">1</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="label" translatable="yes">Shell theme</property>
|
||||
<attributes>
|
||||
<attribute name="size" value="8192"></attribute>
|
||||
</attributes>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkToggleButton" id="icon_theme_radio">
|
||||
<property name="focus_on_click">0</property>
|
||||
<property name="group">schedule_radio</property>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="margin_top">4</property>
|
||||
<property name="margin_bottom">4</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="spacing">4</property>
|
||||
<child>
|
||||
<object class="GtkImage">
|
||||
<property name="icon_name">nightthemeswitcher-icontheme-symbolic</property>
|
||||
<property name="icon_size">1</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="label" translatable="yes">Icon theme</property>
|
||||
<attributes>
|
||||
<attribute name="size" value="8192"></attribute>
|
||||
</attributes>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkToggleButton" id="cursor_theme_radio">
|
||||
<property name="focus_on_click">0</property>
|
||||
<property name="group">schedule_radio</property>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="margin_top">4</property>
|
||||
<property name="margin_bottom">4</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="spacing">4</property>
|
||||
<child>
|
||||
<object class="GtkImage">
|
||||
<property name="icon_name">nightthemeswitcher-cursortheme-symbolic</property>
|
||||
<property name="icon_size">1</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="label" translatable="yes">Cursor theme</property>
|
||||
<attributes>
|
||||
<attribute name="size" value="8192"></attribute>
|
||||
</attributes>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkToggleButton" id="backgrounds_radio">
|
||||
<property name="focus_on_click">0</property>
|
||||
<property name="group">schedule_radio</property>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="margin_top">4</property>
|
||||
<property name="margin_bottom">4</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="spacing">4</property>
|
||||
<child>
|
||||
<object class="GtkImage">
|
||||
<property name="icon_name">nightthemeswitcher-backgrounds-symbolic</property>
|
||||
<property name="icon_size">1</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="label" translatable="yes">Backgrounds</property>
|
||||
<attributes>
|
||||
<attribute name="size" value="8192"></attribute>
|
||||
</attributes>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkToggleButton" id="commands_radio">
|
||||
<property name="focus_on_click">0</property>
|
||||
<property name="group">schedule_radio</property>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="margin_top">4</property>
|
||||
<property name="margin_bottom">4</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="spacing">4</property>
|
||||
<child>
|
||||
<object class="GtkImage">
|
||||
<property name="icon_name">nightthemeswitcher-commands-symbolic</property>
|
||||
<property name="icon_size">1</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="label" translatable="yes">Commands</property>
|
||||
<attributes>
|
||||
<attribute name="size" value="8192"></attribute>
|
||||
</attributes>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<style>
|
||||
<class name="linked"/>
|
||||
</style>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</interface>
|
||||
@@ -1,144 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
SPDX-FileCopyrightText: 2021 Romain Vigier <contact AT romainvigier.fr>
|
||||
SPDX-License-Identifier: GPL-3.0-or-later
|
||||
-->
|
||||
<interface domain="nightthemeswitcher@romainvigier.fr">
|
||||
<requires lib="gtk" version="4.0"/>
|
||||
<object class="GtkBox" id="icon_theme">
|
||||
<property name="width_request">600</property>
|
||||
<property name="halign">center</property>
|
||||
<property name="valign">start</property>
|
||||
<property name="margin_start">36</property>
|
||||
<property name="margin_end">36</property>
|
||||
<property name="margin_top">36</property>
|
||||
<property name="margin_bottom">36</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="spacing">30</property>
|
||||
<property name="baseline_position">top</property>
|
||||
<child>
|
||||
<object class="GtkFrame" id="enabled">
|
||||
<property name="child">
|
||||
<object class="GtkListBox">
|
||||
<property name="width_request">600</property>
|
||||
<property name="selection_mode">none</property>
|
||||
<child>
|
||||
<object class="GtkListBoxRow">
|
||||
<property name="activatable">0</property>
|
||||
<property name="child">
|
||||
<object class="GtkBox">
|
||||
<property name="margin_start">16</property>
|
||||
<property name="margin_end">16</property>
|
||||
<property name="margin_top">16</property>
|
||||
<property name="margin_bottom">16</property>
|
||||
<property name="spacing">30</property>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="label" translatable="yes">Switch icon variants</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSwitch" id="enabled_switch">
|
||||
<property name="hexpand">1</property>
|
||||
<property name="halign">end</property>
|
||||
<property name="valign">center</property>
|
||||
<property name="active">1</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkBox" id="variants">
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="spacing">8</property>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="halign">start</property>
|
||||
<property name="label" translatable="yes">Variants</property>
|
||||
<attributes>
|
||||
<attribute name="weight" value="bold"></attribute>
|
||||
</attributes>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkFrame">
|
||||
<property name="child">
|
||||
<object class="GtkListBox">
|
||||
<property name="width_request">600</property>
|
||||
<property name="selection_mode">none</property>
|
||||
<child>
|
||||
<object class="GtkListBoxRow">
|
||||
<property name="activatable">0</property>
|
||||
<property name="child">
|
||||
<object class="GtkBox">
|
||||
<property name="margin_start">16</property>
|
||||
<property name="margin_end">16</property>
|
||||
<property name="margin_top">16</property>
|
||||
<property name="margin_bottom">16</property>
|
||||
<property name="spacing">30</property>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="label" translatable="yes">Day variant</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkComboBoxText" id="day_combo">
|
||||
<property name="hexpand">1</property>
|
||||
<property name="halign">end</property>
|
||||
<property name="valign">center</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkListBoxRow">
|
||||
<property name="activatable">0</property>
|
||||
<property name="selectable">0</property>
|
||||
<property name="child">
|
||||
<object class="GtkSeparator">
|
||||
</object>
|
||||
</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkListBoxRow">
|
||||
<property name="activatable">0</property>
|
||||
<property name="child">
|
||||
<object class="GtkBox">
|
||||
<property name="margin_start">16</property>
|
||||
<property name="margin_end">16</property>
|
||||
<property name="margin_top">16</property>
|
||||
<property name="margin_bottom">16</property>
|
||||
<property name="spacing">30</property>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="label" translatable="yes">Night variant</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkComboBoxText" id="night_combo">
|
||||
<property name="hexpand">1</property>
|
||||
<property name="halign">end</property>
|
||||
<property name="valign">center</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</interface>
|
||||
@@ -1,43 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
SPDX-FileCopyrightText: 2021 Romain Vigier <contact AT romainvigier.fr>
|
||||
SPDX-License-Identifier: GPL-3.0-or-later
|
||||
-->
|
||||
<interface domain="nightthemeswitcher@romainvigier.fr">
|
||||
<requires lib="gtk" version="4.0"/>
|
||||
<object class="GtkDialog" id="dialog">
|
||||
<property name="modal">1</property>
|
||||
<property name="default_width">440</property>
|
||||
<property name="default_height">200</property>
|
||||
<child internal-child="content_area">
|
||||
<object class="GtkBox">
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="spacing">2</property>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="vexpand">1</property>
|
||||
<property name="label" translatable="yes">Press your keyboard shortcut...</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child type="titlebar">
|
||||
<object class="GtkHeaderBar">
|
||||
<property name="title-widget">
|
||||
<object class="GtkLabel">
|
||||
<property name="label" translatable="yes">Keyboard shortcut</property>
|
||||
<property name="single-line-mode">1</property>
|
||||
<property name="ellipsize">end</property>
|
||||
<property name="width-chars">5</property>
|
||||
<style>
|
||||
<class name="title"/>
|
||||
</style>
|
||||
</object>
|
||||
</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkEventControllerKey" id="event-controller"/>
|
||||
</child>
|
||||
</object>
|
||||
</interface>
|
||||
@@ -1,599 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
SPDX-FileCopyrightText: 2021 Romain Vigier <contact AT romainvigier.fr>
|
||||
SPDX-License-Identifier: GPL-3.0-or-later
|
||||
-->
|
||||
<interface domain="nightthemeswitcher@romainvigier.fr">
|
||||
<requires lib="gtk" version="4.0"/>
|
||||
<object class="GtkAdjustment" id="sunrise_hours_adjustment">
|
||||
<property name="upper">23</property>
|
||||
<property name="step-increment">1</property>
|
||||
</object>
|
||||
<object class="GtkAdjustment" id="sunrise_minutes_adjustment">
|
||||
<property name="upper">59</property>
|
||||
<property name="step-increment">1</property>
|
||||
</object>
|
||||
<object class="GtkAdjustment" id="sunset_hours_adjustment">
|
||||
<property name="upper">23</property>
|
||||
<property name="step-increment">1</property>
|
||||
</object>
|
||||
<object class="GtkAdjustment" id="sunset_minutes_adjustment">
|
||||
<property name="upper">59</property>
|
||||
<property name="step-increment">1</property>
|
||||
</object>
|
||||
<object class="GtkBox" id="schedule">
|
||||
<property name="width-request">600</property>
|
||||
<property name="can-focus">0</property>
|
||||
<property name="halign">center</property>
|
||||
<property name="valign">start</property>
|
||||
<property name="margin-start">36</property>
|
||||
<property name="margin-end">36</property>
|
||||
<property name="margin-top">36</property>
|
||||
<property name="margin-bottom">36</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="spacing">30</property>
|
||||
<property name="baseline-position">top</property>
|
||||
<child>
|
||||
<object class="GtkFrame" id="general">
|
||||
<property name="can-focus">0</property>
|
||||
<property name="child">
|
||||
<object class="GtkListBox">
|
||||
<property name="width-request">600</property>
|
||||
<property name="can-focus">0</property>
|
||||
<property name="selection-mode">none</property>
|
||||
<child>
|
||||
<object class="GtkListBoxRow">
|
||||
<property name="activatable">0</property>
|
||||
<property name="child">
|
||||
<object class="GtkBox">
|
||||
<property name="can-focus">0</property>
|
||||
<property name="margin-start">16</property>
|
||||
<property name="margin-end">16</property>
|
||||
<property name="margin-top">16</property>
|
||||
<property name="margin-bottom">16</property>
|
||||
<property name="spacing">30</property>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="can-focus">0</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="can-focus">0</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="label" translatable="yes">Automatic time source</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="valign">center</property>
|
||||
<property name="can-focus">0</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="label" translatable="yes"><small>The extension will try to use Night Light or Location Services to automatically set your current sunrise and sunset times if they are enabled. If you prefer, you can manually choose a time source.</small></property>
|
||||
<property name="use-markup">1</property>
|
||||
<property name="wrap">1</property>
|
||||
<property name="max-width-chars">50</property>
|
||||
<property name="xalign">0</property>
|
||||
<style>
|
||||
<class name="dim-label"/>
|
||||
</style>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSwitch" id="auto_switch">
|
||||
<property name="hexpand">1</property>
|
||||
<property name="halign">end</property>
|
||||
<property name="valign">center</property>
|
||||
<property name="active">1</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkListBoxRow">
|
||||
<property name="activatable">0</property>
|
||||
<property name="selectable">0</property>
|
||||
<property name="child">
|
||||
<object class="GtkSeparator">
|
||||
<property name="can-focus">0</property>
|
||||
</object>
|
||||
</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkListBoxRow">
|
||||
<property name="activatable">0</property>
|
||||
<property name="child">
|
||||
<object class="GtkBox">
|
||||
<property name="can-focus">0</property>
|
||||
<property name="margin-start">16</property>
|
||||
<property name="margin-end">16</property>
|
||||
<property name="margin-top">16</property>
|
||||
<property name="margin-bottom">16</property>
|
||||
<property name="spacing">30</property>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="can-focus">0</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="can-focus">0</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="label" translatable="yes">Always show on-demand controls</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="valign">center</property>
|
||||
<property name="can-focus">0</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="label" translatable="yes"><small>This allows you to override the current time when using a schedule.</small></property>
|
||||
<property name="use-markup">1</property>
|
||||
<property name="wrap">1</property>
|
||||
<property name="max-width-chars">50</property>
|
||||
<property name="xalign">0</property>
|
||||
<style>
|
||||
<class name="dim-label"/>
|
||||
</style>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSwitch" id="always_enable_ondemand_switch">
|
||||
<property name="hexpand">1</property>
|
||||
<property name="halign">end</property>
|
||||
<property name="valign">center</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkBox" id="manual">
|
||||
<property name="can-focus">0</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="spacing">8</property>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="can-focus">0</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="label" translatable="yes">Manual time source</property>
|
||||
<attributes>
|
||||
<attribute name="weight" value="bold"></attribute>
|
||||
</attributes>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="width-request">600</property>
|
||||
<property name="can-focus">0</property>
|
||||
<property name="halign">center</property>
|
||||
<property name="homogeneous">1</property>
|
||||
<child>
|
||||
<object class="GtkToggleButton" id="manual_nightlight_radio">
|
||||
<property name="label" translatable="yes">Night Light</property>
|
||||
<property name="active">1</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkToggleButton" id="manual_location_radio">
|
||||
<property name="label" translatable="yes">Location Services</property>
|
||||
<property name="group">manual_nightlight_radio</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkToggleButton" id="manual_schedule_radio">
|
||||
<property name="label" translatable="yes">Manual schedule</property>
|
||||
<property name="group">manual_nightlight_radio</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkToggleButton" id="manual_ondemand_radio">
|
||||
<property name="label" translatable="yes">On-demand</property>
|
||||
<property name="group">manual_nightlight_radio</property>
|
||||
</object>
|
||||
</child>
|
||||
<style>
|
||||
<class name="linked"/>
|
||||
</style>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkStack" id="manual_prefs_stack">
|
||||
<property name="can-focus">0</property>
|
||||
<property name="vhomogeneous">0</property>
|
||||
<property name="transition-type">crossfade</property>
|
||||
<property name="interpolate-size">1</property>
|
||||
<child>
|
||||
<object class="GtkStackPage">
|
||||
<property name="name">none</property>
|
||||
<property name="title" translatable="yes">No preferences</property>
|
||||
<property name="child">
|
||||
<object class="GtkBox" id="none">
|
||||
<property name="can-focus">0</property>
|
||||
<property name="orientation">vertical</property>
|
||||
</object>
|
||||
</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkStackPage">
|
||||
<property name="name">nightlight</property>
|
||||
<property name="title" translatable="yes">Night Light</property>
|
||||
<property name="child">
|
||||
<object class="GtkBox" id="nightlight">
|
||||
<property name="can-focus">0</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="spacing">8</property>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="can-focus">0</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="label" translatable="yes">Night Light</property>
|
||||
<attributes>
|
||||
<attribute name="weight" value="bold"></attribute>
|
||||
</attributes>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkFrame">
|
||||
<property name="can-focus">0</property>
|
||||
<property name="child">
|
||||
<object class="GtkListBox">
|
||||
<property name="width-request">600</property>
|
||||
<property name="can-focus">0</property>
|
||||
<property name="selection-mode">none</property>
|
||||
<child>
|
||||
<object class="GtkListBoxRow">
|
||||
<property name="activatable">0</property>
|
||||
<property name="child">
|
||||
<object class="GtkBox">
|
||||
<property name="can-focus">0</property>
|
||||
<property name="margin-start">16</property>
|
||||
<property name="margin-end">16</property>
|
||||
<property name="margin-top">16</property>
|
||||
<property name="margin-bottom">16</property>
|
||||
<property name="spacing">30</property>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="can-focus">0</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="can-focus">0</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="label" translatable="yes">Follow <i>Disable until tomorrow</i></property>
|
||||
<property name="use-markup">1</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="valign">center</property>
|
||||
<property name="can-focus">0</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="label" translatable="yes"><small>When Night Light is temporarily disabled, the extension will switch to day variants.</small></property>
|
||||
<property name="use-markup">1</property>
|
||||
<property name="wrap">1</property>
|
||||
<property name="max-width-chars">50</property>
|
||||
<property name="xalign">0</property>
|
||||
<style>
|
||||
<class name="dim-label"/>
|
||||
</style>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSwitch" id="nightlight_follow_disable_switch">
|
||||
<property name="hexpand">1</property>
|
||||
<property name="halign">end</property>
|
||||
<property name="valign">center</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkStackPage">
|
||||
<property name="name">schedule_times</property>
|
||||
<property name="title" translatable="yes">Manual schedule times</property>
|
||||
<property name="child">
|
||||
<object class="GtkBox" id="schedule_times">
|
||||
<property name="width-request">600</property>
|
||||
<property name="can-focus">0</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="spacing">8</property>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="can-focus">0</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="label" translatable="yes">Manual schedule times</property>
|
||||
<attributes>
|
||||
<attribute name="weight" value="bold"></attribute>
|
||||
</attributes>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkFrame">
|
||||
<property name="can-focus">0</property>
|
||||
<property name="child">
|
||||
<object class="GtkListBox">
|
||||
<property name="width-request">600</property>
|
||||
<property name="can-focus">0</property>
|
||||
<property name="selection-mode">none</property>
|
||||
<child>
|
||||
<object class="GtkListBoxRow">
|
||||
<property name="activatable">0</property>
|
||||
<property name="child">
|
||||
<object class="GtkBox">
|
||||
<property name="can-focus">0</property>
|
||||
<property name="margin-start">16</property>
|
||||
<property name="margin-end">16</property>
|
||||
<property name="margin-top">16</property>
|
||||
<property name="margin-bottom">16</property>
|
||||
<property name="spacing">30</property>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="can-focus">0</property>
|
||||
<property name="label" translatable="yes">Sunrise</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="hexpand">1</property>
|
||||
<property name="can-focus">0</property>
|
||||
<property name="halign">end</property>
|
||||
<property name="spacing">8</property>
|
||||
<child>
|
||||
<object class="GtkSpinButton" id="schedule_times_sunrise_hours_spin">
|
||||
<property name="width-chars">2</property>
|
||||
<property name="text">0</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="adjustment">sunrise_hours_adjustment</property>
|
||||
<property name="numeric">1</property>
|
||||
<property name="wrap">1</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="can-focus">0</property>
|
||||
<property name="label" translatable="yes">:</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSpinButton" id="schedule_times_sunrise_minutes_spin">
|
||||
<property name="width-chars">2</property>
|
||||
<property name="text">0</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="adjustment">sunrise_minutes_adjustment</property>
|
||||
<property name="numeric">1</property>
|
||||
<property name="wrap">1</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkListBoxRow">
|
||||
<property name="activatable">0</property>
|
||||
<property name="selectable">0</property>
|
||||
<property name="child">
|
||||
<object class="GtkSeparator">
|
||||
<property name="can-focus">0</property>
|
||||
</object>
|
||||
</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkListBoxRow">
|
||||
<property name="activatable">0</property>
|
||||
<property name="child">
|
||||
<object class="GtkBox">
|
||||
<property name="can-focus">0</property>
|
||||
<property name="margin-start">16</property>
|
||||
<property name="margin-end">16</property>
|
||||
<property name="margin-top">16</property>
|
||||
<property name="margin-bottom">16</property>
|
||||
<property name="spacing">30</property>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="can-focus">0</property>
|
||||
<property name="label" translatable="yes">Sunset</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="hexpand">1</property>
|
||||
<property name="can-focus">0</property>
|
||||
<property name="halign">end</property>
|
||||
<property name="spacing">8</property>
|
||||
<child>
|
||||
<object class="GtkSpinButton" id="schedule_times_sunset_hours_spin">
|
||||
<property name="width-chars">2</property>
|
||||
<property name="text">0</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="adjustment">sunset_hours_adjustment</property>
|
||||
<property name="numeric">1</property>
|
||||
<property name="wrap">1</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="can-focus">0</property>
|
||||
<property name="label" translatable="yes">:</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSpinButton" id="schedule_times_sunset_minutes_spin">
|
||||
<property name="width-chars">2</property>
|
||||
<property name="text">0</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="adjustment">sunset_minutes_adjustment</property>
|
||||
<property name="numeric">1</property>
|
||||
<property name="wrap">1</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkBox" id="ondemand">
|
||||
<property name="can-focus">0</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="spacing">8</property>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="can-focus">0</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="label" translatable="yes">On-demand</property>
|
||||
<attributes>
|
||||
<attribute name="weight" value="bold"></attribute>
|
||||
</attributes>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkFrame">
|
||||
<property name="can-focus">0</property>
|
||||
<property name="child">
|
||||
<object class="GtkListBox">
|
||||
<property name="width-request">600</property>
|
||||
<property name="can-focus">0</property>
|
||||
<property name="selection-mode">none</property>
|
||||
<child>
|
||||
<object class="GtkListBoxRow">
|
||||
<property name="activatable">0</property>
|
||||
<property name="child">
|
||||
<object class="GtkBox">
|
||||
<property name="can-focus">0</property>
|
||||
<property name="margin-start">16</property>
|
||||
<property name="margin-end">16</property>
|
||||
<property name="margin-top">16</property>
|
||||
<property name="margin-bottom">16</property>
|
||||
<property name="spacing">30</property>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="can-focus">0</property>
|
||||
<property name="label" translatable="yes">Keyboard shortcut</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="hexpand">1</property>
|
||||
<property name="halign">end</property>
|
||||
<property name="can-focus">0</property>
|
||||
<child>
|
||||
<object class="GtkButton" id="ondemand_shortcut_button">
|
||||
<property name="label" translatable="yes">Choose</property>
|
||||
<property name="receives-default">1</property>
|
||||
<property name="halign">end</property>
|
||||
<property name="valign">center</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="ondemand_shortcut_clear_button">
|
||||
<property name="label" translatable="yes">Clear</property>
|
||||
<property name="receives-default">1</property>
|
||||
<style>
|
||||
<class name="destructive-action"/>
|
||||
</style>
|
||||
</object>
|
||||
</child>
|
||||
<style>
|
||||
<class name="linked"/>
|
||||
</style>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkListBoxRow">
|
||||
<property name="activatable">0</property>
|
||||
<property name="selectable">0</property>
|
||||
<property name="child">
|
||||
<object class="GtkSeparator">
|
||||
<property name="can-focus">0</property>
|
||||
</object>
|
||||
</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkListBoxRow">
|
||||
<property name="activatable">0</property>
|
||||
<property name="child">
|
||||
<object class="GtkBox">
|
||||
<property name="can-focus">0</property>
|
||||
<property name="margin-start">16</property>
|
||||
<property name="margin-end">16</property>
|
||||
<property name="margin-top">16</property>
|
||||
<property name="margin-bottom">16</property>
|
||||
<property name="spacing">30</property>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="can-focus">0</property>
|
||||
<property name="label" translatable="yes">Button location</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkComboBoxText" id="ondemand_button_placement_combo">
|
||||
<property name="hexpand">1</property>
|
||||
<property name="can-focus">0</property>
|
||||
<property name="halign">end</property>
|
||||
<property name="active">1</property>
|
||||
<property name="active-id">panel</property>
|
||||
<items>
|
||||
<item id="none" translatable="yes">None</item>
|
||||
<item id="panel" translatable="yes">Top bar</item>
|
||||
<item id="menu" translatable="yes">System menu</item>
|
||||
</items>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</interface>
|
||||
@@ -1,200 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
SPDX-FileCopyrightText: 2021 Romain Vigier <contact AT romainvigier.fr>
|
||||
SPDX-License-Identifier: GPL-3.0-or-later
|
||||
-->
|
||||
<interface domain="nightthemeswitcher@romainvigier.fr">
|
||||
<requires lib="gtk" version="4.0"/>
|
||||
<object class="GtkBox" id="shell_theme">
|
||||
<property name="width_request">600</property>
|
||||
<property name="halign">center</property>
|
||||
<property name="valign">start</property>
|
||||
<property name="margin_start">36</property>
|
||||
<property name="margin_end">36</property>
|
||||
<property name="margin_top">36</property>
|
||||
<property name="margin_bottom">36</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="spacing">30</property>
|
||||
<property name="baseline_position">top</property>
|
||||
<child>
|
||||
<object class="GtkFrame" id="enabled">
|
||||
<property name="child">
|
||||
<object class="GtkListBox">
|
||||
<property name="width_request">600</property>
|
||||
<property name="selection_mode">none</property>
|
||||
<child>
|
||||
<object class="GtkListBoxRow">
|
||||
<property name="activatable">0</property>
|
||||
<property name="child">
|
||||
<object class="GtkBox">
|
||||
<property name="margin_start">16</property>
|
||||
<property name="margin_end">16</property>
|
||||
<property name="margin_top">16</property>
|
||||
<property name="margin_bottom">16</property>
|
||||
<property name="spacing">30</property>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="label" translatable="yes">Switch Shell variants</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSwitch" id="enabled_switch">
|
||||
<property name="hexpand">1</property>
|
||||
<property name="halign">end</property>
|
||||
<property name="valign">center</property>
|
||||
<property name="active">1</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkFrame" id="manual">
|
||||
<property name="child">
|
||||
<object class="GtkListBox">
|
||||
<property name="width_request">600</property>
|
||||
<property name="selection_mode">none</property>
|
||||
<child>
|
||||
<object class="GtkListBoxRow">
|
||||
<property name="activatable">0</property>
|
||||
<property name="child">
|
||||
<object class="GtkBox">
|
||||
<property name="margin_start">16</property>
|
||||
<property name="margin_end">16</property>
|
||||
<property name="margin_top">16</property>
|
||||
<property name="margin_bottom">16</property>
|
||||
<property name="spacing">30</property>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="orientation">vertical</property>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="halign">start</property>
|
||||
<property name="label" translatable="yes">Manual variants</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="valign">center</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="label" translatable="yes"><small>You can manually set variants if the extension cannot automatically detect the day and night variants of your GNOME Shell theme. Please <a href="https://gitlab.com/rmnvgr/nightthemeswitcher-gnome-shell-extension/-/issues">submit a request</a> to get your theme supported.</small></property>
|
||||
<property name="use_markup">1</property>
|
||||
<property name="wrap">1</property>
|
||||
<property name="max_width_chars">50</property>
|
||||
<property name="xalign">0</property>
|
||||
<style>
|
||||
<class name="dim-label"/>
|
||||
</style>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSwitch" id="manual_switch">
|
||||
<property name="hexpand">1</property>
|
||||
<property name="halign">end</property>
|
||||
<property name="valign">center</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkBox" id="variants">
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="spacing">8</property>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="halign">start</property>
|
||||
<property name="label" translatable="yes">Manual variants</property>
|
||||
<attributes>
|
||||
<attribute name="weight" value="bold"></attribute>
|
||||
</attributes>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkFrame">
|
||||
<property name="child">
|
||||
<object class="GtkListBox">
|
||||
<property name="width_request">600</property>
|
||||
<property name="selection_mode">none</property>
|
||||
<child>
|
||||
<object class="GtkListBoxRow">
|
||||
<property name="activatable">0</property>
|
||||
<property name="child">
|
||||
<object class="GtkBox">
|
||||
<property name="margin_start">16</property>
|
||||
<property name="margin_end">16</property>
|
||||
<property name="margin_top">16</property>
|
||||
<property name="margin_bottom">16</property>
|
||||
<property name="spacing">30</property>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="label" translatable="yes">Day variant</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkComboBoxText" id="day_combo">
|
||||
<property name="hexpand">1</property>
|
||||
<property name="halign">end</property>
|
||||
<property name="valign">center</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkListBoxRow">
|
||||
<property name="activatable">0</property>
|
||||
<property name="selectable">0</property>
|
||||
<property name="child">
|
||||
<object class="GtkSeparator">
|
||||
</object>
|
||||
</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkListBoxRow">
|
||||
<property name="activatable">0</property>
|
||||
<property name="child">
|
||||
<object class="GtkBox">
|
||||
<property name="margin_start">16</property>
|
||||
<property name="margin_end">16</property>
|
||||
<property name="margin_top">16</property>
|
||||
<property name="margin_bottom">16</property>
|
||||
<property name="spacing">30</property>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="label" translatable="yes">Night variant</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkComboBoxText" id="night_combo">
|
||||
<property name="hexpand">1</property>
|
||||
<property name="halign">end</property>
|
||||
<property name="valign">center</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</interface>
|
||||
@@ -0,0 +1,104 @@
|
||||
/*
|
||||
SPDX-FileCopyrightText: 2020, 2021 Romain Vigier <contact AT romainvigier.fr>
|
||||
SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*/
|
||||
|
||||
window.nightthemeswitcher,
|
||||
window.toolbox
|
||||
{
|
||||
border-radius: 8px;
|
||||
}
|
||||
|
||||
window.nightthemeswitcher headerbar
|
||||
{
|
||||
background: #000;
|
||||
color: alpha(#fff, 0.9);
|
||||
border: none;
|
||||
}
|
||||
|
||||
window.nightthemeswitcher headerbar button
|
||||
{
|
||||
background: alpha(#fff, 0.2);
|
||||
color: inherit;
|
||||
border: none;
|
||||
font-weight: bold;
|
||||
transition: all 200ms;
|
||||
}
|
||||
|
||||
window.nightthemeswitcher headerbar button.close
|
||||
{
|
||||
background: none;
|
||||
}
|
||||
|
||||
window.nightthemeswitcher headerbar button:hover
|
||||
{
|
||||
background: alpha(#fff, 0.3);
|
||||
}
|
||||
|
||||
window.nightthemeswitcher headerbar button:active
|
||||
{
|
||||
background: alpha(#fff, 0.4);
|
||||
}
|
||||
|
||||
window.nightthemeswitcher headerbar button:checked
|
||||
{
|
||||
background: alpha(#fff, 0.1);
|
||||
}
|
||||
|
||||
window.nightthemeswitcher headerbar .linked button.toggle
|
||||
{
|
||||
border-right: 1px solid alpha(#000, 0.4);
|
||||
}
|
||||
|
||||
window.nightthemeswitcher headerbar .linked button.toggle:last-child
|
||||
{
|
||||
border-right: none;
|
||||
}
|
||||
|
||||
window.nightthemeswitcher list.frame
|
||||
{
|
||||
border-radius: 8px;
|
||||
}
|
||||
|
||||
window.nightthemeswitcher list.frame row:last-child
|
||||
{
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
window.nightthemeswitcher .support button
|
||||
{
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
window.nightthemeswitcher .support button.gitlab
|
||||
{
|
||||
background-color: rgba(250, 112, 53, 1);
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
window.nightthemeswitcher .support button.gitlab:hover
|
||||
{
|
||||
background-color: rgba(250, 112, 53, 1);
|
||||
}
|
||||
|
||||
window.nightthemeswitcher .support button.liberapay
|
||||
{
|
||||
background-color: rgba(246, 201, 21, 0.8);
|
||||
color: #1a171b;
|
||||
}
|
||||
|
||||
window.nightthemeswitcher .support button.liberapay:hover
|
||||
{
|
||||
background-color: rgba(246, 201, 21, 1);
|
||||
}
|
||||
|
||||
window.nightthemeswitcher .support button.weblate
|
||||
{
|
||||
background-color: rgba(46, 204, 170, 0.8);
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
window.nightthemeswitcher .support button.weblate:hover
|
||||
{
|
||||
background-color: rgba(46, 204, 170, 1);
|
||||
}
|
||||
Reference in New Issue
Block a user