Recent

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

Hansaplast

  • Hero Member
  • *****
  • Posts: 689
  • Tweaking4All.com
    • Tweaking4All
Re: Tpanel became ugly in trunk?
« Reply #30 on: January 09, 2024, 11:15:00 am »
Unfortunately you will have to set ParentBackground to false.


Code: Pascal  [Select][+][-]
  1. ParentBackground := false


Definitely not ideal, and I would very much prefer to see the old behavior back as the default, especially under macOS. It's the proper look for macOS.
Please share what you think, as a Mac user, maybe we can get the discussion going again.
I guess the question is: should all Lazarus apps look identical (ugly Windows look) or should all Lazarus apps look like a native app?
I really prefer the native look very much, which would make Lazarus the ultimate cross-platform tool for me.


Note: much respect towards Rich2014 for his efforts on Cocoa.
« Last Edit: January 09, 2024, 12:08:09 pm by Hansaplast »

msintle

  • Sr. Member
  • ****
  • Posts: 256
Re: Tpanel became ugly in trunk?
« Reply #31 on: January 09, 2024, 12:05:42 pm »
I guess the quest is: should all Lazarus apps look identical (ugly Windows look) or should all Lazarus apps look like a native app?
I really prefer the native look very much, which would make Lazarus the ultimate cross-platform tool for me.

To me that is a no-brainer.

My own noble view is that the platform native look is always the only reasonable choice on any given platform, and that this is a self-evident truth which requires no arguing over.

Furthermore, why would you want the look of a dying operating system that has been relegated by even its very own manufacturer into a second-class citizen, in favor of its cloud products?

Windows 10 was a square nightmare, and Windows 11 is a nightmare squared. A schizophrenic horror show with pointless, ugly UWP apps that can only be built with platform vendor tools. Many OS settings are inaccessible through the OS vendor's own UWP apps, while others still are being chopped off the trusty old Control Panel and similar, clean looking Win32 apps.

Let's try to keep our side of the equation in check - meaning, no regressions?

Please?

MISV

  • Hero Member
  • *****
  • Posts: 804
Re: Tpanel became ugly in trunk?
« Reply #32 on: January 09, 2024, 04:03:53 pm »
Unfortunately you will have to set ParentBackground to false.


Code: Pascal  [Select][+][-]
  1. ParentBackground := false


Definitely not ideal, and I would very much prefer to see the old behavior back as the default, especially under macOS. It's the proper look for macOS.
Please share what you think, as a Mac user, maybe we can get the discussion going again.
I guess the question is: should all Lazarus apps look identical (ugly Windows look) or should all Lazarus apps look like a native app?
I really prefer the native look very much, which would make Lazarus the ultimate cross-platform tool for me.


Note: much respect towards Rich2014 for his efforts on Cocoa.

Native look of course... 

On Windows ParentBackground = True would retain theming.... But I guess on Mac is may be reverse....

(I understand the wish for having an invisible container used for layout purporses.... But generally it is unwise to make breaking changes. Would probably have been better with a new property)

Anyhow, if fixing the property setting I guess my problems are limited since I do so much runtime adjustments anyhow. I will report back later when I have begun the process of updating my Mac builds. (Been away for a 1½ years)










wp

  • Hero Member
  • *****
  • Posts: 12476
Re: Tpanel became ugly in trunk?
« Reply #33 on: January 09, 2024, 04:56:00 pm »
@rich2014: Could we introduce a property to allow both cases
- panel for layout purposes
- panel for visual grouping?

In Windows(Linux (?) the setting will not make a difference, but on Mac it would have the current behaviour in the former, and the requested behaviour in the latter case.

Not sure about the name, though: Maybe "PanelKind: TPanelKind = (pkLayout, pkVisualGroup)"? Or "VisualGrouping: Boolean"?


zeljko

  • Hero Member
  • *****
  • Posts: 1670
    • http://wiki.lazarus.freepascal.org/User:Zeljan
Re: Tpanel became ugly in trunk?
« Reply #34 on: January 09, 2024, 06:15:51 pm »
Why not UseThemePanel ? That's something we don't have in TPanel options. Qt also have bit different theme panels.

wp

  • Hero Member
  • *****
  • Posts: 12476
Re: Tpanel became ugly in trunk?
« Reply #35 on: January 09, 2024, 07:28:30 pm »
Yes, that's it

Hansaplast

  • Hero Member
  • *****
  • Posts: 689
  • Tweaking4All.com
    • Tweaking4All
Re: Tpanel became ugly in trunk?
« Reply #36 on: January 10, 2024, 11:13:27 am »
Maybe I'm totally missing the point completely here ... (apologies if I do)
I understand that at some point modifying Frame3d was wanted for another issue (?). Maybe for that other control this may be approproate - I do not know.


I'm just wondering how this relates to the default appearance of TPanel, and why TPanel should look different than a Panel in XCode (as far as I know, this is called a Box in Cocoa).
(assuming that "native look" is what Lazarus is going for)


Apologies up front, I'm not trying to criticize here, I'm just trying to understand.

msintle

  • Sr. Member
  • ****
  • Posts: 256
Re: Tpanel became ugly in trunk?
« Reply #37 on: January 11, 2024, 01:12:59 pm »
BTW, if the goal is the grouping of controls, isn't TGroupBox the right place to do it, by suggestion of the component name - a box of grouped controls?

And again, "by the way"; a panel (in the physical world) is very visible by design - so a TPanel's primary purpose ought to be proper visibility, and not grouping - did I get that right?

If you want to group stuff, TGroupBox; if you want to create user visible surfaces, TPanel!

Seems obvious to me from the naming of the components themselves.

But what do I know?

rich2014

  • New Member
  • *
  • Posts: 13
Re: Tpanel became ugly in trunk?
« Reply #38 on: January 25, 2024, 04:06:56 pm »
@wp @zeljko

i agree to add the property to LCL.

rich2014

  • New Member
  • *
  • Posts: 13
Re: Tpanel became ugly in trunk?
« Reply #39 on: January 25, 2024, 04:16:27 pm »
let me clarify again:

1. i did not modify any TPanel code, only modified TCocoaWidgetSet.Frame3d()

2. i agree with the use of native style

3. the design of LCL is flawed in this regard. it is specified to add a 3D frame to TPanel through BevelInner and BevelOuter, rather than theme attributes.

4. in LCL, not Cocoa, the original intention of TPanel is to logically manage components in groups, while the meaning of TGroupBox includes both group management (Group) and appearance (Box).

Hansaplast

  • Hero Member
  • *****
  • Posts: 689
  • Tweaking4All.com
    • Tweaking4All
Re: Tpanel became ugly in trunk?
« Reply #40 on: January 26, 2024, 11:31:46 am »

Thanks Rich2014 for clarifying that, and thank you very much for your Cocoa contributions - its very much appreciated!


Wether TPanel is used for layout purposes or visual grouping; whenever the panel has a visible border, then it should by default look like native controls, right? And optionally look like the Windows rectangle panels?


Adding a property in LCL "UseThemePanel" as suggested (if I undersood Zelkjo correctly) could be a good option.
I can imagine it to be preferred to be set by default to match the native look/theme.


Apologies if I sound repetitive, just making sure that when we (macOS users) use TPanel, we would not have to change a property, or update all our projects to set said property, to see a native looking TPanel.

rich2014

  • New Member
  • *
  • Posts: 13
Re: Tpanel became ugly in trunk?
« Reply #41 on: January 26, 2024, 03:13:17 pm »
@Hansaplast

thx for your opinion, they are all valuable.

i think, most of the time, Lazarus IDE itself should be used as a reference application for LCL.

regarding the use of TPanel and TGroupBox, it is recommended to refer to the IDE Options Dialog, which uses TGroupBox extensively as a group and is presented in a native style. TPanel is only used when the appearance is not visible.

seek common ground while reserving differences. after LCL adds attributes, we can apply them according to our own habits.

Josh

  • Hero Member
  • *****
  • Posts: 1344
Re: Tpanel became ugly in trunk?
« Reply #42 on: January 26, 2024, 04:43:46 pm »
Hi

My thoughts....

I do not recall anyone complaining of the native look of tpanel on MacOs previously, which would suggest everyone was happy.

Tgroupbox and tpanel are nowhere near interchangeable, just look at the available properties of a tpanel, and very importantly tpanel has an onpaint event, which i use extensively to customize the look of a tpanel.

I would expect tpanel to have a native look by default , like tbutton, tedit, tform etc does on MacOS.

If an additional property were to be added i would suggest CornersDesign=Native[default],Square, Round.  Where Native being the default, that way a project would be useable on older laz installs as the property would not be added to lfm unless it is changed from default(native).  Native in this case being rounded corners on MacOS
The best way to get accurate information on the forum is to post something wrong and wait for corrections.

Hansaplast

  • Hero Member
  • *****
  • Posts: 689
  • Tweaking4All.com
    • Tweaking4All
Re: Tpanel became ugly in trunk?
« Reply #43 on: January 26, 2024, 06:48:00 pm »

To be clear: Rich2014 didn't change TPanel. The change is just an unfortunate side effect of modifying Frame3D (if I understood that right).

TPanel is only used when the appearance is not visible.
seek common ground while reserving differences. after LCL adds attributes, we can apply them according to our own habits.


I would assume though that TPanel is always visible, and always has a border, by default, right? As far as I recall, this is the case even in Delphi.
Just put a TPanel on a form and there it is: visible.
It is indeed a usefull component to assist in positioning/grouping controls, I do use it for that purpose as well at times, but one would need to set the borders accordingly to make it not visible - always has been that way, right?


Hearing other Mac users, I can hear there is indeed a preference for the native style, so I'd assume we'd want this to be the default style then.
Adding an option to add rectangle corners would be great for those exceptions where one would want this.


Would this work for all?  :)

MISV

  • Hero Member
  • *****
  • Posts: 804
Re: Tpanel became ugly in trunk?
« Reply #44 on: March 21, 2024, 10:26:09 am »
IMO: Native should be default

 

TinyPortal © 2005-2018