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 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.
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>