Expand description
Application icons. Without [app].icon every target uses the Bern logo;
with it, the declared square PNG. [app.icon] can also give a platform
its own icon: another square PNG, or the icon in the platform’s own form
(an .icns file, an .ico file, an .appiconset folder, an Icon
Composer .icon folder for macOS and iOS, a tvOS .brandassets folder,
an Android res folder, an icon theme folder, a folder of page icons),
which is shipped as it is. The platform
containers (.ico on Windows, .icns on macOS) hold PNG images as they
are, so nothing here decodes or scales pixels: the logo ships
pre-rendered at every size the platforms ask for, and a declared PNG is
used at its own size. Only tvOS’s layered icon is drawn from the square
one, in crate::brand_assets.
Structs§
- Android
Res - The files of an Android
resfolder with a launcher icon. - Image
- One PNG image of an icon.
- Theme
Icon - One application icon in an icon theme folder.
Enums§
Constants§
- ADAPTIVE_
SIDE - The side of an Android adaptive icon’s layers in pixels: 108 dp at the
density of
mipmap-xxxhdpi. - DECLARED_
SIZES - Sizes a declared icon may have: the large sizes every platform scales down from.
- DEFAULT_
SVG - The Bern logo, the default icon, as SVG.
- ON_DARK
- The colour a status area’s own pictures are in on a dark bar.
- ON_
LIGHT - The colour a status area’s own pictures are in on a light bar.
- PLATFORMS
- Platforms that can have an icon of their own under
[app.icon], named as[targets]names them.
Functions§
- accepted
- What
platformtakes under[app.icon], for messages. - adaptive_
layers - An Android adaptive icon made from a square icon image: the foreground
layer (PNG,
ADAPTIVE_SIDEsquare) holds the image over the 72 dp in the middle that the launcher’s shape shows, and the background is the colour of the image’s corner, or white where the corner is clear. A full-bleed icon on a plate thus fills the launcher’s shape, as other apps’ icons do, instead of being shrunk inside a plate of the launcher’s own. - alternate_
name - The
[app.alternate_icons]name aWindowSet(icon:)variant names:Skinisskin,DarkSkinisdark_skin. - alternate_
source - Where the alternate icon
namecomes from onplatform: its own entry under[app.alternate_icons.<name>], else itsdefault;Nonewhen it has neither. - alternates
- The alternate icons
WindowSet(icon:)switches to onplatform, by name, with where each comes from; the error names one with nothing for the platform. - android_
res - Read an Android
resfolder: resource folders (mipmap*,drawable*,values*) whose files make the launcher icon@mipmap/ic_launcher. Files Bern writes itself (values*/strings.xml,values*/themes.xml) cannot be in it. - app_
icon_ set - The files of an iOS
.appiconsetfolder:Contents.jsonand the images it names, all at the top of the folder. - check
- Check a declared icon: a square PNG of 256, 512 or 1024 pixels. Returns its size.
- check_
icns - Check a macOS icon file: entries that add up to the length it states.
- check_
ico - Check a Windows icon file: images inside the file.
- check_
native - Check an icon in
platform’s own form atpath, a file or a folder: an.icnsfile (macOS), an.icofile (Windows), an.appiconsetfolder (iOS), an Icon Composer.iconfolder (macOS and iOS), a.brandassetsfolder (tvOS), aresfolder (Android), an icon theme folder (Linux), or an SVG or a folder of page icons (browser). - choices
- The icons
WindowSet(icon:)chooses among, in its enum’s order: each variant’s name, and the alternate icon it shows (None:[app.icon], forDefault). Empty when the window set does not choose. - declared
- The icon written for
platform: its own entry under[app.icon], else the one for every platform. Paths are relative toBern.toml. - default_
images - The logo in
shape, smallest first. - files_
in - The files below
dir, relative to it and sorted. A symbolic link is an error: an icon names the files it ships. - icns
- A macOS icon (
.icns) holding the images as PNG, each under the entry types for its size (the plain and the Retina slot). - ico
- A Windows icon (
.ico) holding the images as PNG. Images larger than 256 pixels are kept only when there is nothing smaller, as Windows reads icons up to 256 pixels. - icon_
document - The files of an Icon Composer document (an
.iconfolder):icon.jsonand the layer images it names, which sit inAssets. - images
platform’s icon as PNG images, smallest first: the logo inshape, or the declared PNG (relative to the project directory) at its own size. A platform whose icon is in its own form has no images here; read it withsource.- is_
default - Whether
platformuses the Bern logo. - is_
icon_ document - Whether a declared icon is an Icon Composer document, the layered
.iconfolder that macOS 26 and iOS 26 draw in Liquid Glass.actoolcompiles it, and draws flat images from it for earlier systems. - is_
png_ name - Whether a declared icon is a PNG by its name.
- largest
- The largest image.
- page_
icons - Read a folder of page icons: files at its top, of the kinds a page
links (
.svg,.ico,.png, and a.webmanifestormanifest.jsonnaming the icons beside it). At least one image. - png_
size - Width and height of a PNG, from its header.
- source
- Where
platform’s icon comes from. - status_
image - The one-colour SVG of
StatusItem(image:), a declared resource name. - status_
picture - The status item’s picture,
sidepixels square: the SVG atpathfitted and centred, its shape (what it covers, whatever its colours) incolor. PNG. - status_
pictures - The status item’s picture at each of
sides, smallest first. - theme_
icons - Read an icon theme folder laid out like
hicolor:<size>/apps/<name>files, with<size>such as48x48,48x48@2,scalableorsymbolic, all of one name (the symbolic one ends in-symbolic.svg). At least one PNG of a size. The name is replaced by the application’s.