Lazarus

Programming => Widgetset => Cocoa => Topic started by: LazProgger on August 10, 2019, 10:33:06 pm

Title: Application Icon in Title Bar of Forms on Cocoa
Post by: LazProgger on August 10, 2019, 10:33:06 pm
During researching, I found that it seems to be an Apple convention not to show the application icon on a normal application window [not like Windows, for example].

For example: The convention is that the window title bar has an icon only when the window represents a file. Don't put an icon there in any other case. Look around various apps, they don't have icons.

Source: https://stackoverflow.com/questions/7038603/cocoa-icon-in-title-bar

The Carbon widgetset was not showing an icon by default, the Cocoa widgetset does. Is there a way to remove the icon / or is it an idea to change the default behavior?
Title: Re: Application Icon in Title Bar of Forms on Cocoa
Post by: skalogryz on August 10, 2019, 10:37:32 pm
https://wiki.freepascal.org/Cocoa_Internals/Forms#Icons
Title: Re: Application Icon in Title Bar of Forms on Cocoa
Post by: LazProgger on August 10, 2019, 11:21:21 pm
Ah, thank you very much!

Is there a reason that this variable is not set by default?
Title: Re: Application Icon in Title Bar of Forms on Cocoa
Post by: skalogryz on August 10, 2019, 11:25:26 pm
Is there a reason that this variable is not set by default?
Yes. LCL is Windows friendly in the first place, not Apple human interface design guides.

You can see the effect in Lazarus IDE itself. It's using an extensive number of Icons for different type of Windows. (MainIDE, Source Code, Find window, etc... - do use different icons). And those are followed in Cocoa version of IDE.

It's also striking, that the absence of those Icons do not bother the macOS user/developer.
Yet, as soon as they're shown, the application feels very foreign to macOS environment :)
Title: Re: Application Icon in Title Bar of Forms on Cocoa
Post by: LazProgger on August 10, 2019, 11:41:45 pm
Thanks, I see.

I am also not coming from the Apple/macOS world so I have not that much experience with what is looking native for such users and what not. I just came to that point by chance. And I like to understand things. ;)
Title: Re: Application Icon in Title Bar of Forms on Cocoa
Post by: VTwin on August 10, 2019, 11:47:33 pm
Interesting. I had not thought much about it. I never made use of the icons, and figured they were just eye candy. However, I see that the icon does act as a proxy or alias, for example in the Finder and Pages.

In Lazarus, dragging the icon gives an alias to the application. Since that does not seem useful, and does not follow the Cocoa UI guidelines, I'll guess I will turn them off. I'm sure no users will miss them!

Thanks!
Title: Re: Application Icon in Title Bar of Forms on Cocoa
Post by: VTwin on August 11, 2019, 01:01:39 am
https://developer.apple.com/design/human-interface-guidelines/macos/windows-and-views/window-anatomy/
Title: Re: Application Icon in Title Bar of Forms on Cocoa
Post by: trev on August 11, 2019, 02:26:35 am
https://wiki.freepascal.org/Cocoa_Internals/Forms#Icons

Thanks Dmitry! I had been wondering how to remove the app icon from macOS About boxes, I hadn't noticed the app icon appeared on the main form too ... it doesn't now :)
TinyPortal © 2005-2018