Commit Graph

14358 Commits

Author SHA1 Message Date
Matthias Clasen
32f0761daa Avoid a dereference-before-null-check 2011-06-14 21:50:16 -04:00
Matthias Clasen
d5dad6412b Give this code a chance to work
At least it does not get uninitialized variable warnings now.
2011-06-14 21:44:12 -04:00
Matthias Clasen
d3c427a767 Don't forget to cleanup varargs 2011-06-14 21:14:48 -04:00
Juan A. Suarez Romero
c903ece96b image: Initialize variable 2011-06-14 09:49:23 +00:00
Matthias Clasen
e3e9527354 GtkAssistant: improve button labels
Forward/Back/Last has been declared strange; so go with something
a little more friendly: Continue/Go Back/Finish.
https://bugzilla.gnome.org/show_bug.cgi?id=652506
2011-06-13 22:35:15 -04:00
Benjamin Otte
76f2aa737b docs: Add Since tag to GtkWidget::draw 2011-06-13 18:29:07 +02:00
Benjamin Otte
9e2ebdee07 cssparser: Actually send an error in an error case
The error case was excess commas in rgb/rgba colors, such as
rgba(0,255,0,0,0.5)
2011-06-13 15:01:52 +02:00
Benjamin Otte
a471b4b198 themingengine: Improve handling of different colors
We don't want to have different colors cause seams, so we try very hard
to render them at the same time.
2011-06-13 15:01:52 +02:00
Benjamin Otte
407b3f2cde themingengine: Implement support for multiple border colors
Also use this support to implement inset and outset border styles
without cheats.
2011-06-13 15:01:52 +02:00
Benjamin Otte
3aa73bebea styleproperty: Add border-*-color style properties
And make border-color a shorthand
2011-06-13 15:01:52 +02:00
Benjamin Otte
abc239f444 styleproperty: The default border color is the normal color 2011-06-13 15:01:52 +02:00
Benjamin Otte
ba7d1c2104 styleproperty: Make default_value() take a state
Because of this, resolve() needs to take a state, too. This is so that
we can have default values depend on other values (like border color).
2011-06-13 15:01:52 +02:00
Benjamin Otte
e0b1943c97 roundedbox: Fix border radius grow algorithm
When one radius gets to 0, the other should be set to 0, too. Otherwise
the paths constructed from it will not be correct.
2011-06-13 15:01:52 +02:00
Ignacio Casal Quinteiro
cfb2a45f9a overlay: add initial version of gtkoverlay 2011-06-12 23:27:18 -04:00
Daniel Drake
794a3706cd gtkdnd: Don't bind/unbind keycodes that couldn't be determined
At http://dev.laptop.org/ticket/10643 we are seeing that drag-and-drop
within the Sugar shell causes all of Sugar's custom keybindings to be
removed.

This is because gtkdnd tries to unbind XK_KP_Space, which (on my systems)
is resolved to NoSymbol by XKeycodeToKeysym(). NoSymbol has value 0,
the same as AnyKey, and XUngrabKey(AnyKey) is equivalent to unbinding
all possible keycodes.

Fix this by catching NoSymbol before binding/unbinding.

https://bugzilla.gnome.org/show_bug.cgi?id=652402
2011-06-12 21:44:00 -04:00
Matthias Clasen
36f6c6167b Revert "gtk/gtkmenuitem: gtk_misc_set_alignment replacing"
This reverts commit 49e62d2a5f.
It turns out that GtkAccelLabel is not quite ready for
widget align properties.
2011-06-12 21:36:37 -04:00
Javier Jardón
04fa731e6b gtk.symbols: Add missing api 2011-06-12 23:00:14 +01:00
Benjamin Otte
287069ca3c default theme: Fix menuitem check/radio colors 2011-06-12 23:35:39 +02:00
Benjamin Otte
3712ec71d4 default theme: fix menuitem selections 2011-06-12 23:28:43 +02:00
Benjamin Otte
d7598aabe3 default theme: fix tooltip colors 2011-06-12 23:26:53 +02:00
Benjamin Otte
4f649e10fa themingengine: Add magic to draw inset/outset properly
Use a bunch of tricks to get inset/outset right with a small amount of
code. In particular, fix the hidden sides causing artifacts.

Included is a bunch of code comments explaining what we actually do.
2011-06-12 23:00:25 +02:00
Benjamin Otte
cd4c527451 themingengine: Reduce border to 0 on hidden sides
Fixes drawing of expanders.
2011-06-12 23:00:25 +02:00
Benjamin Otte
8b0bffc3a2 themingengine: Fix inset/outset drawing 2011-06-12 23:00:24 +02:00
Ignacio Casal Quinteiro
391917063e textview: do not destroy the layout in unrealize
Now instead of invalidating when we create the layout we invalidate
when we realize the widget and we remove the invalidation when
unrealizing. It was pointless too destroying the layout in unrealize
as at the end what we just wanted was to remove the invalidation idles.
2011-06-12 17:54:07 +02:00
Benjamin Otte
deed7175ca roundedbox: Handle shrinking to zero
We need it for wide separators.
2011-06-12 03:42:29 +02:00
Cosimo Cecchi
61c253a132 themingengine: set the right coordinates for the rounded box rect 2011-06-11 13:32:15 -04:00
Benjamin Otte
3a1da7f09c styleproperty: Resolve NULL RGBAs to pink
.. instead of returning NULL and crashing.

Fixes no-colors reftest
2011-06-11 10:44:16 +02:00
Benjamin Otte
8861f6dbfb styleproperty: Fall back to default values, instead of recursing
Copy/paste error. The original commit message even explains this.
2011-06-11 10:38:23 +02:00
Benjamin Otte
7dbea94fd2 styleproperty: Add a default value func for border-image-width
This is necessary because we want to use NULL as the default value. But
the default value for borders is { 0, 0, 0, 0 } and not NULL.

Fixes border-image-gradient and border-image-repeat reftests.
2011-06-11 09:29:43 +02:00
Benjamin Otte
b196abe8be themingengine: Render inset box shadow on top of backgrounds 2011-06-11 09:29:43 +02:00
Benjamin Otte
590aadd056 styleproperty: Parse shadow options in any order
The CSS spec allows random ordering of various properties, so we should,
too.
2011-06-11 09:29:43 +02:00
Cosimo Cecchi
1539ade9d5 cssprovider: add a doc paragraph about box-shadow 2011-06-11 09:29:43 +02:00
Cosimo Cecchi
6b5b5cb305 styleproperty: register the box-shadow property 2011-06-11 09:29:43 +02:00
Cosimo Cecchi
4d986f7fb0 shadow: add _gtk_box_shadow_render()
This supports only inset box-shadow elements for now.
2011-06-11 09:29:43 +02:00
Benjamin Otte
40dfcfcbc4 themingengine: Draw border with GtkRoundedBox 2011-06-11 09:29:43 +02:00
Benjamin Otte
459278c5e1 themingengine: Use GtkRoundedBox for drawing backgrounds 2011-06-11 09:29:42 +02:00
Benjamin Otte
48814c8d1e themingengine: Do pattern merging smarter
Create an intermdiate surface and fill() with it later. Instead of doing
clip + paint twice.
2011-06-11 09:29:42 +02:00
Benjamin Otte
86719e1d35 gtk: Add GtkRoundedBox
CSS drawing operates on rounded boxes a lot, so it makes sense to split
them out instead of duplicating them everywhere.
2011-06-11 09:29:42 +02:00
Benjamin Otte
d8033c3796 themingengine: Get rid of extra variables
Now that we don't change the width/height anymore, we can keep using it
for scaling he background.
2011-06-11 09:29:42 +02:00
Benjamin Otte
117b50dd21 themingengine: remove unused variable 2011-06-11 09:29:42 +02:00
Benjamin Otte
c56700ca30 themingengine: background applies to full border
The code was attempting to only apply it to half of the border. But
according to CSS, the background area by default is the full border box.
2011-06-11 02:08:28 +02:00
Benjamin Otte
06642cab56 themingengine: Remove unnecessary optimization
Code is likely as fast or faster without it, and this saves code.
2011-06-11 02:04:17 +02:00
Matthias Clasen
abca0f050e Update gtkimcontextsimpleseqs.h
This is using the updated compose-parse.py from the previous commit.
2011-06-10 18:36:06 -04:00
Matthias Clasen
0bbc2ed520 Update compose-parse.py
This update makes compose-parse.py work with Unicode 6.0 and make
it generate the new GDK_KEY_ defines. Patch by Ryo Hashimoto,
bug 651979.
2011-06-10 18:33:05 -04:00
Diego Celix
71dc365e8a gtktoolitemgroup: gtk_misc_set_alignment replacing
Replacing the function gtk_misc_set_alignment () with
gtk_widget_set_halign () and gtk_widget_set_valign () in
gtk/gtktoolitemgroup.c

https://bugzilla.gnome.org/show_bug.cgi?id=650762
2011-06-10 17:59:58 -04:00
Diego Celix
b16c973699 gtkprinteroptionwidget: gtk_misc_set_alignment
Replacing the function gtk_misc_set_alignment () with
gtk_widget_set_halign () and gtk_widget_set_valign () in
gtk/gtkprinteroptionwidget.c

https://bugzilla.gnome.org/show_bug.cgi?id=650762
2011-06-10 17:59:57 -04:00
Diego Celix
90e2fdca71 gtk/gtkfontsel: gtk_misc_set_alignment replacing
Replacing the function gtk_misc_set_alignment () with
gtk_widget_set_halign () and gtk_widget_set_valign () in
gtk/gtkfontsel.c

https://bugzilla.gnome.org/show_bug.cgi?id=650762
2011-06-10 17:59:56 -04:00
Diego Celix
c92600c00f gtk/gtkassistant: gtk_misc_set_alignment replacing
Replacing the function gtk_misc_set_alignment () with
gtk_widget_set_halign () and gtk_widget_set_valign () in
gtk/gtkassistant.c

https://bugzilla.gnome.org/show_bug.cgi?id=650762
2011-06-10 17:59:55 -04:00
Diego Celix
0a75ffd4a3 gtkprintunixdialog: gtk_misc_set_alignment replace
Replacing the function gtk_misc_set_alignment () with
gtk_widget_set_halign () and gtk_widget_set_valign () in
gtk/gtkprintunixdialog.c

https://bugzilla.gnome.org/show_bug.cgi?id=650762
2011-06-10 17:59:54 -04:00
Diego Celix
a06dfd6873 gtkprintbackend: gtk_misc_set_alignment replacing
Replacing the function gtk_misc_set_alignment () with
gtk_widget_set_halign () and gtk_widget_set_valign () in
gtk/gtkprintbackend.c

https://bugzilla.gnome.org/show_bug.cgi?id=650762
2011-06-10 17:59:53 -04:00
Diego Celix
eb54d933a8 gtkpagesetupunixdialog: gtk_misc_set_alignment
Replacing the function gtk_misc_set_alignment () with
gtk_widget_set_halign () and gtk_widget_set_valign () in
gtk/gtkpagesetupunixdialog.c

https://bugzilla.gnome.org/show_bug.cgi?id=650762
2011-06-10 17:59:52 -04:00
Diego Celix
8af988e744 gtkfilechooserdefault: gtk_misc_set_alignment
Replacing the function gtk_misc_set_alignment () with
gtk_widget_set_halign () and gtk_widget_set_valign () in
gtk/gtkfilechooserdefault.c

https://bugzilla.gnome.org/show_bug.cgi?id=650762
2011-06-10 17:59:51 -04:00
Diego Celix
df9d7cf9aa gtkcellrendereraccel: gtk_misc_set_alignment
Replacing the function gtk_misc_set_alignment () with
gtk_widget_set_halign () and gtk_widget_set_valign () in
gtk/gtkcellrendereraccel.c

https://bugzilla.gnome.org/show_bug.cgi?id=650762
2011-06-10 17:59:49 -04:00
Diego Celix
cc0be1f949 gtk/gtkmessagedialog: gtk_misc_set_alignment
Replacing the function gtk_misc_set_alignment () with
gtk_widget_set_halign () and gtk_widget_set_valign () in
gtk/gtkmessagedialog.c

https://bugzilla.gnome.org/show_bug.cgi?id=650762
2011-06-10 17:59:48 -04:00
Diego Celix
0924e4d668 gtk/gtkmountoperation: gtk_misc_set_alignment
Replacing the function gtk_misc_set_alignment () with
gtk_widget_set_halign () and gtk_widget_set_valign () in
gtk/gtkmountoperation.c

https://bugzilla.gnome.org/show_bug.cgi?id=650762
2011-06-10 17:59:47 -04:00
Diego Celix
cb03ea518c gtk/gtkradiomenuitem: gtk_misc_set_alignment
Replacing the function gtk_misc_set_alignment () with
gtk_widget_set_halign () and gtk_widget_set_valign () in
gtk/gtkradiomenuitem.c

https://bugzilla.gnome.org/show_bug.cgi?id=650762
2011-06-10 17:59:46 -04:00
Diego Celix
49e62d2a5f gtk/gtkmenuitem: gtk_misc_set_alignment replacing
Replacing the function gtk_misc_set_alignment () with
gtk_widget_set_halign () and gtk_widget_set_valign () in
gtk/gtkmenuitem.c

https://bugzilla.gnome.org/show_bug.cgi?id=650762
2011-06-10 17:59:45 -04:00
Matthias Clasen
1c8632c911 One more change 2011-06-10 17:42:14 -04:00
Matthias Clasen
2204405c9c Expand migration hints for h/v boxes 2011-06-10 17:40:16 -04:00
Javier Jardón
bf0d8402f5 gtk: Use const instead G_CONST_RETURN 2011-06-10 13:07:54 +01:00
Javier Jardón
0ec4fa558f docs: Improve crossreferences
Use #GtkOrientable:orientation instead "orientation"
2011-06-10 10:56:35 +01:00
Murray Cumming
151bcc6dfa Box, etc: Improve docs after H* and V* deprecations.
Stop documenting the base class as just a base class for the
H and V specializations, copying the useful descriptions from
those H/V classes to the base class. Do not advise the use of
the H/V classes or refer to them unnecessarily.
2011-06-10 09:50:45 +02:00
Matthias Clasen
53b586abcf Avoid underallocations in the custom paper dialog 2011-06-10 00:17:56 -04:00
Matthias Clasen
8771f2ce9c Don't rely on button allocations for invisible headers
Now that we are not allocating treeview column buttons anymore
with invisible headers, we can't rely on their allocations for
other things like cell area computations anymore. Use x-offset
and width of the column directly, instead.
2011-06-10 00:17:56 -04:00
Matthias Clasen
eeca20a800 Add API to get x position of treeview columns
Their width was already available.
2011-06-10 00:17:56 -04:00
Cosimo Cecchi
9e5d6544ba border-image: unpack the GtkGradient if there's one
So that it will eventually be resolved by the style property lookup
machinery.
2011-06-09 23:07:50 -04:00
Cosimo Cecchi
35fdce68e1 cellrendererpix: make the icon render properly again
pix_rect was not initialized anymore, so the gdk_rectangle_intersect()
call would always fail.
2011-06-09 22:59:06 -04:00
Matthias Clasen
a081485269 GtkTreeView: Don't short-circuit header-height calculation
The code was putting header_height at zero when there is
no model. That leads to temporary underallocation of header
buttons.
2011-06-09 21:40:08 -04:00
Matthias Clasen
1743e18c87 GtkDialog: avoid underallocations
GtkDialog changes its size depending on style properties. If
we only do this in response to ::style-updated, it happens during
the initial realization of the dialog and leads to the dialog
'growing' between when we determine the initial window size and
when we allocate it that size. So, do this beforehand.
2011-06-09 20:43:02 -04:00
Cosimo Cecchi
3d1407a01a border-image: add support for border-image-width too
It's useful to set a slice size != border-width, as backgrounds are
clipped to border-width too.

As slices can be half-transparent and overlap the background,
this would not fill the border box properly if we only use a single
property for specifying the width.

Also, this brings us even closer to CSS3.
2011-06-09 20:01:57 -04:00
Matthias Clasen
5fcf9ae09e Don't size-allocate invisible headers
We don't ignore their size requests when determining the
column width, so allocating them is bound to spew tons
of annoying underallocation warnings.
2011-06-09 18:55:19 -04:00
Cosimo Cecchi
1208f2bde0 shadow: render icon-shadow for spinners 2011-06-09 23:17:09 +02:00
Cosimo Cecchi
aa37e7323f entry: use the current state when rendering symbolic icons
Make sure the current state is picked up when rendering symbolic icons
too.
2011-06-09 23:17:09 +02:00
Cosimo Cecchi
8efa8a067e entry: use GTK_STYLE_CLASS_IMAGE when rendering the entry icon 2011-06-09 23:17:09 +02:00
Cosimo Cecchi
430f6ecbc3 stylecontext: add an "image" style class
For images such as icons in GtkEntry widgets.
2011-06-09 23:17:09 +02:00
Cosimo Cecchi
02e82d69b8 entry: use gtk_render_icon() 2011-06-09 23:17:09 +02:00
Cosimo Cecchi
0198662d79 cellrendererpix: use gtk_render_icon() 2011-06-09 23:17:09 +02:00
Cosimo Cecchi
e6a3257b55 image: use gtk_render_icon() 2011-06-09 23:17:09 +02:00
Cosimo Cecchi
514e77581a stylecontext: add gtk_render_icon() 2011-06-09 23:17:09 +02:00
Cosimo Cecchi
0cd810ff7c themingengine: use cairo image surfaces to render state effects
This makes the code cleaner and allows this to be re-used in a
pixbuf-less future.
2011-06-09 23:17:09 +02:00
Cosimo Cecchi
2446aef0ea themingengine: add gtk_theming_engine_render_icon()
Renders a pixbuf in the provided rectangle, applying effects such as
'icon-shadow'.
2011-06-09 23:17:09 +02:00
Cosimo Cecchi
b6b66803c0 shadow: add _gtk_icon_shadow_paint()
Paints a shadow of the current source, using the defined colors.
2011-06-09 23:17:09 +02:00
Cosimo Cecchi
ef78d5b730 styleproperties: add an 'icon-shadow' style property
It's a custom property with the same semantics of text-shadow, which
works on icons and icon-like UI elements, such as spinners, arrows and
separators.
2011-06-09 23:17:09 +02:00
Cosimo Cecchi
c935439a72 border-image: fix a horizontal/vertical index typo 2011-06-09 17:06:00 -04:00
Cosimo Cecchi
aa515e71d1 spinbutton: don't render an additional background below arrows
It's an entry, so it already has a background below, even when the entry
doesn't have a frame. Also, gtk_spin_button_draw_arrow() will render a
background and a frame in the arrow space anyway.
2011-06-09 15:06:19 -04:00
Cosimo Cecchi
4d8b5baf7e spinbutton: don't remove the entry style class while rendering arrows 2011-06-09 15:06:18 -04:00
Cosimo Cecchi
42d7487a6e border-image: don't try to unpack values from a NULL border-image
NULL is a valid value for border-image, so if it's NULL when unpacking,
don't try to access the struct fields, but just init the GValues for the
unpacked parameters.
2011-06-09 15:06:18 -04:00
Murray Cumming
fe7125e00c gtkcssprovider.h: Remove a trailing comma. 2011-06-09 20:36:14 +02:00
Richard Hughes
16d0fca4f5 Add a 'value' GObject property to GtkPrinterOption so that it can be used with g_object_bind_property() 2011-06-09 15:50:34 +01:00
Benjamin Otte
88026c5073 themingengine: Don't modify pattern
Instead, scale/unscale the cairo_t.
2011-06-09 05:51:54 +02:00
Benjamin Otte
3ef4a3d46f border-image: Redo border-image rendering
The new code is smaller, less crashy and correct(er), but arguably more
complex. I'd have liked to make it simpler, but this border image
algorithm is complex...
2011-06-09 05:51:54 +02:00
Benjamin Otte
9606633d94 border-image-repeat: Fix order of hrepeat and vrepeat 2011-06-09 05:51:54 +02:00
Benjamin Otte
4f8283055e border-image: Don't use NEAREST filtering
use EXTEND_PAD instead to avoid borders.
2011-06-09 05:51:54 +02:00
Benjamin Otte
c0a6b1fb90 borderimage: No need to resolve
border-image is a shorthand, so it's unpacked unresolved and repacked
resolved.
2011-06-09 05:51:54 +02:00
Cosimo Cecchi
4e95e6ae21 border-image: move private types to gtkcsstypes.c 2011-06-09 05:51:54 +02:00
Cosimo Cecchi
052d6ef6da border-image: don't cache the cairo_surface_t in GtkBorderImage
It's not useful to cache these surfaces here, as the GtkBorderImage will
be always generated on the fly, being a shorthand property.

This also allows to get rid of the intermediate image surfaces for
rendering the slices; we now use cairo_surface_create_for_rectangle()
to proxy the slices from the source surface to the rendered area, which
should also yield better performance.
2011-06-09 05:51:54 +02:00
Cosimo Cecchi
a2a8d3e8f4 docs: expand the docs for border-image
https://bugzilla.gnome.org/show_bug.cgi?id=651194
2011-06-09 05:51:54 +02:00
Cosimo Cecchi
4cfccde6da border-image: ensure image->resolved is set when resolving the gradient
https://bugzilla.gnome.org/show_bug.cgi?id=651194
2011-06-09 05:51:54 +02:00
Cosimo Cecchi
e3dd437b67 styleproperty: turn border-image into a shorthand property
It's composed by
- border-image-source: a cairo_pattern_t holding an image from file or a
  gradient
- border-image-slice: a GtkBorder containing the slice offsets to apply
  on the image
- border-image-repeat: a GtkRepeatType for the image

We deviate from pure CSS3 in the following ways:

* border-image-width is assumed to be always 1, i.e. always equal to
  what's specified by border-width. I don't think it's a particularly
  useful property to have, but we could add it later if needed.
* border-image-outset is absent, as we can't render outside of the
  allocation yet.

https://bugzilla.gnome.org/show_bug.cgi?id=651194
2011-06-09 05:51:54 +02:00
Cosimo Cecchi
9976530fe0 border-image: change Gtk9Slice to GtkBorderImage
It's a similar private type, which is much more powerful, and respects
the CSS rendering specification for border-image.

https://bugzilla.gnome.org/show_bug.cgi?id=651194
2011-06-09 05:51:53 +02:00