Commit Graph

9 Commits

Author SHA1 Message Date
Florian Müllner
54b2fab849 theme: Allow using custom colors from the GTK+ theme
Add an additional color type to pick up colors defined with
@define-color in the GTK+ theme's CSS:

  gtk:custom(name,fallback)

(where "name" refers to the name defined in GTK+'s CSS, and fallback
refers to an alternative color spec which is used when the color
referenced by "name" is not found)

The main intent of the change is to allow designers to improve
Adwaita's dark theme variant without having to compromise on colors
which work in the light variant as well.

https://bugzilla.gnome.org/show_bug.cgi?id=648709
2011-07-08 22:40:43 +02:00
Florian Müllner
ed99d12e8b theme: Add tiled_left/tiled_right frame states
It may be desirable for theme authors to treat side-by-side tiled
windows differently, for instance to give the edge-touching border
a width of 0, so add additional frame states for tiled windows.

https://bugzilla.gnome.org/show_bug.cgi?id=637330
2011-01-05 01:49:58 +01:00
Florian Müllner
0a2bb1b71c theme: Add background functions for single buttons
With the existing background functions, single buttons can not be
styled separately - on the left side, the style of the left button
is picked, and the right button's style on the right side.

As theme authors may want to add rounded corners to button groups
as a whole, it makes sense to treat the case of a single button in
a group differently.

https://bugzilla.gnome.org/show_bug.cgi?id=635683
2011-01-05 01:49:49 +01:00
Owen W. Taylor
ed2fbcd13a Add frame type for attached modal dialogs
Add a new frame type META_FRAME_TYPE_ATTACHED which is used for
attached modal dialogs.

The theme format version is bumped to 3.2, and attached windows
can have borders defined in a metacity-theme-3.xml as:

 <window version=">= 3.2" type="attached" style_set="[name]"/>

If no style is defined for "attached", drawing will fall back
to the "border" type.

https://bugzilla.gnome.org/show_bug.cgi?id=592382
2010-11-18 09:47:57 -05:00
Owen W. Taylor
1d7476a725 Allow a theme to specify ellipsize width for a title
It's nice to indicate when a title is truncated with an ellipsis.
Because themes may draw a title multiple times to draw a shadow, or
may include the window icon within the title area, we can't determine
the proper ellipsization width automatically, so add an optional
attribute to the <title/> element "ellipsize_width" which, if set,
is the width to ellipsize at.

This is only enabled if a theme version of 3.1 is required.

When it's not set, we keep the old behavior of just letting the
title be clipped with a hard edge.

https://bugzilla.gnome.org/show_bug.cgi?id=591842
2010-04-13 14:10:54 -04:00
Owen W. Taylor
e8e78ebfdd Add frame_x_center/frame_y_center variables for themes
Sometimes you want to position something (usually the title) to be centered
with respect to the entire frame instead of centered with respect to the
individual piece currently being drawn.

This patch adds frame_x_center and frame_y_center variables that represent
the X/Y centers of the frame in the coordinate system of the piece being
drawn.

The theme version is bumped from 3.0 to 3.1 (3.0 is just the new version
system, 3.1 will have all the features we add for Mutter-2.28.)
position expressions

https://bugzilla.gnome.org/show_bug.cgi?id=591842
2010-04-13 14:07:50 -04:00
Owen W. Taylor
020aea033c metacity-theme-3.xml: Add a flexible version mechanism
The current mechanism of metacity-theme-1.xml and metacity-theme-2.xml
is not flexible for allowing small-scale additions. With this patch
we bump the major version version once more to metacity-theme-3.xml
and add a single feature:

Any element in the DTD can have an attribute:

 version="[<|<=|=>|>] MAJOR.MINOR"

And it will be ignored unless the predicate is met. (< and > should
be to be entity escaped as &lt; and &gt;)

This allows having alternate sections of the theme file for older and
newer version.

* Required GLib version is bumped to 2.14 so we can parse versions
  with a regular expression.

* We switch internal version numbers to be "1000 * major + minor"

* We keep a stack of the maximum required version for the current portion
  the XML tree so that the "cannot use versions you don't require" stricture
  of the old code can be made local to a subpart of the tree.

* A version on the top metacity_theme element causes the entire file to
  be ignored; this allows having one metacity-theme-3.xml for version 3.2
  and newer (say) and a metacity-1.xml for everything old.

Actual new features will be added starting with 3.1 - 3.0 is just the
version="" feature.

http://bugzilla.gnome.org/show_bug.cgi?id=592503
2010-04-13 13:40:16 -04:00
Thomas James Alexander Thurman
ef1c6e9214 described new theme format.
* doc/theme-format.txt: described new theme format.

        * src/themes/Bright, src/themes/Crux: added version 2 themes.
2006-10-07 17:21:05 +00:00
Havoc Pennington
e9999aa93c add DTD for themes from Ross Burton
2002-11-20  Havoc Pennington  <hp@pobox.com>

	* doc/metacity-theme.dtd: add DTD for themes from Ross Burton

	* doc/Makefile.am: doc subdir

	* doc/theme-format.txt: move to doc subdir
2002-11-20 04:57:25 +00:00