gtk3/docs/reference/gtk/html/gtk-migrating-GtkStyleContext.html
2017-12-21 20:47:04 -05:00

73 lines
4.9 KiB
HTML
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Theming changes: GTK+ 3 Reference Manual</title>
<meta name="generator" content="DocBook XSL Stylesheets Vsnapshot">
<link rel="home" href="index.html" title="GTK+ 3 Reference Manual">
<link rel="up" href="migrating.html" title="Part V. Migrating from Previous Versions of GTK+">
<link rel="prev" href="ch26s02.html" title="Changes that need to be done at the time of the switch">
<link rel="next" href="gtk-migrating-theme-GtkStyleContext-engines.html" title="Migrating theme engines">
<meta name="generator" content="GTK-Doc V1.25.1 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="5"><tr valign="middle">
<td width="100%" align="left" class="shortcuts"></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
<td><a accesskey="u" href="migrating.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
<td><a accesskey="p" href="ch26s02.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
<td><a accesskey="n" href="gtk-migrating-theme-GtkStyleContext-engines.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
</tr></table>
<div class="chapter">
<div class="titlepage"><div><div><h2 class="title">
<a name="gtk-migrating-GtkStyleContext"></a>Theming changes</h2></div></div></div>
<div class="toc"><dl class="toc">
<dt><span class="section"><a href="gtk-migrating-GtkStyleContext.html#gtk-migrating-GtkStyleContext-themes">Migrating themes</a></span></dt>
<dt><span class="section"><a href="gtk-migrating-theme-GtkStyleContext-engines.html">Migrating theme engines</a></span></dt>
<dt><span class="section"><a href="gtk-migrating-GtkStyleContext-parser-extensions.html">Extending the CSS parser</a></span></dt>
<dt><span class="section"><a href="gtk-migrating-GtkStyleContext-css.html">Using the CSS file format</a></span></dt>
<dt><span class="section"><a href="gtk-migrating-GtkStyleContext-checklist.html">A checklist for widgets</a></span></dt>
<dt><span class="section"><a href="gtk-migrating-GtkStyleContext-parsing.html">Parsing of custom resources</a></span></dt>
<dt><span class="section"><a href="gtk-migrating-GtkStyleContext-bonus-points.html">Bonus points</a></span></dt>
</dl></div>
<p>
In GTK+ 3.0, <a class="link" href="GtkStyleContext.html" title="GtkStyleContext"><span class="type">GtkStyleContext</span></a> was added to replace <a class="link" href="GtkStyle.html" title="GtkStyle"><span class="type">GtkStyle</span></a> and
the theming infrastructure available in 2.x. GtkStyleContext is an
object similar in spirit to GtkStyle, as it contains theming information,
although in a more complete and tokenized fashion. There are two aspects
to switching to GtkStyleContext: porting themes and theme engines, and
porting applications, libraries and widgets.
</p>
<div class="section">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="gtk-migrating-GtkStyleContext-themes"></a>Migrating themes</h2></div></div></div>
<p>
From GTK+ 3.0 on, theme engines must implement <a class="link" href="GtkThemingEngine.html" title="GtkThemingEngine"><span class="type">GtkThemingEngine</span></a> and be
installed in <code class="filename">$libdir/gtk+-3.0/$GTK_VERSION/theming-engines</code>,
and the files containing style information must be written in the CSS-like
format that is understood by <a class="link" href="GtkCssProvider.html" title="GtkCssProvider"><span class="type">GtkCssProvider</span></a>. For a theme named
"Clearlooks", the CSS file parsed by default is
<code class="filename">$datadir/themes/Clearlooks/gtk-3.0/gtk.css</code>,
with possible variants such as the dark theme being named
<code class="filename">gtk-dark.css</code> in the same directory.
</p>
<p>
If your theme RC file was providing values for <a class="link" href="GtkSettings.html" title="Settings"><span class="type">GtkSettings</span></a>, you
can install a <code class="filename">settings.ini</code> keyfile along with
the <code class="filename">gtk.css</code> to provide theme-specific defaults
for settings.
</p>
<p>
Key themes have been converted to CSS syntax too. See the
GtkCssProvider documentation
information about the syntax. GTK+ looks for key themes in the file
<code class="filename">$datadir/themes/<em class="replaceable"><code>theme</code></em>/gtk-3.0/gtk-keys.css</code>, where <em class="replaceable"><code>theme</code></em> is the current
key theme name.
</p>
</div>
</div>
<div class="footer">
<hr>Generated by GTK-Doc V1.25.1</div>
</body>
</html>