There's probably a better way of doing this, But this will do for now.
Added basic rounding to buttons.
Signed-off-by: Maarten van Gompel <proycon@anaproy.nl>
Add the members font and font_descriptor to struct clr_scheme, so that
it is possible to specify a font for each scheme.
During initialization create the font descriptors for each scheme.
Instead of initially setting the font descriptor when setting up the
buffer, set the font descriptor when drawing the text.
Signed-off-by: Frank Oltmanns <frank@oltmanns.dev>
Signed-off-by: Maarten van Gompel <proycon@anaproy.nl>
This isn't a good way to solve this, and cause restrictions and
breakages.
We should find a better way to enforce text inside of keys, probably
using a second buffer to write into.
This is a bit hacky. The main problem is that there is no way to tell
cairo to limit the width. It will wrap text accordingly to width and
height, it will add ellipsizes if it overlow the box, but if a word
width is larger than the box width, it will write it.
To avoid that, I make sure we don't go too much to the left, and I
redraw the background at the right of the keys. This is not visible
cause we damage track correctly the updated buffer coordinates.
I also moved the damage tracking from do_rectangle and draw_text to
higher draw_key and draw_layout.
- The full layout now squashes less keys in a row, to accomplish this
the semicolon/colon, equal/plus and alt keys had to be sacrificed
from the full layout (they're on the special/symbols layout still).
- The half-keys in the simple layout are removed, giving a bit more
space.
- The default total keyboard height has been slightly enlarged (10px)
- The compose key moved down, it was too close to the 'a' (accidental
presses). The tab key moved to the top-right.
- The spacing between the buttons is slightly larger (aesthetic only)
- The key for layer switching is now labelled more consistently with an icon, and indicates direction of switching with an arrow
- An extra "index" layout was added that can be activated by pressing
Compose + the next/prev layout button. It has a key for each layout,
even those not specified at start. This special layout does not appear
in the normal layer cycling.
- The "Abc" key on secondary layers returns to the last alphabetical layout
- The compose layouts automatically hide when the user presses the space
where there are no keys, no need to explicitly press the "Abc" key.
The user can optionally override the list of keyboard layers compiled
into the executable. Right now this only works for non-landscape mode
though.
Pull out the logic to parse the list of keyboard layers so that we can
reuse it to also optionally override layers in landscape mode.
- shift (or capslock) switch to the previous layer in the defined order
- control, alt or compose resets the view to the first layer
related fix: compose key resets on layer switch (doesn't stick now)
Previously wvkbd would commit an (usually) unchanged surface at the
framerate of the compositor, this only commits the buffer when we render
something new.
Signed-off-by: Maarten van Gompel <proycon@anaproy.nl>
the use-case for this is simple 'swipe'-typing:
another program can take the output, guess the word which is being typed, and type the rest of the word