@@ -156,6 +156,7 @@ func OpenControlsWindow(
156
156
playButton := builder .GetObject ("play-button" ).Cast ().(* gtk.Button )
157
157
stopButton := builder .GetObject ("stop-button" ).Cast ().(* gtk.Button )
158
158
volumeScale := builder .GetObject ("volume-scale" ).Cast ().(* gtk.Scale )
159
+ volumeButton := builder .GetObject ("volume-button" ).Cast ().(* gtk.MenuButton )
159
160
volumeMuteButton := builder .GetObject ("audiovolume-button-mute-button" ).Cast ().(* gtk.Button )
160
161
subtitleButton := builder .GetObject ("subtitle-button" ).Cast ().(* gtk.Button )
161
162
audiotracksButton := builder .GetObject ("audiotracks-button" ).Cast ().(* gtk.Button )
@@ -1383,8 +1384,23 @@ func OpenControlsWindow(
1383
1384
})
1384
1385
1385
1386
volumeScale .ConnectValueChanged (func () {
1387
+ value := volumeScale .Value ()
1388
+
1389
+ if value <= 0 {
1390
+ volumeButton .SetIconName ("audio-volume-muted-symbolic" )
1391
+ volumeMuteButton .SetIconName ("audio-volume-muted-symbolic" )
1392
+ } else if value <= 0.3 {
1393
+ volumeButton .SetIconName ("audio-volume-low-symbolic" )
1394
+ volumeMuteButton .SetIconName ("audio-volume-high-symbolic" )
1395
+ } else if value <= 0.6 {
1396
+ volumeButton .SetIconName ("audio-volume-medium-symbolic" )
1397
+ volumeMuteButton .SetIconName ("audio-volume-high-symbolic" )
1398
+ } else {
1399
+ volumeButton .SetIconName ("audio-volume-high-symbolic" )
1400
+ volumeMuteButton .SetIconName ("audio-volume-high-symbolic" )
1401
+ }
1402
+
1386
1403
if err := mpvClient .ExecuteMPVRequest (ipcFile , func (encoder * json.Encoder , decoder * json.Decoder ) error {
1387
- value := volumeScale .Value ()
1388
1404
1389
1405
log .Info ().
1390
1406
Float64 ("value" , value ).
0 commit comments