<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:creativeCommons="http://backend.userland.com/creativeCommonsRssModule"	>
<channel>
	<title>Comments on: Squib of the day: Special frame style for warning dialogues</title>
	<atom:link href="http://blogs.gnome.org/metacity/2009/03/16/squib-of-the-day-special-frame-style-for-warning-dialogues/feed/" rel="self" type="application/rss+xml" />
	<link>http://blogs.gnome.org/metacity/2009/03/16/squib-of-the-day-special-frame-style-for-warning-dialogues/</link>
	<description>"Many window managers are like Marshmallow Froot Loops; Metacity is like Cheerios."</description>
	<lastBuildDate>Sun, 26 Sep 2010 15:08:40 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: On enhancements which need changes to the EWMH - …for the adult in you</title>
		<link>http://blogs.gnome.org/metacity/2009/03/16/squib-of-the-day-special-frame-style-for-warning-dialogues/comment-page-1/#comment-908</link>
		<dc:creator>On enhancements which need changes to the EWMH - …for the adult in you</dc:creator>
		<pubDate>Mon, 16 Mar 2009 02:51:22 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.gnome.org/metacity/?p=475#comment-908</guid>
		<description>[...] …for the adult in you &#8220;Many window managers are like Marshmallow Froot Loops; Metacity is like Cheerios.&#8221;   Skip to content      &#171; Squib of the day: Special frame style for warning dialogues [...]</description>
		<content:encoded><![CDATA[<p>[...] …for the adult in you &#8220;Many window managers are like Marshmallow Froot Loops; Metacity is like Cheerios.&#8221;   Skip to content      &laquo; Squib of the day: Special frame style for warning dialogues [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Screwtape</title>
		<link>http://blogs.gnome.org/metacity/2009/03/16/squib-of-the-day-special-frame-style-for-warning-dialogues/comment-page-1/#comment-907</link>
		<dc:creator>Screwtape</dc:creator>
		<pubDate>Mon, 16 Mar 2009 01:51:38 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.gnome.org/metacity/?p=475#comment-907</guid>
		<description>I like the idea of tag sets instead of a complicated hierarchy of tag-references, but figuring out a suitably &quot;well-defined and intuitive rule&quot; for fallback would be the crux of the thing. As I mentioned my a comment on the &quot;policy about theme versions&quot; post, well-defined and intuitive fallback is probably the most useful thing in a new theming format.

I think you&#039;d still need frame_style_set elements, you might want a particular frame_style to be used for two or more disjoint sets of tags.

The more I think about this, the more I remember that a bunch of clever people have already done the hard work of designing a language for composing visual styles from least to most specific: CSS. Rather than matching elements, you&#039;d match pieces; you could use psuedo-element syntax to match states, class syntax to distinguish buttons by location and ID syntax to distinguish buttons by type... something like this:


window:active:maximized title_bar {
    /* Styles the title-bar in a focussed, maximized 
     * window
     */
    padding: 2px;
}
dialog:active:resizable(X,Y) #close_button:hover {
    /* Draws the close_button in the prelight state on a 
     * focussed dialog that is resizable both 
     * horizontally and vertically.
     */
    draw: url(&quot;#draw_close_glyph_prelight&quot;);
}
modal_dialog .left_button {
    /* Sets the inter-button spacing for buttons that
     * appear on the left-hand side of the title bar
     * of a modal dialog.
     */

    /* I would imagine that unlike HTML, margins would
     * only be relevant on button elements, and margins
     * would collapse horizontally (rather than 
     * vertically)
     */
    margin: 0 5px;
}


I can think of a couple of problems with this model, of course - firstly, there&#039;s no good way to express draw_ops elements in CSS syntax. This could be addressed by having themes be XML documents containing a style element for the CSS as well as a collection of draw_ops elements with id attributes, and the CSS could refer to draw_ops with &quot;draw: url(#draw_dialog_border);&quot;.

Another problem that springs to mind is that ideally the CSS styles would handle both drawing and layout; that is, they would subsume the current frame_geometry and frame_style elements with &quot;padding&quot; and &quot;margin&quot; and &quot;draw&quot; styles. This might be so radically different from Metacity&#039;s internals as to ruin any chance of implementation.

Lastly, CSS is not a perfect syntax - there are &lt;a href=&quot;http://fantasai.inkedblade.net/style/discuss/wasp-feedback-2008&quot; rel=&quot;nofollow&quot;&gt;any number of proposals for improving it&lt;/a&gt;. Most of those don&#039;t really apply here, because the &quot;document model&quot; for windows is vastly simpler and more static than for HTML, and the most practical need in standard CSS is for colour and size constants - which we cleverly side-step by keeping draw_ops in their XML syntax and re-using Metacity&#039;s existing constant system.

Hmm... that was a lot of typing. Should I file that as an enhancement bug?</description>
		<content:encoded><![CDATA[<p>I like the idea of tag sets instead of a complicated hierarchy of tag-references, but figuring out a suitably &#8220;well-defined and intuitive rule&#8221; for fallback would be the crux of the thing. As I mentioned my a comment on the &#8220;policy about theme versions&#8221; post, well-defined and intuitive fallback is probably the most useful thing in a new theming format.</p>
<p>I think you&#8217;d still need frame_style_set elements, you might want a particular frame_style to be used for two or more disjoint sets of tags.</p>
<p>The more I think about this, the more I remember that a bunch of clever people have already done the hard work of designing a language for composing visual styles from least to most specific: CSS. Rather than matching elements, you&#8217;d match pieces; you could use psuedo-element syntax to match states, class syntax to distinguish buttons by location and ID syntax to distinguish buttons by type&#8230; something like this:</p>
<p>window:active:maximized title_bar {<br />
    /* Styles the title-bar in a focussed, maximized<br />
     * window<br />
     */<br />
    padding: 2px;<br />
}<br />
dialog:active:resizable(X,Y) #close_button:hover {<br />
    /* Draws the close_button in the prelight state on a<br />
     * focussed dialog that is resizable both<br />
     * horizontally and vertically.<br />
     */<br />
    draw: url(&#8220;#draw_close_glyph_prelight&#8221;);<br />
}<br />
modal_dialog .left_button {<br />
    /* Sets the inter-button spacing for buttons that<br />
     * appear on the left-hand side of the title bar<br />
     * of a modal dialog.<br />
     */</p>
<p>    /* I would imagine that unlike HTML, margins would<br />
     * only be relevant on button elements, and margins<br />
     * would collapse horizontally (rather than<br />
     * vertically)<br />
     */<br />
    margin: 0 5px;<br />
}</p>
<p>I can think of a couple of problems with this model, of course &#8211; firstly, there&#8217;s no good way to express draw_ops elements in CSS syntax. This could be addressed by having themes be XML documents containing a style element for the CSS as well as a collection of draw_ops elements with id attributes, and the CSS could refer to draw_ops with &#8220;draw: url(#draw_dialog_border);&#8221;.</p>
<p>Another problem that springs to mind is that ideally the CSS styles would handle both drawing and layout; that is, they would subsume the current frame_geometry and frame_style elements with &#8220;padding&#8221; and &#8220;margin&#8221; and &#8220;draw&#8221; styles. This might be so radically different from Metacity&#8217;s internals as to ruin any chance of implementation.</p>
<p>Lastly, CSS is not a perfect syntax &#8211; there are <a href="http://fantasai.inkedblade.net/style/discuss/wasp-feedback-2008" rel="nofollow">any number of proposals for improving it</a>. Most of those don&#8217;t really apply here, because the &#8220;document model&#8221; for windows is vastly simpler and more static than for HTML, and the most practical need in standard CSS is for colour and size constants &#8211; which we cleverly side-step by keeping draw_ops in their XML syntax and re-using Metacity&#8217;s existing constant system.</p>
<p>Hmm&#8230; that was a lot of typing. Should I file that as an enhancement bug?</p>
]]></content:encoded>
	</item>
</channel>
</rss>
<!-- This Quick Cache file was built for (  blogs.gnome.org/metacity/2009/03/16/squib-of-the-day-special-frame-style-for-warning-dialogues/feed/ ) in 1.23029 seconds, on Feb 12th, 2012 at 7:10 am UTC. -->
<!-- This Quick Cache file will automatically expire ( and be re-built automatically ) on Feb 12th, 2012 at 8:10 am UTC -->
