Recent

Author Topic: Bug in Font.Color in Windows?  (Read 394 times)

bonmario

  • Sr. Member
  • ****
  • Posts: 308
Bug in Font.Color in Windows?
« on: December 09, 2019, 07:36:25 pm »
Hi,

step to reproduce (Windows only):
- create a new project
- put a TMemo on form
- Memo1.Font.Color is "clDefault" (this is correct)
- on property "Font", click on the button "..."
- the color is clBlack
so, if you change for example ONLY the font name, when you click on the ok button "Ok", the property "Memo1.Font.Color" is changed in "clBlack"

If you save the project, compile it on Linux and run with dark theme, the "Memo1.Font.Color" is black, unreadable with dark theme !!!

This is a bug?

Thanks in advance, Mario

wp

  • Hero Member
  • *****
  • Posts: 7330
Re: Bug in Font.Color in Windows?
« Reply #1 on: December 09, 2019, 07:46:06 pm »
This is a bug?
Yes, but your bug. When you mix hard-coded colors with system, theme-dependent colors that's what is to be expected. In general, be very careful when changing colors because it is not clear what will happen (depending on the widgetset colors may not change at all - look at the Restrictions page of the object inspector or the Restriction Browser)
Mainly Lazarus trunk / fpc 3.2.0 / all 32-bit on Win-10, but many more...

bonmario

  • Sr. Member
  • ****
  • Posts: 308
Re: Bug in Font.Color in Windows?
« Reply #2 on: December 09, 2019, 08:07:56 pm »
Ok, thanks.

So, if i want change ONLY font name (for example setting it to "Courier new") without change their color i must:
- Click on the "..." button
- Change font to "Courier new"
- Click on the "Ok" button
- change property "Memo1.Font.Color" in clDefault

It's correct?

Thanks, Mario

ASerge

  • Hero Member
  • *****
  • Posts: 1632
Re: Bug in Font.Color in Windows?
« Reply #3 on: December 09, 2019, 09:26:39 pm »
An example patch is included. This patch fixes the assignment for Name, Height, Color, CharSet if it's were set to "default".

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3807
  • I like bugs.
Re: Bug in Font.Color in Windows?
« Reply #4 on: December 09, 2019, 11:03:09 pm »
An example patch is included. This patch fixes the assignment for Name, Height, Color, CharSet if it's were set to "default".
Thanks! I applied it in r62369. Please test everybody.
Mostly Lazarus trunk on Manjaro Linux.

bonmario

  • Sr. Member
  • ****
  • Posts: 308
Re: Bug in Font.Color in Windows?
« Reply #5 on: December 10, 2019, 08:30:02 am »
An example patch is included. This patch fixes the assignment for Name, Height, Color, CharSet if it's were set to "default".

Tried now, for me it's Ok.

Thanks, Mario

 

TinyPortal © 2005-2018