Sign in Join
Wiki copytemporary

Application Icon: what changed

Revision 0 to 1. Removed lines have a minus sign; added lines have a plus sign.

Title: Application Icon

OldNewLine
1+The application icon is usually displayed on the main window of the application, and it can be changed as per the code in [[Changing application Icon]].
2+
3+To change the icon of the executable itself, it is necessary to employ a platform-dependent technique. In Lazarus 0.9.27 support for this was added to the Project Options dialog, but it currently doesn't work for Linux because it requires calling an application to set the icon.
4+
5+## IDE support for the Application Icon
6+
7+Just set the icon in the Project Options dialog, accessible in the Project menu.
8+
9+Works for Windows and macOS.
10+
11+## Platform-specific techniques
12+
13+### Windows
14+
15+1\. Create a new file named "project.rc" (for example) containing:
16+
17+`  MAINICON ICON "editor.ico" `
18+
19+2\. Include in you project *.lpr file the following instruction:
20+
21+`  {$R project.rc} `
22+
23+Work with version 0.9.24 and above.
24+
25+3\. In the article [[Windows Icon]] you can see the best practices for creating the icon.
26+
27+### Setting the Application Icon on macOS
28+
29+Under macOS it is necessary to set an icon for the Application Bundle. This is done by adding a field to the Info.plist file, like this:
30+
31+``` xml
32+ <key>CFBundleIconFile</key>
33+ <string>iconfile.icns</string>
34+```
35+
36+Where iconfile.icns is located inside MyBundle.app/Contents/Resources
37+
38+You can find instructions to create an icns file [here](http://www.macinstruct.com/node/59)
39+
40+### Linux
41+
42+Under Linux application icons are located in special directories which are different on each Window Manager. The structure inside that directory, however, is standardized and described on the [Icon Theme Specification](http://www.freedesktop.org/Standards/icon-theme-spec).
43+
44+In order to determine how an application is launched the operating system uses a text file with the extension *.application*. This file provides different information including a description of the application, categories and locations of the executable and the icon. The standard is described in the [Desktop Entry Specification](http://www.freedesktop.org/wiki/Specifications/desktop-entry-spec/) of freedesktop.org.
45+
46+#### K Desktop Environment (KDE)
47+
48+You can find the directory for application icons for use by all users and for each user using the command:
49+
50+`kde-config --path icon`
51+
52+This should print a list of colon-separated paths to stdout.
53+
54+#### GNOME
55+
56+You can find the directory for application icons for use by all users and for each user using the command:
57+
58+`gnome-config --datadir`
59+
60+This should print a path to stdout, inside which is found a directory called pixmaps that attends to the Icon Theme Specification.
61+
62+#### LXDE
63+
64+In LXDE, icons are located in the directory
65+
66+`/usr/share/pixmaps`
67+
68+.application files are in
69+
70+`/usr/share/applications`
71+
72+---
73+*From the Free Pascal wiki, page "Application Icon", as it stood on 2020-08-02 after a change by Trev, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's [[Licensing]] page. If you have concerns about this material, [message the admin](/wiki-contact).*
74+Category: GUI
75+Category: Lazarus

Back to history