Commit Graph

24075 Commits

Author SHA1 Message Date
Carlos Garnacho
318e0f28ee GtkStyleProvider: Add gtk_style_provider_get_icon_factory().
With this, style providers have a way to override default icon theme.
2010-12-04 15:37:16 +01:00
Carlos Garnacho
be5d4adf6b GtkCssProvider: Allow symbolic colors when parsing style rules. 2010-12-04 15:37:15 +01:00
Carlos Garnacho
1de8f75517 GtkCssProvider: Parse color mappings.
These are of the form:

@color-a: #fff;
@color-b: mix (@color-a, #000, 0.5)
@color-c: shade (@color-b, 0.7)

In the stylesheet, arbitrary nesting of these commands is handled.
2010-12-04 15:37:15 +01:00
Carlos Garnacho
4ed96df96a GtkStyleSet: Optionally take GtkSymbolicColors.
gtk_style_set_set_property() now takes both GdkColor and GtkSymbolicColor
GValues, All accessors still return GdkColors, so any symbolic color will
be resolved and replaced in the styleset at that time.
2010-12-04 15:37:15 +01:00
Carlos Garnacho
b8fb2d1a36 GtkSymbolicColor: Add method to resolve to a GdkColor. 2010-12-04 15:37:15 +01:00
Carlos Garnacho
e2b8efcbec GtkStyleSet: Add API to map symbolic colors. 2010-12-04 15:37:15 +01:00
Carlos Garnacho
7094213df9 Add GtkSymbolicColor.
This is a small boxed struct used to store symbolic colors so they
can be resolved at a later point.
2010-12-04 15:37:14 +01:00
Carlos Garnacho
d748ea983d GtkWidgetPath: Add to gtkalias. 2010-12-04 15:37:14 +01:00
Carlos Garnacho
b50c88d170 GtkCssProvider: Plug memory leak. 2010-12-04 15:37:14 +01:00
Carlos Garnacho
2cd4ff4215 GtkCssProvider: Fix compile warning. 2010-12-04 15:37:14 +01:00
Carlos Garnacho
1d4687675f GtkCssProvider: set scanner->input_name. 2010-12-04 15:37:13 +01:00
Carlos Garnacho
6c91ba1cc2 GtkWidget: Do not reset GtkStyleContext per get_style_context(). 2010-12-04 15:37:13 +01:00
Carlos Garnacho
22bae20ce8 GtkWidget: Hook up widget style property querying to style context. 2010-12-04 15:37:13 +01:00
Carlos Garnacho
03370c6e0c GtkStyleContext: Add methods to get style property values. 2010-12-04 15:37:13 +01:00
Carlos Garnacho
bf12227435 GtkCssProvider: Implement GtkStyleProvider->get_style_property
Style properties in the resource files are something like:

-GtkComboBox-appears-as-string
-GtkEntry-icon-prelight

Following the usual naming spec for extensions to CSS.
2010-12-04 15:37:13 +01:00
Carlos Garnacho
37335fbb6f GtkWidgetPath: Add methods to check topmost widget type. 2010-12-04 15:37:12 +01:00
Carlos Garnacho
6990a01299 GtkStyleProvider: Add method to get widget style properties. 2010-12-04 15:37:12 +01:00
Carlos Garnacho
eaddc9f254 GtkCssProvider: refactor out selector matching. 2010-12-04 15:37:12 +01:00
Carlos Garnacho
eec75f1f59 GtkCssProvider: Ensure each scope has its parser config. 2010-12-04 15:37:12 +01:00
Carlos Garnacho
ff05cc4849 GtkCssProvider: Parse boolean values. 2010-12-04 15:37:12 +01:00
Carlos Garnacho
aa5ec97cac GtkCssProvider: Make additions to parse_value() less error prone. 2010-12-04 15:37:11 +01:00
Carlos Garnacho
814957021f Fix compile warning. 2010-12-04 15:37:11 +01:00
Carlos Garnacho
66d1cb8054 GtkStyleSet: Register GtkThemingEngine type.
This has been also hooked up to the CSS provider, which parses the "engine"
value to load the corresponding module.
2010-12-04 15:37:11 +01:00
Carlos Garnacho
327a9fc66a GtkWidget: Generate GtkWidgetPath on set_parent.
There's no need to wait for realize() to have the right widget style.
2010-12-04 15:37:11 +01:00
Carlos Garnacho
6906138e45 GtkStyleSet: Remove default value for registered properties.
This should be handled at a higher level, a single default value for all
states isn't that useful...
2010-12-04 15:37:10 +01:00
Carlos Garnacho
80e01becbe Fix compilation. 2010-12-04 15:37:10 +01:00
Carlos Garnacho
a323310c19 GtkNotebook: Set GtkChildClassFlags for tabs. 2010-12-04 15:37:10 +01:00
Carlos Garnacho
e899fdd973 GtkCssProvider: Set default value if no state pseudo-class is specified. 2010-12-04 15:37:10 +01:00
Carlos Garnacho
66accc4184 GtkStyleSet: Add gtk_style_set_set_default().
This will set the default value to a given property for all possible states,
such default value will only be used if the queried state doesn't have a
value itself.
2010-12-04 15:37:10 +01:00
Carlos Garnacho
bd9bd1310b GtkStyleContext: Fix compiler warning. 2010-12-04 15:37:09 +01:00
Carlos Garnacho
17908880b5 GtkStyle: Use new render methods underneath.
This commit should probably be squashed in the future, when GtkStyleContext
is on par with it, and GtkStyle is just a shallow object on top of
GtkStyleContext and calling it in the default implementation methods, so
all gtk_paint_* and gtk_draw_* would work.
2010-12-04 15:37:09 +01:00
Carlos Garnacho
f5adc2a1c3 Add region details in gtk_widget_get_path(). 2010-12-04 15:37:09 +01:00
Carlos Garnacho
cf27f6f1cf GtkStyleContext: fix typos in code.
The wrong list was being modified in gtk_style_context_set_child_class(),
and gtk_style_context_has_child_class() was checking for *flags != 0, not
flags != NULL.
2010-12-04 15:37:09 +01:00
Carlos Garnacho
104caa74f0 GtkStyleContext: Add gtk_style_context_list_child_classes(). 2010-12-04 15:37:09 +01:00
Carlos Garnacho
67c4f8d02e GtkCssProvider: Compare GtkWidgetPath regions with css. 2010-12-04 15:37:08 +01:00
Carlos Garnacho
977a972358 GtkCssProvider: fix parsing of consecutive pseudo-classes.
Now either of foo{}, foo:first-child{}, foo:nth-child(even):insensitive or
foo:active{} will be correctly parsed.
2010-12-04 15:37:08 +01:00
Carlos Garnacho
0be4659c5d GtkCssProvider: move to next selector element on match or child combinator. 2010-12-04 15:37:08 +01:00
Carlos Garnacho
bc0af3208d GtkCssProvider: free selector path on parse_rule(). 2010-12-04 15:37:08 +01:00
Carlos Garnacho
07171d5f68 GtkCssProvider: Add named regions to selector path. 2010-12-04 15:37:08 +01:00
Carlos Garnacho
707d5ae99c GtkCssProvider: Parse named regions. 2010-12-04 15:37:07 +01:00
Carlos Garnacho
11c874619b GtkWidgetPath: Add API for named regions. 2010-12-04 15:37:07 +01:00
Carlos Garnacho
71949e05c4 Refurbish GtkWidgetPath API.
The foreach() function is now gone, there's now API to get
GTypes and names from the position in the path.
2010-12-04 15:37:07 +01:00
Carlos Garnacho
f60e3f3a8a Move GtkChildClassFlags to gtkenums.h. 2010-12-04 15:37:06 +01:00
Carlos Garnacho
8c03503d16 GtkCssProvider: Add support for child/descendant combinators.
Now, selectors like:

  GtkWindow > GtkButton {}
  GtkNotebook > GtkLabel {}

will represent a direct parent/child relation between both elements, while

  GtkWindow GtkButton {}
  GtkNotebook GtkLabel {}

will allow intermediate children between these.
2010-12-04 15:37:06 +01:00
Carlos Garnacho
d691e79cbf GtkCssProvider: Fix typo freeing SelectorElements. 2010-12-04 15:37:05 +01:00
Carlos Garnacho
abbeb89b7c GtkCssProvider: Allow empty selector.
universal selector is implied, so things like this work:

:active {}
:insensitive{}
2010-12-04 15:37:05 +01:00
Carlos Garnacho
4c8353bcbf GtkCssProvider: Allow '*' selectors.
These would match a single widget of any type.
2010-12-04 15:37:04 +01:00
Carlos Garnacho
468f216b1c GtkCssProvider: Add state parsing.
Now state is now defined as a pseudoclass in the CSS format, selectors like:

GtkWidget:active { }
GtkButton:insensitive { }
GtkCalendar:prelight { } (also :hover is accepted)
...

define the style for the given state.
2010-12-04 15:37:03 +01:00
Carlos Garnacho
7dada9949d GtkWidget: Create GtkCssProvider for user modifications.
~/.gtk-X.0.css is checked, and added as a style resource if available.
2010-12-04 15:37:03 +01:00
Carlos Garnacho
82f485afd9 GtkStyleProvider: Add defines for most common priorities. 2010-12-04 15:37:02 +01:00