Document -gtk-recolor syntax

This commit is contained in:
Matthias Clasen
2016-01-14 16:06:16 -05:00
parent beec55a22b
commit 5842e68a0d

View File

@ -717,7 +717,7 @@ label {
GTK+ extends the CSS syntax for images and also uses it for specifying icons. GTK+ extends the CSS syntax for images and also uses it for specifying icons.
</para> </para>
<literallayout><code>〈gtk image〉 = 〈gtk gradient〉 | 〈themed icon〉 | 〈scaled image〉 | 〈win32 theme part〉</code> <literallayout><code>〈gtk image〉 = 〈gtk gradient〉 | 〈themed icon〉 | 〈scaled image〉 | 〈recolored image〉 | 〈win32 theme part〉</code>
</literallayout> </literallayout>
<para> <para>
@ -806,8 +806,8 @@ label {
<title>Using themed icons in CSS</title> <title>Using themed icons in CSS</title>
<programlisting><![CDATA[ <programlisting><![CDATA[
spinner { spinner {
-gtk-icon-source: -gtk-icontheme('process-working'); -gtk-icon-source: -gtk-icontheme('process-working-symbolic');
-gtk-icon-style: symbolic; -gtk-icon-palette: success blue, error magenta;
} }
arrow.fancy { arrow.fancy {
-gtk-icon-source: -gtk-icontheme('pan-down'); -gtk-icon-source: -gtk-icontheme('pan-down');
@ -841,6 +841,27 @@ arrow {
]]></programlisting> ]]></programlisting>
</example> </example>
<literallayout><code>〈recolored image〉 = -gtk-recolored( 〈url〉[, 〈color palette〉] )</code>
</literallayout>
<para>
Symbolic icons from the icon theme are recolored according to the
-gtk-icon-palette property. The recoloring is sometimes needed for images
that are not part of an icon theme, and the -gtk-recolor syntax makes
this available. -gtk-recolor requires a url as first argument. The
remaining arguments specify the color palette to use. If the palette
is not explicitly specified, the current value of the -gtk-icon-palette
property is used.
</para>
<example>
<title>Recoloring an image</title>
<programlisting><![CDATA[
arrow {
-gtk-icon-source: -gtk-recolor(url('check.svg'), success blue, error rgb(255,0,0));
}
]]></programlisting>
</example>
<para> <para>
On Windows, GTK+ allows to refer to system theme parts as images, as follows: On Windows, GTK+ allows to refer to system theme parts as images, as follows:
</para> </para>