hi, i am exploring compose desktop as a option for...
# compose-desktop
n
hi, i am exploring compose desktop as a option for building control surfaces.. does anyone know if someone built components that can imitate these sorts of faders? thje goal is to be wide to be touchscreen compatible and easy to have a overview, have marks/notches and most importantly work vertically too (a easy fix to make vertical sliders wok would be appreciated too) i used to use touchOSC for this.. and had a program running in the background that interfaced with it using OSC and did a bunch od state management with state flows before sneding OSC commands to other programs.. would be nice if i could simplify this ... without having to create new primitives like sliders/faders, toggle button arrays or such
m
You shouldn't have any issues implementing such sliders in CD. The design is simple and the gesture support is there.
n
i cannot find much on making your own composable components like sliders.. seems like using the default slider is locked to horizontal only and breaks in truly mindboggling ways when rotated do you have any ideas on where to start to build your own components from "scratch" ?
m
I wouldn’t try to modify an existing slider for this, I think it’s too different, I’d try building it from scratch. You can either use
Canvas
to draw the design, or try to build it from separate smaller elements (e.g. the slider handle is a
Box
with
Modifier.clip(RoundedCornerShape())
, or a combination of the two. You can either draw the text in the canvas, or use an actual
Text
element depending on the approach. Once you have it displayed, you can add the actual gesture support with
Modifier.draggable
or similar. I’d use
Canvas
to draw all the shapes except the text, and put it into a
Box
with a
Text
for the label, and add the gesture detection on the
Box
.
It’s simpler than you probably expect!
☝️ 1
n
i mainly want the "wide" sliders and such.. stuff that is easy to see on a stage in bright lighting on a glance the text can just be done with whatever default components initially
thanks for the pointers
this was reasonably easy indeed , this is in the ballpark of the style id be happy with.. now i just have to.. draw the rest of the owl
😎 1
m
Looks good!
n
Thanks!