Skip to content
Snippets Groups Projects
Commit 11a9ce15 authored by pippin's avatar pippin
Browse files

ui: stop using buffers for volume overlay

parent fbd13e04
No related branches found
No related tags found
1 merge request!256ui: stop using buffers for volume overlay
Pipeline #7511 passed
......@@ -144,8 +144,7 @@ def run_main() -> None:
log.info(f"free memory: {gc.mem_free()}")
captouch.calibration_request()
# TODO(q3k): volume control. but until then, make slightly less loud on startup.
audio.set_volume_dB(-10)
audio.set_volume_dB(-10) # slightly less loud startup volume
leds.set_rgb(0, 255, 0, 0)
leds.update()
bundles = BundleManager()
......
......@@ -283,27 +283,20 @@ class OverlayVolume(Overlay):
opacity = self._showing / 200
opacity = min(opacity, 0.8)
ctx.start_group()
ctx.global_alpha = opacity
# Background
ctx.gray(0)
ctx.rgba(0, 0, 0, opacity)
ctx.round_rectangle(-40, -40, 80, 80, 5)
ctx.fill()
ctx.end_group()
# Foreground
opacity = self._showing / 200
opacity = min(opacity, 1)
ctx.start_group()
ctx.global_alpha = opacity
muted = self._muted
if muted:
ctx.gray(0.5)
ctx.rgba(0.5, 0.5, 0.5, opacity)
else:
ctx.gray(1)
ctx.rgba(1.0, 1.0, 1.0, opacity)
# Icon
if self._headphones:
......@@ -323,7 +316,7 @@ class OverlayVolume(Overlay):
ctx.line_to(-10, 0)
ctx.fill()
ctx.gray(1)
ctx.rgba(1.0, 1.0, 1.0, opacity)
# Volume slider
ctx.round_rectangle(-30, 20, 60, 10, 3)
......@@ -337,8 +330,6 @@ class OverlayVolume(Overlay):
ctx.round_rectangle(-30, 20, width, 10, 3)
ctx.fill()
ctx.end_group()
class Icon(Responder):
"""
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment