mirror of
https://github.com/Rafostar/clapper.git
synced 2025-08-30 07:42:23 +02:00
prefs: Mark experimental options
Options not fully reliable with possibility to break playback. Better mark them as experimental then listen to users complaining on daily basis.
This commit is contained in:
50
src/prefs.js
50
src/prefs.js
@@ -55,8 +55,10 @@ class ClapperPrefsActionRow extends Adw.ActionRow
|
||||
this._schemaName = null;
|
||||
this._bindProp = null;
|
||||
|
||||
this.add_suffix(widget);
|
||||
this.set_activatable_widget(widget);
|
||||
if(widget) {
|
||||
this.add_suffix(widget);
|
||||
this.set_activatable_widget(widget);
|
||||
}
|
||||
}
|
||||
|
||||
set schema_name(value)
|
||||
@@ -117,13 +119,53 @@ class ClapperPrefsSubpageRow extends Adw.ActionRow
|
||||
|
||||
GObject.registerClass({
|
||||
GTypeName: 'ClapperPrefsSwitch',
|
||||
Properties: {
|
||||
'custom-icon-name': GObject.ParamSpec.string(
|
||||
'custom-icon-name',
|
||||
'Icon name',
|
||||
'Name of the icon',
|
||||
GObject.ParamFlags.WRITABLE | GObject.ParamFlags.CONSTRUCT_ONLY,
|
||||
null
|
||||
),
|
||||
'custom-icon-subtitle': GObject.ParamSpec.string(
|
||||
'custom-icon-subtitle',
|
||||
'Icon subtitle',
|
||||
'Text below the icon',
|
||||
GObject.ParamFlags.WRITABLE | GObject.ParamFlags.CONSTRUCT_ONLY,
|
||||
null
|
||||
),
|
||||
}
|
||||
},
|
||||
class ClapperPrefsSwitch extends PrefsActionRow
|
||||
{
|
||||
_init()
|
||||
_init(opts)
|
||||
{
|
||||
super._init(new Gtk.Switch(widgetOpts));
|
||||
super._init(null);
|
||||
this._bindProp = 'active';
|
||||
|
||||
if(opts.custom_icon_name || opts.custom_icon_subtitle) {
|
||||
const box = new Gtk.Box({
|
||||
margin_top: 2,
|
||||
orientation: Gtk.Orientation.VERTICAL,
|
||||
valign: Gtk.Align.CENTER,
|
||||
});
|
||||
const customIcon = new Gtk.Image({
|
||||
icon_name: opts.custom_icon_name || null,
|
||||
});
|
||||
box.append(customIcon);
|
||||
|
||||
const customLabel = new Gtk.Label({
|
||||
label: opts.custom_icon_subtitle || '',
|
||||
});
|
||||
customLabel.add_css_class('subtitle');
|
||||
box.append(customLabel);
|
||||
|
||||
this.add_suffix(box);
|
||||
}
|
||||
|
||||
const sw = new Gtk.Switch(widgetOpts);
|
||||
this.add_suffix(sw);
|
||||
this.set_activatable_widget(sw);
|
||||
}
|
||||
});
|
||||
|
||||
|
@@ -257,14 +257,18 @@
|
||||
<child>
|
||||
<object class="ClapperPrefsSwitch">
|
||||
<property name="title" translatable="yes">Use playbin3</property>
|
||||
<property name="subtitle" translatable="yes">Use experimental playbin3 element (requires player restart)</property>
|
||||
<property name="subtitle" translatable="yes">Requires player restart</property>
|
||||
<property name="custom-icon-name">dialog-warning-symbolic</property>
|
||||
<property name="custom-icon-subtitle" translatable="yes">Experimental</property>
|
||||
<property name="schema-name">use-playbin3</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="ClapperPrefsSwitch">
|
||||
<property name="title" translatable="yes">Use PipeWire</property>
|
||||
<property name="subtitle" translatable="yes">Use PipeWire for audio output (requires player restart)</property>
|
||||
<property name="title" translatable="yes">Use PipeWire for audio</property>
|
||||
<property name="subtitle" translatable="yes">Requires player restart</property>
|
||||
<property name="custom-icon-name">dialog-warning-symbolic</property>
|
||||
<property name="custom-icon-subtitle" translatable="yes">Experimental</property>
|
||||
<property name="schema-name">use-pipewire</property>
|
||||
</object>
|
||||
</child>
|
||||
|
Reference in New Issue
Block a user