Add a checkbox for the "stop music in background" preference

This commit is contained in:
Jyrki Vesterinen 2016-06-28 15:47:20 +03:00
parent 31871daa71
commit b7b6531a6f
2 changed files with 42 additions and 0 deletions

View file

@ -61,6 +61,40 @@
[/grid]
#enddef
#define _GUI_AUTO_MUTE_MUSIC_CHECKBOX
[row]
[column]
horizontal_grow = true
[grid]
[row]
[column]
{_GUI_PREFERENCES_CHECKBOX_ALIGN_SPACER}
[/column]
[column]
grow_factor = 0
border = "all"
border_size = 5
horizontal_grow = true
[toggle_button]
id = sound_toggle_stop_music_in_background
label = _ "Pause music on focus loss"
tooltip = _ "Pause the music when you switch to any other window"
[/toggle_button]
[/column]
[column]
grow_factor = 1
[spacer]
[/spacer]
[/column]
[/row]
[/grid]
[/column]
[/row]
#enddef
#define _GUI_PREFERENCES_SOUND_GRID
[row]
[column]
@ -84,6 +118,8 @@
[/column]
[/row]
{_GUI_AUTO_MUTE_MUSIC_CHECKBOX}
[row]
[column]
horizontal_grow = true
@ -121,4 +157,5 @@
[/layer]
#undef _GUI_PREFERENCES_SOUND_GRID
#under _GUI_AUTO_MUTE_MUSIC_CHECKBOX
#undef _GUI_SOUND_SLIDER_CONTROL

View file

@ -622,6 +622,11 @@ void tpreferences::initialize_members(twindow& window)
music_on(), music_volume(),
bind_void(set_music, _1), set_music_volume, window);
setup_single_toggle("sound_toggle_stop_music_in_background",
stop_music_in_background(),
set_stop_music_in_background,
window);
/* TURN BELL */
setup_toggle_slider_pair("sound_toggle_bell", "sound_volume_bell",
turn_bell(), bell_volume(),