Recent

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

LazProgger

  • Jr. Member
  • **
  • Posts: 91
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: 2269
    • havefunsoft.com
Patron Cocoa Widgetset development https://www.patreon.com/skalogryz

LazProgger

  • Jr. Member
  • **
  • Posts: 91
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: 2269
    • 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 »
Patron Cocoa Widgetset development https://www.patreon.com/skalogryz

LazProgger

  • Jr. Member
  • **
  • Posts: 91
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: 775
  • 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

macOS 10.13.6: Lazarus 2.0 fixes svn 61930 (64 bit Cocoa)
Ubuntu 18.04.3: Lazarus 2.0.4 (64 bit on VBox)
Windows 7 Pro SP1: Lazarus 2.0.4 (64 bit on VBox)
fpc 3.0.4

VTwin

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

macOS 10.13.6: Lazarus 2.0 fixes svn 61930 (64 bit Cocoa)
Ubuntu 18.04.3: Lazarus 2.0.4 (64 bit on VBox)
Windows 7 Pro SP1: Lazarus 2.0.4 (64 bit on VBox)
fpc 3.0.4

trev

  • Full Member
  • ***
  • Posts: 214
  • Former Delphi 7 and Delphi 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 :)
o Lazarus v2.1.0 r61775, FPC v3.3.1 r42640, macOS 10.14.6 (with sup update), Xcode 10.3
o Lazarus v2.1.0 r61574, FPC v3.3.1 r42318, FreeBSD 12.0 (Parallels VM)
o Lazarus v2.1.0 r61574, FPC v3.0.4, Ubuntu 18.04 (Parallels VM)