But 2000 lines of C, and no dependencies is pretty cool!
Clay – UI Layout Library
21–30 of 95 posts
Re: Clay – UI Layout Library
#22But with iOS Safari + Dark Reader, at least on my side, the HTML page is turned into dark mode with Dark Reader, while the canvas page is not. So, it basically ruins the wow factor, haha.
But it still looks nice.
Re: Clay – UI Layout Library
#23Just a funny note—there’s a button at the end to switch between HTML and Canvas. I think it is neat how little difference it makes… normally. But with iOS Safari + Dark Reader, at least on my side, the HTML page is turned into dark mode with Dark Reader, while the canvas page is not. So, it basically ruins the wow factor, haha. But it still looks nice.
Re: Clay – UI Layout Library
#24Earlier quoted context omitted.
The developer is rediscovering the concept of a GUI library. The modern variant is the mouse-driven GUI developed by Xerox in the 1970s (and later commercialized by them as Xerox Star) which Jobs famously copied to create Apple’s Lisa, and Gates famously mimicked to create MS Windows. Since they determine the look and feel of a platform and their design determines the ease with which developers can create apps for th…
I'm a gray beard like you probably but I disagree with this statement. This library makes use of modern composable components, is declarative driven and not imperative; and doesn't do immediate rendering in all cases. It can target incredibly different backends, e.g. DOM/canvas/raylib. All of this in modern C as a `.h` library alone. These are great features and not just a 'youngster discovers' project.
Re: Clay – UI Layout Library
#25Re: Clay – UI Layout Library
#26Cool, so if i look for 'clay', i'll find your lib?
Re: Clay – UI Layout Library
#27Okey i was going to complain about what's the point of doing it in C, when it could be done more safely in Haskell/OCaml But 2000 lines of C, and no dependencies is pretty cool!
Re: Clay – UI Layout Library
#28Serious question: am I the only one who finds writing a webpage like this to be a little too much (even if the concept is cool): void LandingPageDesktop() { CLAY(CLAY_ID("LandingPage1Desktop"), CLAY_LAYOUT({ .sizing = { .width = CLAY_SIZING_GROW(), .height = CLAY_SIZING_FIT({ .min = windowHeight - 70 }) }, .childAlignment = {.y = CLAY_ALIGN_Y_CENTER}, .padding = { .x = 50 } })) { CLAY(CLAY_ID("LandingPage1"), CLAY_LA…
If you don't use some kind of layouting language (like XML/HTML), this is inevitably what you will always end up with. See: AWT[1], SWT[2], Swing[3], Qt[4]†, Fyne[5], etc., etc., etc. [1] https://docs.oracle.com/javase/7/docs/api/java/awt/GridLayou... [2] https://github.com/eclipse-platform/eclipse.platform.swt/blo... [3] https://stackoverflow.com/a/12867862/243613 [4] https://stackoverflow.com/questions/37304684/qwi…
I wish there would be an elegant c++ class/function based ui framework again.
Re: Clay – UI Layout Library
#29It's neat to see boxes resizing themselves using an algorithm you implemented. Wonder if I could expose a C interface?
The reason I like CSS Grid is that I could imitate the formatting like this:
test "compute others":
var gt: GridTemplate
parseGridTemplateColumns gt, ["first"] 40'ux \
["second", "line2"] 50'ux \
["line3"] auto \
["col4-start"] 50'ux \
["five"] 40'ux ["end"]
1: https://github.com/elcritch/cssgridRe: Clay – UI Layout Library
#30Just a funny note—there’s a button at the end to switch between HTML and Canvas. I think it is neat how little difference it makes… normally. But with iOS Safari + Dark Reader, at least on my side, the HTML page is turned into dark mode with Dark Reader, while the canvas page is not. So, it basically ruins the wow factor, haha. But it still looks nice.