Skip to content

Commit

Permalink
docs: Clarify environment-based screenshot ordering
Browse files Browse the repository at this point in the history
  • Loading branch information
ximion committed Sep 27, 2023
1 parent 4fd4ca5 commit 4d8567d
Showing 1 changed file with 16 additions and 15 deletions.
31 changes: 16 additions & 15 deletions docs/xml/metainfo-component.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1203,30 +1203,31 @@
</para>
<para>
The <code>&lt;screenshots/&gt;</code> tag contains multiple <code>&lt;screenshot/&gt;</code> children, where at least one of them must have the property
<code>type="default"</code> to indicate the primary screenshot of the software. Every <code>&lt;screenshot/&gt;</code> tag must have at least
one <code>&lt;image/&gt;</code> <emphasis>or</emphasis> <code>&lt;video/&gt;</code> child, but never an <literal>image</literal> <emphasis>and</emphasis>
<literal>video</literal> at the same time.
</para>
<para>
Screenshots containing videos must not be the default screenshot.
<code>type="default"</code> to indicate the primary and most representative screenshot of the software.
</para>
<para>
Optionally, a <literal>screenshot</literal> may also have an <code>environment</code> property.
This string property denotes the GUI environment the screenshot was recorded in, in the form of <code>&lt;env&gt;:&lt;style&gt;</code>,
where <literal>env</literal> is a desktop-environment name in lowercase
and <literal>style</literal> is a specific style that the desktop environment recognizes, e.g. <code>light</code> and <code>dark</code> for light
and dark themes. See <ulink url="https://github.com/ximion/appstream/blob/main/data/desktop-style-ids.txt">desktop-style-ids.txt</ulink> for a list
This string property denotes the GUI environment the screenshot was recorded in, in the form of <code>{env}:{style}</code>,
where <literal>{env}</literal> is a desktop-environment name in lowercase and <literal>{style}</literal> is a specific style
that the desktop environment recognizes, e.g. <code>light</code> and <code>dark</code> for light and dark themes.
See <ulink url="https://github.com/ximion/appstream/blob/main/data/desktop-style-ids.txt">desktop-style-ids.txt</ulink> for a list
of currently recognized environment and style combinations.
</para>
<para>
Software centers displaying the component will prefer screenshots of the current environment and style first, will then fall back to
screenshots of the current environment (without style), and if none of those are available either they will use the environment of the
screenshot marked as <code>type="default"</code> (which may be intentionally empty).
That way, there will always be a screenshot displayed.
Software centers displaying the component will usually prefer screenshots of the current environment and style, and display them first,
even before the screenshot marked as <literal>default</literal>.
</para>
<para>
In general, screenshots should be displayed in the order the are defined in in their <literal>screenshots</literal> block
for the respective component.
for the respective component on a per-environment basis (all screenshots of the same environment/style will be displayed in the order
they are listed in the XML, but may be moved to the front of the list as a whole depending on the current environment).
</para>
<para>
Every <code>&lt;screenshot/&gt;</code> element must have at least one <code>&lt;image/&gt;</code> <emphasis>or</emphasis> <code>&lt;video/&gt;</code> child,
but never an <literal>image</literal> <emphasis>and</emphasis> <literal>video</literal> at the same time.
</para>
<para>
Screenshots containing videos must not be the default screenshot.
</para>
<para>
The value of the <code>&lt;image/&gt;</code> tag is a direct HTTP/HTTPS URL to a screenshot uploaded to a public location on the web.
Expand Down

0 comments on commit 4d8567d

Please sign in to comment.