File tree 2 files changed +35
-5
lines changed
2 files changed +35
-5
lines changed Original file line number Diff line number Diff line change @@ -155,7 +155,7 @@ func OpenControlsWindow(
155
155
buttonHeaderbarSubtitle := builder .GetObject ("button-headerbar-subtitle" ).Cast ().(* gtk.Label )
156
156
playButton := builder .GetObject ("play-button" ).Cast ().(* gtk.Button )
157
157
stopButton := builder .GetObject ("stop-button" ).Cast ().(* gtk.Button )
158
- volumeButton := builder .GetObject ("volume-button " ).Cast ().(* gtk.VolumeButton )
158
+ volumeScale := builder .GetObject ("volume-scale " ).Cast ().(* gtk.Scale )
159
159
subtitleButton := builder .GetObject ("subtitle-button" ).Cast ().(* gtk.Button )
160
160
audiotracksButton := builder .GetObject ("audiotracks-button" ).Cast ().(* gtk.Button )
161
161
fullscreenButton := builder .GetObject ("fullscreen-button" ).Cast ().(* gtk.ToggleButton )
@@ -1373,7 +1373,7 @@ func OpenControlsWindow(
1373
1373
}
1374
1374
}()
1375
1375
1376
- volumeButton . ConnectValueChanged (func (value float64 ) {
1376
+ volumeScale . ConnectChangeValue (func (scroll gtk. ScrollType , value float64 ) ( ok bool ) {
1377
1377
if err := mpvClient .ExecuteMPVRequest (ipcFile , func (encoder * json.Encoder , decoder * json.Decoder ) error {
1378
1378
log .Info ().
1379
1379
Float64 ("value" , value ).
@@ -1388,8 +1388,10 @@ func OpenControlsWindow(
1388
1388
}); err != nil {
1389
1389
OpenErrorDialog (ctx , window , err )
1390
1390
1391
- return
1391
+ return false
1392
1392
}
1393
+
1394
+ return false
1393
1395
})
1394
1396
1395
1397
subtitleButton .ConnectClicked (func () {
Original file line number Diff line number Diff line change @@ -143,8 +143,14 @@ Adw.ApplicationWindow main-window {
143
143
]
144
144
}
145
145
146
- VolumeButton volume-button {
147
- value: 1;
146
+ MenuButton {
147
+ styles [
148
+ "flat",
149
+ ]
150
+
151
+ icon-name: 'audio-volume-medium';
152
+ tooltip-text: 'Change audio volume';
153
+ popover: audiovolume-button-popover;
148
154
}
149
155
150
156
Button audiotracks-button {
@@ -220,3 +226,25 @@ Popover users-popover {
220
226
}
221
227
}
222
228
}
229
+
230
+ Popover audiovolume-button-popover {
231
+ width-request: 250;
232
+
233
+ Box {
234
+ margin-top: 6;
235
+ margin-bottom: 6;
236
+ margin-start: 6;
237
+ margin-end: 6;
238
+
239
+ Scale volume-scale {
240
+ hexpand: true;
241
+
242
+ adjustment: Adjustment {
243
+ step-increment: 0.2;
244
+ lower: 0;
245
+ upper: 1;
246
+ value: 1;
247
+ };
248
+ }
249
+ }
250
+ }
You can’t perform that action at this time.
0 commit comments