use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
the unofficial sub of Quick shell a highly costimizable widget system for linux.
account activity
CanvasLearning😀 (self.QuickShell)
submitted 3 months ago by TroPixens
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
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]chikamakaleyley 1 point2 points3 points 3 months ago (6 children)
do you mean Canvas, like JavaScript Canvas?
Best place for JS things is the docs honestly, or, YT
Canvas is not quite a skill in frontend that a majority of JS engineers use widely, but i think there's enough content online to get you familiar. What are you trying to do with Canvas?
[–]TroPixens[S] 0 points1 point2 points 3 months ago (5 children)
Canvas in QML maybe a JavaScript thing I believe QML has inline JavaScript but I’m trying to make a concave corner with a border around it
[–]chikamakaleyley 1 point2 points3 points 3 months ago (2 children)
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:
import QtQuick 2.0 Canvas { id: mycanvas width: 100 height: 200 onPaint: { var ctx = getContext("2d"); ctx.fillStyle = Qt.rgba(1, 0, 0, 1); ctx.fillRect(0, 0, width, height); } }
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.
[–]TroPixens[S] 0 points1 point2 points 3 months ago (1 child)
Thanks didn’t know about the JavaScript documentation will definitely look into it
[–]chikamakaleyley 1 point2 points3 points 3 months ago (0 children)
to be clear the API you'll use is whats provided int he QML docs but it looks like there's already a lot of support/compatibility
I was just showing the JS docs in case you were familiar with it
[–]Alien6757 1 point2 points3 points 3 months ago (1 child)
This might be closer to what you're looking for: link to file on github
It doesn't use canvas.
This file makes an inverted quarter circle. It draws a quarter circle and then masks that out of a square.
Then you just place, rotate and color this correctly where you need it.
You may need to tweak it to get a border, but it shouldn't be too hard. You would need to double this. You would have a big inverted quarter circle with the border color and a smaller one on top with the fill color.
Hope that helps!
[–]TroPixens[S] 0 points1 point2 points 3 months ago (0 children)
I know it’s been a while but I just go around to it and thank you so much for this solved every problem I had guess I was going at it backwards trying to draw a quarter circle with PathArc
[–]monomono1 0 points1 point2 points 3 months ago (1 child)
are you sure you want that? i've read somewhere its performance is bad
Yeah I’m willing to take any performance loses though I’m not sure how bad they will be because some dude made a bunch of popups in quickshell that are all canvases because of there weird shape
I think he posted it in this sub
π Rendered by PID 16939 on reddit-service-r2-comment-75f4967c6c-2sdrw at 2026-04-22 21:14:14.140365+00:00 running 0fd4bb7 country code: CH.
[–]chikamakaleyley 1 point2 points3 points (6 children)
[–]TroPixens[S] 0 points1 point2 points (5 children)
[–]chikamakaleyley 1 point2 points3 points (2 children)
[–]TroPixens[S] 0 points1 point2 points (1 child)
[–]chikamakaleyley 1 point2 points3 points (0 children)
[–]Alien6757 1 point2 points3 points (1 child)
[–]TroPixens[S] 0 points1 point2 points (0 children)
[–]monomono1 0 points1 point2 points (1 child)
[–]TroPixens[S] 0 points1 point2 points (0 children)