himselfv / wakan

Japanese and Chinese learning tool with dictionary
39 stars 7 forks source link

Font size indicated incorrectly at the start of the app #167

Closed himselfv closed 11 years ago

himselfv commented 11 years ago

Original report by me.

Originally reported on Google Code with ID 167

In the editor, font size combobox shows invalid value at the start of the application
if the saved font size equals 12.

This happens because at the start FFontSize is set to 12 (without updating the combobox
which shows 8) and then when the settings are loaded, they don't update the combobox
because FFontSize is already 12 and they assume everything is in sync.

I tried to fix this right away by updating FontSize instead of FFontSize at the start,
but for some reason in this case Combobox just comes up empty (Text='', ItemIndex=-1,
even though we even set ItemIndex when loading).

Reported by himselfv on 2013-05-03 19:41:32

himselfv commented 11 years ago
It seems that there's some bugness in the way VCL interacts with GDI, setting combobox.Text
or changing combobox.Items in FormCreate works fine while combobox.ItemIndex gets lost
and replaced with -1.

Fixed @r522 by setting FFontSize to 0 in FormCreate and properly setting FontSize to
FontSizeMedium in FormShow if its <= 0.

Reported by himselfv on 2013-05-08 08:22:31