Commit Graph

851 Commits

Author SHA1 Message Date
Carlos Garnacho
dd8887c07d Compress all ::style-updated prior to ::realize
This is done to avoid early emission of this signal, that was
causing warnings during GtkDialog construction.
2011-01-04 03:06:09 +01:00
Matthias Clasen
1bcf8a0027 Remove sealed members from GtkSettings 2010-12-23 21:56:50 -05:00
Matthias Clasen
3a6800a898 Some small doc corrections 2010-12-23 11:18:50 -05:00
Matthias Clasen
9baf24f87e Add a default handler for drag_failed
And use it in notebook dnd.
2010-12-22 18:46:29 -05:00
Matthias Clasen
e6693ab840 Avoid invariant checking spew in gnome-shell
For normal toplevels, visible is tightly bound to mapped, but for
something like a toplevel that exists within a Clutter stage we
may want to make mapping dependenton external factors, so we shouldn't
actually checked that !mapped toplevels are !visible.

Pointed out by Owen Taylor,

https://bugzilla.gnome.org/show_bug.cgi?id=637834
2010-12-22 16:54:52 -05:00
Carlos Garnacho
e02b10046d Ensure widgets get a GtkStyle with its backing GtkStyleContext
Since the default style also has a backing context, it wasn't
being replaced after initialization.
2010-12-21 01:33:51 +01:00
Javier Jardón
33fd2104b7 docs: unmap signal will always be emitted when a widget is unmapped
Since commit 9552152dd9
2010-12-20 23:53:53 +00:00
Havoc Pennington
9552152dd9 Always emit unmap when a widget is unmapped
Previously, for performance reasons we would sometimes
skip invoking the unmap signal (and associated vfunc)
in favor of simply unrealizing. However, widgets then
had no way to clean stuff up when they were hidden
(but still inside a parent which was shown).

This patch also removes _gtk_tooltip_hide() which
was done in both unmap and unrealize in gtkwidget.c,
now can only be in unmap.

There are probably lots of things cleaned up in
unrealize that would now be better to move to unmap.

https://bugzilla.gnome.org/show_bug.cgi?id=629923
2010-12-20 13:04:45 -05:00
Havoc Pennington
b67c5af55b Add invariant that a child is unmapped if parent is unmapped
Requires fixes to GtkContainer and GtkWindow to unmap their
children, rather than just withdrawing or hiding the container
window.

Requires fix to GtkHandleBox to chain up to GtkContainer unmap.

Historically we avoided these unmaps for efficiency reasons,
but these days it's a bigger problem that there's no way
for child widgets to know that one of their ancestors has
become unmapped.
2010-12-20 12:58:04 -05:00
Havoc Pennington
23ce44c9fe Verify GtkWidget invariants if G_ENABLE_DEBUG is defined
These checks are a bit expensive so require --enable-debug=yes.
gtk_widget_verify_invariants() checks invariants mentioned
in docs/widget_system.txt in particular, and can verify
others in the future.

Some of the invariants in docs/widget_system.txt don't
in fact hold right now, so those are #if 0'd in this
patch pending someone fixing either the docs or the code.
2010-12-20 12:46:51 -05:00
Carlos Garnacho
56c3d4b1be Remove dead Gtk[Rc]Style code
Most code in gtkrc.c has been turned into a no-op, but that one
reverting in public API (gtk_rc_scanner_new() and such). GtStyle
is also more shallow, now fully relies in the backing
GtkStyleContext and all connection to gtkrc.c has been removed.

GtkBinding has been also affected, there is no replacement yet
for custom keybindings in style files, so that piece of code that
hooked into gtkrc has been replaced by a FIXME so in the future
it may be added back.
2010-12-18 12:10:00 +01:00
Carlos Garnacho
d7dc12d301 Adapt gtk_widget_set_name() docs to style context. 2010-12-18 11:43:37 +01:00
Matthias Clasen
7b665316cf Hide GtkWindowGroup members
In the process of removing all sealed members from headers.
At the same time, add a gtkwindowprivate.h header and move
all internal functions from gtkwindow.h there.
2010-12-17 20:41:16 -05:00
Matthias Clasen
9d8682b9ac Fix a few parameter name mismatches 2010-12-17 14:46:18 -05:00
Cosimo Cecchi
b792a31995 widgetpath: allow GTypes non-derived from GTK_TYPE_WIDGET
This makes things like GtkCellRenderer or GtkNumerableIcon more easily
themeable.

https://bugzilla.gnome.org/show_bug.cgi?id=637169
2010-12-17 18:30:57 +01:00
Carlos Garnacho
2c8c1c6df4 Remove *_set_extension_events() and old API to query devices.
The old functions to get core pointer and devices list are gone as
well. This slice is entirely replaced internally by multidevice
handling and may just go.
2010-12-17 16:25:14 +01:00
Matthias Clasen
b7fd6f1e88 Remove gtk_widget_reset_shapes
See bug 637155.
2010-12-14 22:15:33 -05:00
Carlos Garnacho
f9ed6baeb4 Improve docs for gtk_widget_reset_style().
Document that it may be needed in containers when
children are reordered.
2010-12-15 03:33:01 +01:00
Carlos Garnacho
99f59d8266 Fix coalescing of state animation areas for multiple window widgets.
Coordinates needed to be translated relative to the window position
in within the widget.
2010-12-13 22:31:27 +01:00
Matthias Clasen
5ac194c2d7 Some doc additions 2010-12-07 09:55:30 -05:00
Tristan Van Berkom
fc5cabba90 Added minimum size parameter to GtkWidgetClass->adjust_size_allocation.
This allows us to add a check before executing
->get_preferred_height_for_width() to ensure we always
request for at least the minimum required size (and lets
us remove the warning in gtkcontainer.c telling implementors
to do this check manually from thier container implementations).
2010-12-07 23:47:40 +09:00
Paolo Borelli
561346bd40 Remove unused function modify_color_property 2010-12-05 22:07:30 +01:00
Carlos Garnacho
5361490db8 Bug 636511 - New style override functions do not work on textview
Emit ::style-set on overrider style changes, this is necessary
in the mean time so widgets not listening yet to ::style-updated
get the style changes.
2010-12-05 20:19:55 +01:00
Matthias Clasen
d5df33c75f Fix abi check after recent merges 2010-12-05 12:18:30 -05:00
Carlos Garnacho
37719380ae Fix call to gtk_widget_override_cursor() 2010-12-04 18:26:34 +01:00
Carlos Garnacho
3d28adf317 Make gtk_widget_override_cursor() take GdkRGBAs
Even though the style properties have the GdkColor type, the other
gtk_widget_override_* API takes RGBA colors, so it is consistent
now.
2010-12-04 17:49:28 +01:00
Carlos Garcia Campos
07eeae1582 GtkWidget: add gtk_widget_render_icon_pixbuf()
and deprecate gtk_widget_render_icon()
2010-12-04 15:39:57 +01:00
Carlos Garcia Campos
15d997d58a GtkWidget: queue a resize when style context changed 2010-12-04 15:39:56 +01:00
Carlos Garnacho
9aca6c8071 GtkWidget: Add gtk_widget_override_cursor().
This function replaces gtk_widget_modify_cursor().
2010-12-04 15:39:54 +01:00
Carlos Garnacho
b0c87faa50 Add GtkModifierStyle as a private object
This object backs up gtk_widget_override_* operations. This object
is not meant to be public because any intention to modify widgets'
style in a themeable way should involve using regions/classes, so
they're modifiable through CSS. As such, the API is really
short-scoped.
2010-12-04 15:39:54 +01:00
Carlos Garnacho
297fa7a3dd GtkStyleProvider: Add GtkStateFlags parameter to get_style_property().
Widget style properties can now have different values depending on the
current state.
2010-12-04 15:39:51 +01:00
Carlos Garnacho
46de2130d3 GtkWidget: unset NULL properties when overriding style. 2010-12-04 15:39:50 +01:00
Matthias Clasen
e598f17871 Some header cleanups
Move GtkGradient to their own files, also move GtkBorder out of
gtkstyle.h, so that header can be all deprecated.
2010-12-04 15:39:47 +01:00
Matthias Clasen
f8a874abb1 Initial attempt at deprecating GtkStyle api
This will probably need some finetuning.
2010-12-04 15:39:46 +01:00
Carlos Garnacho
11004ef61d Initialize all looping, active state transitions on map()
This allows widgets to gtk_widget_set_state_flags() before mapping
and have animations started anyway when this happens.
2010-12-04 15:39:44 +01:00
Carlos Garnacho
c6b2e47931 Let gtk_widget_get_path() correct early calls during init(). 2010-12-04 15:39:40 +01:00
Carlos Garnacho
d9664021cc GtkWidget: Update pango context from style context's font description. 2010-12-04 15:38:49 +01:00
Carlos Garnacho
1cfeeadc70 GtkWidget: Ensure the style context always has an screen.
Things like font settings depend on the screen, and widgets
like GtkTextView trigger queries on widgets without screen
when the parent window is being destroyed.
2010-12-04 15:38:48 +01:00
Carlos Garnacho
f383e6b0a2 GtkWidget: Add new set of methods to override style information.
gtk_widget_override_*() deprecates gtk_widget_modify_*(). There are
only functions to modify fg/bg/font/symbolic color, If anything more
fancy/complex is needed. There is the possibility of adding a
GtkStyleProvider yourself.
2010-12-04 15:38:36 +01:00
Carlos Garnacho
227294a6aa GtkWidget: Trigger state change transitions on state flags change.
This makes state transitions automatic for non-complex widgets, complex
widgets such as GtkTreeView still need to notify state updates themselves.
2010-12-04 15:38:33 +01:00
Carlos Garnacho
cd98204619 Implement widget states as a set of flags
gtk_widget_(set|unset|get)_state_flags() has been added, using GtkStateFlags
to represent the widget state. GtkStateType API has been implemented on top
of the new one.
2010-12-04 15:38:30 +01:00
Carlos Garnacho
1bdd761c3f GtkWidget: Ensure name changes involve a style context update. 2010-12-04 15:38:29 +01:00
Carlos Garnacho
a79626b7fb Add theming docs
Both API and file format is documented, there's still missing
a migration doc though.
2010-12-04 15:38:21 +01:00
Carlos Garnacho
a65d0d00c0 GtkWidget: Store GtkStyleContext in private struct. 2010-12-04 15:38:19 +01:00
Carlos Garnacho
88b78953b6 GtkContainer: Add method to get the GtkWidgetPath for a child.
This is now used throughout in order to have the full path for a given widget,
including intermediate named regions, the default implementation just returns
the GtkContainer's path copy, no intermediate regions between.
2010-12-04 15:38:19 +01:00
Carlos Garnacho
c575733eda GtkStyleContext: Fix animation framework to work with the new draw() semantics.
Invalidation region coalescing now happens recursively as draw() runs, and the
widget's x/y as now drawing coordinates are 0,0 based.
2010-12-04 15:38:18 +01:00
Carlos Garnacho
a07fe2c0e6 Add generic providers per-screen.
The providers are added as soon as gtk GtkSettings object for the screen
is created.
2010-12-04 15:38:15 +01:00
Carlos Garnacho
8dfa0e03ea GtkWidget: Set style context's screen before the widget_path.
This is so the style context has all necessary information before
triggering a style change on setting the path.
2010-12-04 15:38:14 +01:00
Carlos Garnacho
f239704094 GtkWidget: Add gtk_widget_reset_style().
This function is analogous to gtk_widget_reset_rc_styles(),
updates style recursively on a widget.
2010-12-04 15:38:13 +01:00
Carlos Garnacho
3c390c9c8e GtkWidget: Add the style-updated signal
This signal is emitted whenever the widget's style changes.
2010-12-04 15:38:13 +01:00