Commit Graph

27525 Commits

Author SHA1 Message Date
Benjamin Otte
7836df29cb cssprovider: Use right hash table when printing
If the CSS provider had widget style properties, printing them would
crash since 82b340f6f0
2011-05-23 15:56:09 +02:00
Benjamin Otte
97a8ff80cc window: Only draw resize grip if its window exists
Don't rely on priv->resize_grip_visible as the code comment in the
variable declaration indicates.
This fixes warnings with GtkPlug, which can cause resize_grip_visible to
be TRUE but grid_window to be NULL - running tests/teststatusicon
reproduces this.

This broke with 7ef113ce56
2011-05-23 15:56:09 +02:00
Matthias Clasen
f30efa7759 Remove unused function attributes from symbol files 2011-05-22 23:39:48 -04:00
Kristian Rietveld
cd3896e10e quartz: actually register gdk_quartz_display_dispose 2011-05-22 12:29:37 +02:00
Kristian Rietveld
dfff35423f quartz: fix a typo 2011-05-22 12:27:38 +02:00
Benjamin Otte
4c6721d096 cssparser: Fix typo where we used "uint" for a type
Interestingly this works for gcc, but breaks on MSVC.
2011-05-22 06:07:45 +02:00
Benjamin Otte
21236cf270 style: Make margin a shorthand
... and add the real properties:
- margin-top
- margin-left
- margin-bottom
- margin-right
2011-05-22 05:56:12 +02:00
Benjamin Otte
a35aa96149 style: Make padding a shorthand
... and add the real properties:
- padding-top
- padding-left
- padding-bottom
- padding-right
2011-05-22 05:56:12 +02:00
Benjamin Otte
0c7e5a51f3 reftests: sort EXTRA_DIST in Makefile 2011-05-22 05:56:12 +02:00
Benjamin Otte
4d92835997 reftests: Add a reftest to check shorthands do work
Checks shorthands are properly unpacked in the CSS and that they indeed
set all relevant properties. Or at least border-width does.
2011-05-22 05:56:12 +02:00
Benjamin Otte
ef51b5be76 reftests: Add label-shadows test
Tests shadows work properly for rotated labels
2011-05-22 05:56:12 +02:00
Benjamin Otte
962ecc6fa5 shadow: Redo shadow implementation for rotations
The shadows went bonkers when the labels were rotated
2011-05-22 05:56:12 +02:00
Benjamin Otte
ec34c4bd83 themingeninge: Handle translations properly
We want to keep the location of where to render, but transform th
context by the pango transform.
2011-05-22 05:56:12 +02:00
Benjamin Otte
03fbb1f34f label: Account for y-translation when rotating 2011-05-22 05:56:11 +02:00
Benjamin Otte
bd610582b8 tests: Add parser test for shorthands 2011-05-22 05:56:11 +02:00
Benjamin Otte
f5c7cefcca style: Convert border-width to a shorthand
Add the corresponding properties it refers to, too:
- border-top-width
- border-left-width
- border-bottom-width
- border-right-width
2011-05-22 05:56:11 +02:00
Benjamin Otte
42a4bd1c5b style: Add support for shorthand properties
Shorthand properties are basically the same a in CSS. For storage in
style properties or the CSS provider, they are unpacked into the real
values, so it is possible to partially override them.

No properties are yet converted to the new world yet, this is just the
code for supporting them.
2011-05-22 01:25:17 +02:00
Benjamin Otte
70e654f1a5 stylepropertis: Use set_by_property() in set_valist()
... instead of duplicating code. This causes an extra g_value_copy().
If that turns out to be a performance issue, we can invent something
that handles this (like passing a gboolean take_value).

The reason for this duplication deletion is that we want to complicate
the setting code to handle shorthands by unpacking them and storing the
separate values.
2011-05-22 01:25:16 +02:00
Benjamin Otte
73c39f5b16 styleproperties: Add _gtk_style_properties_set_property_by_property()
... as a replacement for _gtk_style_properties_set_property_by_pspec().
We'll need that to handle shorthands.
2011-05-22 01:25:16 +02:00
Benjamin Otte
b67ae42ecd styleproperties: Use peek_property() in get_valist() 2011-05-22 01:23:43 +02:00
Benjamin Otte
0a368fe622 styleproperties: Validate values when setting them
Note that validation is not necessary when resolving, because all values
are valid for those cases.
2011-05-22 01:23:36 +02:00
Benjamin Otte
e7db090620 styleproperties: Remove needless check 2011-05-21 22:49:43 +02:00
Benjamin Otte
b889f499a7 styleproperties: Use peek_property in get_property
... instead of duplicating the code.
2011-05-21 22:49:43 +02:00
Benjamin Otte
5f5cc79623 styleproperties: Adapt _gtk_style_properties_peek_property()
Optionally return the GtkStyleProperty that was looked up. This feature
isn't used yet, but will soon be.
2011-05-21 22:49:43 +02:00
Benjamin Otte
727a839d71 styleproperties: Move the style property handling code
... from gtkstyleproperties.c to gtkstyleproperty.c
2011-05-21 22:49:43 +02:00
Benjamin Otte
5eca8f8275 css: Rename gtkcssstrfuncs file to gtkstyleproperty
The idea is to handle the style property registering etc in this file
instead of the styleproperties file. The next commits will move those
files.
2011-05-21 22:49:43 +02:00
Benjamin Otte
e64b220791 stringfuncs: Remove _gtk_css_parse_url() from header
No code changes, just moving the function in the c file so it doesn't
need to be forward-declared.
2011-05-21 22:49:43 +02:00
Benjamin Otte
548a1302ee cssprovider: Use _gtk_style_property_lookup()
This way we get the actual data node and can use it.
2011-05-21 22:49:43 +02:00
Benjamin Otte
777a6846db styleproperties: Put gtk_style_property_lookup() in private header 2011-05-21 22:49:43 +02:00
Benjamin Otte
0f211f78a5 styleproperties: Class ref no longer necessary
Now that we initialize the pspecs on-demand, we can avoid the class ref.
2011-05-21 22:49:43 +02:00
Benjamin Otte
85e900b522 styleproperties: Init the default properties when they're needed
Instead of initing the default style properties in the class_init
func of the style properties, init them when they are first needed -
when they are queried or when new ones are registered.

That way, they will always be available.
2011-05-21 22:49:42 +02:00
Benjamin Otte
a2200e8971 styleproperties: constify gtk_style_property_lookup() 2011-05-21 22:49:42 +02:00
Benjamin Otte
1bd065fa4d styleproperties: Rename the storage struct for style pspecs
PropertyNode => GtkStyleProperty
2011-05-21 22:49:42 +02:00
Benjamin Otte
d7c9d8ce15 tests: Add forgotten file
File was forgotten in 8fd6bd323c
2011-05-21 22:48:52 +02:00
Diego Celix
ea79cd4314 gtk/gtkstatusbar: gtk_misc_set_alignment replacing
Replacing the function gtk_misc_set_alignment () with
gtk_widget_set_halign () and gtk_widget_set_valign () in
gtk/gtkstatusbar.c

https://bugzilla.gnome.org/show_bug.cgi?id=650664
2011-05-21 09:16:00 -04:00
Matthias Clasen
e578489579 Allow NULL permissions
This is useful in some scenarios.
2011-05-21 09:12:40 -04:00
Benjamin Otte
d333911d30 docs: Add missing <row> 2011-05-21 03:41:52 +02:00
Cosimo Cecchi
8c65d9181d themingengine: use the text-shadow property to render text shadow
This also avoids hardcoding a shadow for insensitive text in the engine,
as it can now be applied from the theme directly.

https://bugzilla.gnome.org/show_bug.cgi?id=649314
2011-05-20 18:49:54 -04:00
Cosimo Cecchi
73e0070774 shadow: add a method to paint the shadow for a PangoLayout
https://bugzilla.gnome.org/show_bug.cgi?id=649314
2011-05-20 18:49:54 -04:00
Cosimo Cecchi
c3f3e4a670 styleproperties: resolve properties of type GTK_TYPE_SHADOW
https://bugzilla.gnome.org/show_bug.cgi?id=649314
2011-05-20 18:49:50 -04:00
Cosimo Cecchi
016f540931 styleproperties: add a "text-shadow" style property
And document its use in the CSS parser gtk-doc.

https://bugzilla.gnome.org/show_bug.cgi?id=649314
2011-05-20 18:44:15 -04:00
Cosimo Cecchi
5b6253252e css: add a parser for GTK_TYPE_SHADOW properties
https://bugzilla.gnome.org/show_bug.cgi?id=649314
2011-05-20 18:44:12 -04:00
Cosimo Cecchi
fcc78bedc8 shadow: add a GtkShadow private type
This will be used as a base both for parsing text-shadow and box-shadow
properties. The type is private, as there's no real use in exporting
this in a public API.

https://bugzilla.gnome.org/show_bug.cgi?id=649314
2011-05-20 18:44:07 -04:00
Cosimo Cecchi
8301b24ee5 assistant: pack the sidebar in a frame instead of an event box
This has mostly two advantages:
- the most obvious one is the theme can render a border around the
  sidebar if it wants to.
- we also can avoid hardcoding a container border width for the sidebar,
  and just use a padding from the theme. This also allows different
  themes to define a different padding, etc.

The drawback is we must draw the background ourselves, but it's easy
enough.

https://bugzilla.gnome.org/show_bug.cgi?id=650530
2011-05-19 10:54:04 -04:00
Cosimo Cecchi
6bbb9d6f15 assistant: remove an useless gtk_widget_reset_style() call
It's not needed to call _reset_style() here, as we did not add the
widget to the parent container yet.

https://bugzilla.gnome.org/show_bug.cgi?id=650530
2011-05-19 10:54:01 -04:00
Benjamin Otte
3ecb308e56 menu: Only realize menu if it isn't realized yet
Lots of code calls gtk_menu_popup() and we don't want to resize the
window needlessly.
In this particular case, keyboard navigation to submenus caused those
submenus to shrink.

Note: I'm not sure this fix doesn't have nasty side effects, as I'm not
a specialist on menu popup code, so if it does, we'll need to revert it.
Until then, let's keep it, it fixes a bug.
2011-05-19 13:04:19 +02:00
Benjamin Otte
7a0600644c tests: Add missing CSS test 2011-05-19 03:16:03 +02:00
Carlos Garnacho
1b53741e4c gdk: Document gdk_window_add_filter()+XGenericEvents behavior 2011-05-18 22:34:33 +02:00
Carlos Garnacho
a529568f79 gdk: Get the right filter window for XI2 events
GdkDeviceManagerXI2 now implements GdkEventTranslator::get_window,
retrieving the right window from the contained XIEvent.
2011-05-18 22:34:33 +02:00
Carlos Garnacho
55cc9f3339 gdk: Add _gdk_x11_event_translator_get_window()
This method can be implemented by event translators so they
return the right window from XGenericEventCookie events, as
ev->xany.window isn't meaningful for these.

GdkEventSource now also uses this to find out the right window
filters to apply.
2011-05-18 22:34:33 +02:00