r/QuickShell • u/TroPixens • Dec 27 '25
Learning😀 Canvas
Does anyone have some good tutorials on canvas I don’t quite get it and when I search it up I can’t find any good ones thanks :) I know this isn’t actually quickshell but the qml sub is tiny too so I had to post it somewhere
2
Upvotes
View all comments
Show parent comment
2
u/chikamakaleyley Dec 27 '25
oh yeah, this is pretty much the Javascript API
so its pretty straightforward, you basically provide a "context" and then you basically use the methods provided to draw what you need. Think of like, tools that you have in adobe illustrator, if you know how to use that program
that first example is pretty much a solid, basic implementation:
if you look at the API in the JS docs - pretty much the same thing. In QML it looks like the Canvas widget handles the creation of that element into the shell, whereas in JS you have to identify an element on the page where you want to draw the context.
what you're looking for in QML spec is how to draw a path in Canvas, which, if i understand what you're asking for, you basically want to draw a triangle where the hypotenuse is curved (concave)
and so, the element you want to achieve sounds easy but ultimately you have to know the basics on how to draw that path, and then apply a curve to one of the lines. The border/stroke is a simple property/rule you set.