altsan / os2-estyler

Styler (eStyler) for OS/2
GNU General Public License v3.0
3 stars 1 forks source link

Use cairo graphics library for painting controls #2

Open ydario opened 7 years ago

ydario commented 7 years ago

The current code uses PM GPI to draw controls. This does not allow features like anti aliasing or similar.

Cairo graphics library allows more sophisticated graphics drawing and text anti aliasing.

ydario commented 7 years ago

This work is being done in the cairo branch.

ydario commented 7 years ago

99dce0c Yuri Dario Build system updates for cairo SDK. Issue#2. 53145c6 Yuri Dario Add new PNG bitmap files for cairo backgrounds. Issue#2. def85d7 Yuri Dario Replace PM API with cairo SDK for titlebar painting. Issue#2. c7bb90f Yuri Dario Configuration panel updates, this is still work in progress for bitmaps. Issue#2.

ydario commented 7 years ago

Cairo support for pushbuttons is possible too. Work is done in f2802dc (Add pushbutton drawing code. Common code is being moved to a single location. Issue#2).

Only text buttons are supported, some more work is required to support bitmap/icon buttons: I think that I could simply draw bitmap bits over the rendered cairo surface. Also support for DT_MNEMONIC is required to complete text drawing.

Also in f2802dc I started using the same drawing code for DLL and configuration applet, thus making simpler to test final results.

ydario commented 7 years ago

While playing with cairo api, I got it to draw round borders using anti aliasing, which leads to an interesting solution. Instead of dropping code, I added a new option for round borders in b9b73aac.

ydario commented 7 years ago

And now with support for underlining the mnemonic char in 75c07d8e, I think the code is complete.

ydario commented 7 years ago

There is only a small alignment problem, button text seems to be positioned too near top border and maybe slightly to the left.

Also drawing emphasis should be replaced if font size does not match the one used by PM.