Recent

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

bonmario

  • Sr. Member
  • ****
  • Posts: 346
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: 11853
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)

bonmario

  • Sr. Member
  • ****
  • Posts: 346
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: 2222
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: 4459
  • 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 and FPC 3.2 on Manjaro Linux 64-bit.

bonmario

  • Sr. Member
  • ****
  • Posts: 346
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