Recent

Author Topic: SpeedButton Flat  (Read 487 times)

lelebass

  • New Member
  • *
  • Posts: 34
SpeedButton Flat
« on: May 20, 2020, 12:24:29 pm »
I came across a problem with my application, it looks like it is relative to how SpeedButton are rendered in different macOS versions.

I was able to reproduce the issue on a simple application with a SpeedButton on a form. Set the SpeedButton.Flat property to True and set the Form.Color:=clBlue.

Compiled with Lazarus 2.0.8 x64. The same application renders differently with Sierra and Mojave. The same code compiled on Windows 10 gives the same result as Mojave.

This is weird. I wonder what changed in Cocoa between the two OS release. Should I file a bug report?

Ciao,
Daniele

lelebass

  • New Member
  • *
  • Posts: 34
Re: SpeedButton Flat
« Reply #1 on: May 21, 2020, 04:05:58 pm »
Tested with Trunk, same results.  :(

Can this be linked to this bug?

https://bugs.freepascal.org/view.php?id=35555

I filed a new bug:

https://bugs.freepascal.org/view.php?id=37127

Ciao,
Daniele
« Last Edit: May 21, 2020, 04:44:01 pm by lelebass »

lelebass

  • New Member
  • *
  • Posts: 34
Re: SpeedButton Flat
« Reply #2 on: May 26, 2020, 10:13:45 am »
The same application renders differently with Sierra and Mojave. The same code compiled on Windows 10 gives the same result as Mojave.

After several tests, I can say that the situation is more complex than I initially thought. The behaviour in Mojave of the application compiled with 2.0.8 is not exactly the same as in Windows 10, but very similar and usable. 

Lazarus 2.0.8 Mojave - Correctly renders the button as flat (and trasparent), but does not highlight the button when the mouse is over
Lazarus 2.0.8 Sierra - Incorrect rendering of the button (missing transparency?)

Since the bug https://bugs.freepascal.org/view.php?id=35555 was reported and closed between last year May and June I tried to see what happens using Lazarus 2.0.0.

Lazarus 2.0.0 Mojave - Correctly renders the buttons as flat, does not highiligth the button on mouse over, but has an incorrect rendering when button is released. This happens with the application compiled and launched outside the IDE. If the application is launched inside the IDE with debugger everything is working as expected :o :o :o
Lazarus 2.0.0 Sierra - All correct.

Something definitely changed between Sierra and Mojave and I guess this has been addressed with a patch by Dmitry when closing bug 0035555. But I think the patch has introduced backwards compatibility problems.

I would like to help to try to fix this. I went trough the documentation:

https://wiki.lazarus.freepascal.org/Cocoa_Internals

I noticed that here:

https://wiki.lazarus.freepascal.org/Cocoa_Internals/Buttons

under TSpeedButton there is a note "This is not an actual control button, it's LCL-drawn button. todo: no themes API customdrawn controls used?".

Any hint on how to be helpful apart from reporting bugs and testing?

Ciao,
Daniele
« Last Edit: May 26, 2020, 03:57:02 pm by lelebass »

skalogryz

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2435
    • havefunsoft.com
Re: SpeedButton Flat
« Reply #3 on: May 27, 2020, 01:50:05 am »
Something definitely changed between Sierra and Mojave and I guess this has been addressed with a patch by Dmitry when closing bug 0035555. But I think the patch has introduced backwards compatibility problems.
The first thing that comes to the mind is the default NSView transparency got changed.

There were some internal changes in rendering engine of Apple. They've switched from optional "drawing layers" to mandatory "drawing layers".

The item #35555 might not have been fixed at a time.
The report doesn't specify the particular version of macOS experiencing the issue.

I can tell you that Mojave was used for testing when the item was closed.
Patron Cocoa Widgetset development https://www.patreon.com/skalogryz

lelebass

  • New Member
  • *
  • Posts: 34
Re: SpeedButton Flat
« Reply #4 on: May 27, 2020, 04:08:00 pm »
In my tests I used the latest available versions of Mojave 10.14.6 and Sierra 10.12.6.

Ciao,
Daniele

 

TinyPortal © 2005-2018