Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

spec: Mention the already-supported scale attribute of <icon/> #353

Merged
merged 1 commit into from Sep 9, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
@@ -270,23 +270,34 @@
<literal>stock</literal> icons are loaded from stock. The icon name should never include any file-extension or path.
</para>
<para>
<literal>cached</literal> icons are loaded from the AppStream icon cache. The icon tag should contain the icon file name, including it's
<literal>cached</literal> icons are loaded from the AppStream icon cache. The icon tag should contain the icon file name, including its
extension. It must not contain a full or relative path to the icon file.
This icon type may have <literal>width</literal> and <literal>height</literal> properties.
If targeting a hi-DPI screen, this icon type may have a <literal>scale</literal> property.
ximion marked this conversation as resolved.
Show resolved Hide resolved
</para>
<para>
<literal>local</literal> icons are reserved for AppStream data installed by local applications or via 3rd-party application installers.
They should specify a full file path.
This icon type may have <literal>width</literal> and <literal>height</literal> properties.
If targeting a hi-DPI screen, this icon type may have a <literal>scale</literal> property.
</para>
<para>
<literal>remote</literal> icons loaded from a remote URL. Currently, only HTTP urls are supported.
This icon type should have <literal>width</literal> and <literal>height</literal> properties.
If targeting a hi-DPI screen, this icon type may have a <literal>scale</literal> property.
</para>
<para>
If specified, the <literal>scale</literal> property is defined as in the
<ulink url="https://specifications.freedesktop.org/icon-theme-spec/icon-theme-spec-latest.html#definitions">Freedesktop Icon Theme Specification</ulink>.
It’s an integer value ≥1 indicating how many pixels in the image represent a logical pixel on the display, in each dimension.
This allows icons for hi-DPI screens to be displayed at the same logical size as on lower resolution screens, but without upscaling artifacts.
</para>
<para>
Examples of the different methods to specify an icon:
</para>
<programlisting language="XML"><![CDATA[<icon type="stock">gimp</icon>
<icon type="cached">firefox.png</icon>
<icon type="cached" width="128" height="128" scale="2">firefox.png</icon>
<icon type="remote" width="64" height="64">https://example.com/icons/foobar.png</icon>
<icon type="local" width="64" height="64">/usr/share/pixmaps/foobar.png</icon>]]></programlisting>
<para>
@@ -205,11 +205,16 @@
<literal>local</literal> icons are loaded from a file in the filesystem.
They should specify a full file path.
This icon type may have <literal>width</literal> and <literal>height</literal>
properties.
properties. If targeting a hi-DPI screen, this icon type may have a <literal>scale</literal> property.
</para>
<para>
<literal>remote</literal> icons loaded from a remote URL. Currently, only HTTP/HTTPS urls are supported.
This icon type should have <literal>width</literal> and <literal>height</literal> properties.
If targeting a hi-DPI screen, this icon type may have a <literal>scale</literal> property.
</para>
<para>
The semantics of each property in the <code>&lt;icon/&gt;</code> tag are the same as for the <code>&lt;icon/&gt;</code> tag for collections.
See <xref linkend="tag-ct-icon"/>.
</para>
</listitem>
</varlistentry>