mirror of
https://github.com/Rafostar/clapper.git
synced 2025-08-30 07:42:23 +02:00
@@ -18,6 +18,7 @@ var actions = {
|
|||||||
prev_track: ['<Ctrl>Left'],
|
prev_track: ['<Ctrl>Left'],
|
||||||
volume_up: ['Up'],
|
volume_up: ['Up'],
|
||||||
volume_down: ['Down'],
|
volume_down: ['Down'],
|
||||||
|
mute: ['<Ctrl>m'],
|
||||||
toggle_play: ['space'],
|
toggle_play: ['space'],
|
||||||
change_repeat: ['<Ctrl>r'],
|
change_repeat: ['<Ctrl>r'],
|
||||||
reveal_controls: ['Return'],
|
reveal_controls: ['Return'],
|
||||||
@@ -74,6 +75,9 @@ function handleAction(action, window)
|
|||||||
case 'volume_down':
|
case 'volume_down':
|
||||||
player.adjust_volume(bool);
|
player.adjust_volume(bool);
|
||||||
break;
|
break;
|
||||||
|
case 'mute':
|
||||||
|
player.mute ^= true;
|
||||||
|
break;
|
||||||
case 'next_track':
|
case 'next_track':
|
||||||
player.playlistWidget.nextTrack();
|
player.playlistWidget.nextTrack();
|
||||||
break;
|
break;
|
||||||
|
@@ -206,9 +206,30 @@ var VolumeButton = GObject.registerClass({
|
|||||||
GTypeName: 'ClapperVolumeButton',
|
GTypeName: 'ClapperVolumeButton',
|
||||||
Template: Misc.getResourceUri('ui/volume-button.ui'),
|
Template: Misc.getResourceUri('ui/volume-button.ui'),
|
||||||
Children: ['volumeScale'],
|
Children: ['volumeScale'],
|
||||||
|
Properties: {
|
||||||
|
'muted': GObject.ParamSpec.boolean(
|
||||||
|
'muted',
|
||||||
|
'Set muted',
|
||||||
|
'Mark scale as muted',
|
||||||
|
GObject.ParamFlags.WRITABLE,
|
||||||
|
false
|
||||||
|
),
|
||||||
|
}
|
||||||
},
|
},
|
||||||
class ClapperVolumeButton extends PopoverButtonBase
|
class ClapperVolumeButton extends PopoverButtonBase
|
||||||
{
|
{
|
||||||
|
_init(opts)
|
||||||
|
{
|
||||||
|
super._init(opts);
|
||||||
|
this._isMuted = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
set muted(isMuted)
|
||||||
|
{
|
||||||
|
this._isMuted = isMuted;
|
||||||
|
this._onVolumeScaleValueChanged(this.volumeScale);
|
||||||
|
}
|
||||||
|
|
||||||
_onVolumeScaleValueChanged(scale)
|
_onVolumeScaleValueChanged(scale)
|
||||||
{
|
{
|
||||||
const volume = scale.get_value();
|
const volume = scale.get_value();
|
||||||
@@ -224,7 +245,7 @@ class ClapperVolumeButton extends PopoverButtonBase
|
|||||||
scale.remove_css_class(cssClass);
|
scale.remove_css_class(cssClass);
|
||||||
}
|
}
|
||||||
|
|
||||||
const icon = (volume <= 0)
|
const icon = (volume <= 0 || this._isMuted)
|
||||||
? 'muted'
|
? 'muted'
|
||||||
: (volume <= 0.3)
|
: (volume <= 0.3)
|
||||||
? 'low'
|
? 'low'
|
||||||
|
3
src/controls.js
vendored
3
src/controls.js
vendored
@@ -376,6 +376,9 @@ class ClapperControls extends Gtk.Box
|
|||||||
: settings.get_double('volume-last');
|
: settings.get_double('volume-last');
|
||||||
|
|
||||||
clapperWidget.player.volume = initialVolume;
|
clapperWidget.player.volume = initialVolume;
|
||||||
|
clapperWidget.player.bind_property('mute', this.volumeButton, 'muted',
|
||||||
|
GObject.BindingFlags.DEFAULT
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
_onPlayerResize(width, height)
|
_onPlayerResize(width, height)
|
||||||
|
@@ -100,6 +100,20 @@
|
|||||||
<property name="accelerator">space</property>
|
<property name="accelerator">space</property>
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkShortcutsShortcut">
|
||||||
|
<property name="title" translatable="yes">Seek forward</property>
|
||||||
|
<property name="subtitle" translatable="yes">Swipe right | Scroll right</property>
|
||||||
|
<property name="accelerator">Right</property>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkShortcutsShortcut">
|
||||||
|
<property name="title" translatable="yes">Seek backward</property>
|
||||||
|
<property name="subtitle" translatable="yes">Swipe left | Scroll left</property>
|
||||||
|
<property name="accelerator">Left</property>
|
||||||
|
</object>
|
||||||
|
</child>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkShortcutsShortcut">
|
<object class="GtkShortcutsShortcut">
|
||||||
<property name="title" translatable="yes">Volume up</property>
|
<property name="title" translatable="yes">Volume up</property>
|
||||||
@@ -116,16 +130,8 @@
|
|||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkShortcutsShortcut">
|
<object class="GtkShortcutsShortcut">
|
||||||
<property name="title" translatable="yes">Seek forward</property>
|
<property name="title" translatable="yes">Mute volume</property>
|
||||||
<property name="subtitle" translatable="yes">Swipe right | Scroll right</property>
|
<property name="accelerator"><Ctrl>M</property>
|
||||||
<property name="accelerator">Right</property>
|
|
||||||
</object>
|
|
||||||
</child>
|
|
||||||
<child>
|
|
||||||
<object class="GtkShortcutsShortcut">
|
|
||||||
<property name="title" translatable="yes">Seek backward</property>
|
|
||||||
<property name="subtitle" translatable="yes">Swipe left | Scroll left</property>
|
|
||||||
<property name="accelerator">Left</property>
|
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
|
Reference in New Issue
Block a user