Recent

Author Topic: Tpanel became ugly in trunk?  (Read 9718 times)

Hansaplast

  • Hero Member
  • *****
  • Posts: 687
  • Tweaking4All.com
    • Tweaking4All
Tpanel became ugly in trunk?
« on: October 11, 2023, 03:59:08 pm »
TPanel used to look like a TGroupbox and TPageControl, matching the design/look, with a nice modern flat look and rounded corners.


However, somewhere in the last few trunk changes (pre October 2023), TPanel degraded to a Windows 3.1 boxy Tanel with square corners and raised panels. (see screenshots)


It could be that I'm the only one experiencing on both my Mac, in that case any assistance would be welcome to make it look normal again.
Confirmation by others would be very welcome as well of course 😊


Note: I did report this as a bug as well (bugtracker 40545).


I have this issue on both my Mac's:


Reproduced on:


Lazarus/FPC Version: Lazarus 3.99 (rev main_3_99-793-g 07025f3b) FPC 3.3.1 aarch64-darwin-cocoa
Operating System: macOS Ventura (13.5.2)
CPU: 64 bit ARM (AARCH64)


and:
       
Lazarus/FPC Version: Lazarus 3.99 (rev main_3_99-758-g 3b4b6dd3) FPC 3.3.1 x86_64-darwin-cocoa
Operating System: macOS Sonoma (14.0)
CPU: 64 bit x86_64
 

KodeZwerg

  • Hero Member
  • *****
  • Posts: 2269
  • Fifty shades of code.
    • Delphi & FreePascal
Re: Tpanel became ugly in trunk?
« Reply #1 on: October 11, 2023, 06:20:00 pm »
It looks to me like theming has change/applied, try to turn it off in project options.
If it was off, try opposite :)

Did it helped?
« Last Edit: Tomorrow at 31:76:97 xm by KodeZwerg »

Hansaplast

  • Hero Member
  • *****
  • Posts: 687
  • Tweaking4All.com
    • Tweaking4All
Re: Tpanel became ugly in trunk?
« Reply #2 on: October 11, 2023, 06:33:29 pm »
Thanks KodeZwerg for chiming in. 😊

Unfortunately, I do not see a theming option under Project Option (p.s. I am working on a Mac).

Josh

  • Hero Member
  • *****
  • Posts: 1321
Re: Tpanel became ugly in trunk?
« Reply #3 on: October 11, 2023, 06:39:14 pm »
excuse daft question,  are you sure your widgetset is set as cocoa (native macOS)? its not set to qt? if you using it of course.
The best way to get accurate information on the forum is to post something wrong and wait for corrections.

Hansaplast

  • Hero Member
  • *****
  • Posts: 687
  • Tweaking4All.com
    • Tweaking4All
Re: Tpanel became ugly in trunk?
« Reply #4 on: October 11, 2023, 07:23:44 pm »
Totally legit question for sure ... but nope.
It's set to default, and based on your suggestion I even verified it was set it to Cocoa.


Even tried QT, since I was curious what would happen, but that did not even compile on my Mac.
Good suggestion though - thanks for chiming in!  :)

zeljko

  • Hero Member
  • *****
  • Posts: 1639
    • http://wiki.lazarus.freepascal.org/User:Zeljan
Re: Tpanel became ugly in trunk?
« Reply #5 on: October 11, 2023, 07:40:03 pm »
IMO if TPanel BevelInner & BevelOuter properties are default (bvNone and bvRaised) then previous version of TPanel (that one looking nice) is buggy.
Maybe we need some new property eg ThemePainted, so TPanel looks same like other panels on operating system, so in that case you can get nice looking TPanels again on cocoa.

Hansaplast

  • Hero Member
  • *****
  • Posts: 687
  • Tweaking4All.com
    • Tweaking4All
Re: Tpanel became ugly in trunk?
« Reply #6 on: October 11, 2023, 07:47:12 pm »
Good point.


Just wondering since TPanel and TGroupbox under Windows share the same native look (square corners for example), shouldn't that be the case under macOS as well? Cocoa seems to use rounded corners, and when looking at applications from Apple, then I do not see the square style Panels anywhere ...


p.s. I've tried using a TGroupbox as a replacement, but even a blank caption will keep the caption space above the Groupbox - effectively making anchoring and aligning no longer work (for this scenario). Silly as it sounds, I even tried TPageControl, but that showed the same issue, even if tabs were set to not show (ShowTabs=false, TabVisible=false).

msintle

  • Full Member
  • ***
  • Posts: 133
Re: Tpanel became ugly in trunk?
« Reply #7 on: October 11, 2023, 10:37:18 pm »
+1 here - we're seeing lots of odd behavior/sizing and position changes with TTabSheet, which has been a breaking change on macOS.

Is there a valid reason why we're having these regressions on macOS, surely no macOS user would prefer these ugly looks over the industry standard previous experience?

Hansaplast

  • Hero Member
  • *****
  • Posts: 687
  • Tweaking4All.com
    • Tweaking4All
Re: Tpanel became ugly in trunk?
« Reply #8 on: October 12, 2023, 11:04:35 am »
Anyone any suggestions if one could create/derive a TPanel variant that does show the old way?
The new look definitely ruins my application (only released for macOS) and I'd like find a fix/workaround for it.
Or should I wait for a conclusion if the new and ugly TPanel should revert back to the old nice and more OS appropriate look?


Been trying to dig through the code changes in Gitlab (this one and this one) but in all honesty, I no longer know what I'm looking at.
Any help would be welcome.

Josh

  • Hero Member
  • *****
  • Posts: 1321
Re: Tpanel became ugly in trunk?
« Reply #9 on: October 12, 2023, 11:21:43 am »
curious to know is this evident on fixes branch of fpc and laz, if its ok there, then report as trunk issue, so  that it can be fixed in trunk and hopefully then RC2.

unfortunately my macs are at home, so cant test anything until weekend at earliest.
The best way to get accurate information on the forum is to post something wrong and wait for corrections.

Hansaplast

  • Hero Member
  • *****
  • Posts: 687
  • Tweaking4All.com
    • Tweaking4All
Re: Tpanel became ugly in trunk?
« Reply #10 on: October 12, 2023, 11:38:41 am »
As far as I can see, this is only in lazarus trunk, however since we moved to Gitlab I'm completely lost where what is or goes.

Seeing Rich2014 his response this change was done intentional to make TPanel look like the Win32 TPanel (see also: Cocoa: Frame3d: to be consistent with Win32).


I do understand trying to match the TPanel used elsewhere (Linux/Windows), and as much as I appreciate the amazing work done by the devs; Design-wise the win32 TPanel is so far off the macOS GUI design and look, that I'm wondering if this is what Mac users/developers really would want?
And of course: what are my options here to fix this for my own applications?

Josh

  • Hero Member
  • *****
  • Posts: 1321
Re: Tpanel became ugly in trunk?
« Reply #11 on: October 12, 2023, 12:54:52 pm »
I would assume that the tpanel should follow the widgetset guidelines as nspanel has had rounded corners for years now.

could you try modifying the nspanel.inc file and put it back to what it was to see if itworks then?

If it works then put on bugtracker.

skalogryz major effort in getting cocao working in the first place, he might have some valuable insight, so maybe worth trying to contact him.

I agree that as it is; its is now a 'Broken' widgetset; as it does not follow Apples guidline,and even more importantly Apple, if not client; would more than likely not accept an app that does not follow the widgetset guidlines. Apple Users are very finicky people.

Could you not set your project options to maximum compatibilty, that way you could at least finish it using fixes branch
The best way to get accurate information on the forum is to post something wrong and wait for corrections.

Hansaplast

  • Hero Member
  • *****
  • Posts: 687
  • Tweaking4All.com
    • Tweaking4All
Re: Tpanel became ugly in trunk?
« Reply #12 on: October 12, 2023, 02:16:11 pm »

I agree: the widgetset feels broken now indeed.

I'd like to put the original nspanel.inc back if that is the one I should be looking for (or should this be lcl/interfaces/cocoa/cocoawinapi.inc?), even if it would be just for my own setup for now. Just do not know where to get the right one ... with Gitlab I really lost all sense of version numbers. Suggestions are welcome. I use FPCUpdeluxe to build Lazarus/FPC, and I've gone back about 2 months with "setup+" options, but have not gotten it to work proper again.


Also: I did see that Rich2014 made the "looks like win32" change intentionally, so it would be nicer to have this conversation with him first before pushing something in bugtracker.

Josh

  • Hero Member
  • *****
  • Posts: 1321
Re: Tpanel became ugly in trunk?
« Reply #13 on: October 12, 2023, 04:02:01 pm »
reading bugtracker, i do not understand why any MacOS Developer would want the tpanel to mimick a Win32 Panel.

adding an extra style would be poblematic, ie if you add a style bsNative for Cocoa, what happens when you x compile to Windows that Style is not defined.

I do not recall any user complaining that the old tpanel appearance was bad/faulty or ugly.

The change however seems to disprove the saying 'If it aint broke, don't fix it'.

As i cant chck anyhing yet, what does an nswindow look like, does it have rounded corners?
The best way to get accurate information on the forum is to post something wrong and wait for corrections.

Hansaplast

  • Hero Member
  • *****
  • Posts: 687
  • Tweaking4All.com
    • Tweaking4All
Re: Tpanel became ugly in trunk?
« Reply #14 on: October 12, 2023, 04:35:36 pm »
I do not know or understand the need to change TPanel either and I'm sure the majority of Mac dews will not want to use the Win32 TPanel either.


So here my knowledge on the inner workings of Cocoa runs short for sure.
I can see in Xcode that there is a "Box" for grouping controls, which works with or without caption, has rounded corners, and a slightly darker background - see attached picture.
Not sure how to get NSWindow (heard of it, just no clue where to find it).


Having said that, Rich made the point that GroupBox would be the more appropriate control for this, and he may be very right about that. But only if one can hide the caption, which then would not be the same as in Windows or Linux, and you'd still have an ugly TPanel folks would only use on macOS when it is invisible to group some controls.


So I'd probably go for TPanel the way it was, or with an extra option to have it go native.


 

TinyPortal © 2005-2018