Recent

Author Topic: Application Icon in Title Bar of Forms on Cocoa  (Read 1871 times)

LazProgger

  • Full Member
  • ***
  • Posts: 103
Application Icon in Title Bar of Forms on Cocoa
« 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?

skalogryz

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2770
    • havefunsoft.com

LazProgger

  • Full Member
  • ***
  • Posts: 103
Re: Application Icon in Title Bar of Forms on Cocoa
« Reply #2 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?

skalogryz

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2770
    • havefunsoft.com
Re: Application Icon in Title Bar of Forms on Cocoa
« Reply #3 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 :)
« Last Edit: August 10, 2019, 11:28:54 pm by skalogryz »

LazProgger

  • Full Member
  • ***
  • Posts: 103
Re: Application Icon in Title Bar of Forms on Cocoa
« Reply #4 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. ;)

VTwin

  • Hero Member
  • *****
  • Posts: 1215
  • Former Turbo Pascal 3 user
Re: Application Icon in Title Bar of Forms on Cocoa
« Reply #5 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!
“Talk is cheap. Show me the code.” -Linus Torvalds

Free Pascal Compiler 3.2.2
macOS 12.1: Lazarus 2.2.6 (64 bit Cocoa M1)
Ubuntu 18.04.3: Lazarus 2.2.6 (64 bit on VBox)
Windows 7 Pro SP1: Lazarus 2.2.6 (64 bit on VBox)

VTwin

  • Hero Member
  • *****
  • Posts: 1215
  • Former Turbo Pascal 3 user
“Talk is cheap. Show me the code.” -Linus Torvalds

Free Pascal Compiler 3.2.2
macOS 12.1: Lazarus 2.2.6 (64 bit Cocoa M1)
Ubuntu 18.04.3: Lazarus 2.2.6 (64 bit on VBox)
Windows 7 Pro SP1: Lazarus 2.2.6 (64 bit on VBox)

trev

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2020
  • Former Delphi 1-7, 10.2 user
Re: Application Icon in Title Bar of Forms on Cocoa
« Reply #7 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