CSS text-box – Frontend Masters Boost

Safari is first to drop text-box in CSS, which plenty of people are excited for as it takes care of aligning text in many cases without the use of fragile magic numbers. They say: Now you can declare which font metric you want the browser to consider the edge of the text box when calculating […]

@jhx Testing my current state in #Xephyr, without any #Xresources loaded, running #fvwm3 with no configuration ....

I guess my "ColorSet" class needs a few more values. Only one flavor of "background color" for the default state (not selected/inactive/hovered) doesn't cut it, e.g. a #TextBox should always stick out ... 🤔

#X11 #xcb #programming

If you expect users to type into textbox, it should appear empty. Do not put your branding in there!

#GooglePlay #Placeholder #Textbox

Next step completed, my #TextBox widget now supports mouse input: click, doubleclick and drag 🥳.

Not so nice: With overall more drawing operations, I see #flicker happening more often 😒. Did some research already, it seems with #XRender, the only way to avoid it would be to render to some #pixmap (instead of the window directly) and use #XPresent to get it on the screen? @thomasadam do you know an "easier" way? 🙈

Selections: done. Rendered using a pre-colored src picture using #XRender #composite #glyphs (Still only keyboard input, mouse will be next)

#xcb #x11 #programming #textbox

Ok, my #textbox #widget now has complete support for line editing using the keyboard ... and a blinking cursor 🥳

Still missing: Selections and any sort of mouse support 😉

#X11 #xcb #programming

That'll be a lot of work 😎

Started implementing a #TextBox widget. So far only appends what's typed and draws a (non-blinking) cursor at the end 🙈

#X11 #xcb #programming

Ok, I now have my immutable string class, featuring static const initialization and, for dynamically allocated instances, reference counting:
https://github.com/Zirias/xmoji/blob/master/src/bin/xmoji/unistr.h

... plus a mutable variation the intended #TextBox #widget should operate on, offering a "view" on its internal data to optimize passing temporaries:
https://github.com/Zirias/xmoji/blob/master/src/bin/xmoji/unistrbuilder.h

Now, I still can't start implementing this widget. First I have to implement getting #keyboard #input with #xcb. I figured I probably won't need #xkb for my purposes, processing core #X11 events should be enough. Of course this involves holding the keyboard mapping state myself 🤨

I can't use any "xcb-util" stuff as this would interfer with my async model integrating xcb with a generic event loop ... but at least I can read this code to figure out how things are supposed to work:
https://gitlab.freedesktop.org/xorg/lib/libxcb-keysyms/-/blob/master/keysyms/keysyms.c?ref_type=heads

xmoji/src/bin/xmoji/unistr.h at master · Zirias/xmoji

Contribute to Zirias/xmoji development by creating an account on GitHub.

GitHub

Next thing is working on a #TextBox #widget. This will require, among other things, translating between pixel coordinates and string positions (for selections and drawing a cursor at the correct position).

Of course, #harfbuzz operates on #Unicode codepoints, stored as 32bit unsigned integers. So, yesterday, I started implementing a string class holding the value in both #utf8 and #utf32 and converting between these.

Now I realized this wasn't all to helpful, so I'll start over. What I want is some immutable string class using char32_t internally and offering functions to create mutated clones...

#xcb #x11 #programming

Ein #Issue mit #Friendica, die Höhe der #Textbox betreffend, ist gefixed. Nice. ;)
Jetzt müsste vielleicht noch nerdica.net auf Stand gebracht werden, hüstel...
@ij

github.com/friendica/friendica…

Compose-box initially way too small by default · Issue #13720 · friendica/friendica

The compose-box is way too small by default. It has to be enlarged in height every time. That is not easy as the grabber-thingy on the bottom-right is extremely tricky to grab. The hight of the box...

GitHub