Commit Graph

90 Commits

Author SHA1 Message Date
Benjamin Otte
7844e8089c types: Clean up gtkwidget.h includes
In particular gtksettings.h and gtkstylecontext.h needed to be included
in lots of places now.

Also, I order the includes alphabetically in a bunch of headers.
2012-03-03 19:45:03 +01:00
Carlos Garnacho
51189ae260 tooltips: Use the source device instead of gtk-touchscreen-mode
This makes tooltips behavior dynamic based on the interacting device.
2012-03-01 16:25:22 -05:00
Javier Jardón
9d0febc9a6 Change FSF Address 2012-02-27 17:06:11 +00:00
Matthias Clasen
020c1846b7 Use the workarea when placing popups
This uses the new workarea API to avoid placing popups underneath
panels, docks, etc.
2011-12-18 14:29:16 -05:00
Paolo Borelli
5a471fefdb Remove unused alignment from GtkTooltip. 2011-12-04 19:20:23 +01:00
Benjamin Otte
98d215635e tooltip: Don't use deprecated API 2011-11-02 02:32:54 +01:00
Benjamin Otte
5ada0fc382 tooltip: Remove unused variables 2011-11-02 02:32:54 +01:00
Rui Matos
d56484f6ed tooltip: only update shape if the window is realized
If we get a composited-changed signal before the tooltip is ever realized we
have nothing to do.

This actually prevents a segfault in maybe_update_shape() because calling
gtk_widget_get_window() on a non-realized widget returns NULL.

https://bugzilla.gnome.org/show_bug.cgi?id=662467
2011-10-23 16:26:18 +01:00
Cosimo Cecchi
febc29852b tooltip: add support for opacity and rounded corners for tooltips
Rounded corners now will always work, using XShape in case we're not
running a composite manager.
Also, setting an RGBA visual (if available) on the tooltip toplevel
enables them to be transparent if the theme specifies so.

https://bugzilla.gnome.org/show_bug.cgi?id=599617
2011-10-19 15:15:00 -04:00
Matthias Clasen
6f39855c08 More include cleanups 2011-08-28 01:54:55 -04:00
Matthias Clasen
6176e23b30 Don't use a GtkAlignment 2011-06-07 22:31:34 -04:00
Kristian Rietveld
0b3b2a943a tooltips: treat scroll events like key/button press instead of motion
This avoids tooltips from staying visible when scrolling using scroll
events.  Suggested by Paul Davis.
2011-05-01 16:39:21 +02:00
Benjamin Otte
c7e5d0c63d tooltip: Use the actual size of the window we're going to show
It's easy by realizing the window first.

Don't try to guess the alorithm used by gtkwindow.c for sizing the
window, it might not be what we expect.
2011-04-27 00:27:29 +02:00
Matthias Clasen
d9fcc4c630 Silence new gcc warnings
gcc 4.6.0 has started to warn about set-but-unused variables.
So don't do that, then.
2011-01-23 21:51:38 -05:00
Carlos Garnacho
554e649a68 Make GtkTooltip use GtkStyleContext 2011-01-04 03:06:17 +01:00
Benjamin Otte
9746991548 API: gdk: Make gdk_display_get_window_at_device_position() a device API
It's now called gdk_device_get_window_at_position(). It doesn't make
sense to keep device-specific API part of the display.
2010-12-27 18:46:41 +01:00
Benjamin Otte
45d98d108e tooltip: Don't use deprecated APIs 2010-12-27 01:05:40 +01:00
Benjamin Otte
85bd61778f API: gdk: GDK_DISPLAY_OBJECT() => GDK_DISPLAY()
GDK_DISPLAY_OBJECT is now deprecated. No need to keep failures from
gtk1 around.
2010-12-21 12:07:07 -05:00
Michael Natterer
fb5dd9f72f Move all GdkDevice members to private and add one missing accessor 2010-11-23 20:25:13 +01:00
Michael Natterer
3a0afce509 gtk: remove "gboolean homogeneous" from gtk_box_new()
Because it's FALSE in virtually all use cases.
2010-10-31 19:22:28 +01:00
Javier Jardón
a9894d4cf4 Use gtk_box_new() instead gtk_[v|h]box_new() 2010-10-30 05:22:58 +02:00
Javier Jardón
ccaf842919 docs: Move documentation to inline comments: GtkTooltip 2010-10-03 00:59:39 +02:00
Benjamin Otte
d9c9259861 Move GtkSizeRequest into GtkWidget
It doesn't make sense to keep them separate as GtkSizeRequest requires a
GtkWidget and GtkWidget implements GtkSizeRequest, so you can never have
one without the other.
It also makes the code a lot easier because no casts are required when
calling functions.

Also, the names would translate to gtk_widget_get_width() and people
agreed that this would be a too generic name, so a "preferred" was added
to the names.

So this patch moves the functions:
gtk_size_request_get_request_mode() => gtk_widget_get_request_mode()
gtk_size_request_get_width() => gtk_widget_get_preferred_width()
gtk_size_request_get_height() => gtk_widget_get_preferred_height()
gtk_size_request_get_size() => gtk_widget_get_preferred_size()
gtk_size_request_get_width_for_height() =>
  gtk_widget_get_preferred_width_for_height()
gtk_size_request_get_height_for_width() =>
  gtk_widget_get_preferred_height_for_width()
... and moves the corresponding vfuncs to the GtkWidgetClass.

The patch also renames the implementations of the vfuncs in widgets to
include the word "preferrred".
2010-09-26 15:11:45 +02:00
Benjamin Otte
1d3f6b30b0 API: Rename gtk_cairo_paint_*() to gtk_paint_*()
Large patch, but just renaming.
Indentation should still mostly be correct because I took care of
keeping the indentation for this function name.
2010-09-26 15:11:42 +02:00
Benjamin Otte
c54968e964 tooltip: Connect to draw signal 2010-09-26 15:11:40 +02:00
Benjamin Otte
2ee8fdb79b gtk: gdk_drawable_get_display() => gdk_window_get_display() 2010-09-26 15:11:33 +02:00
Benjamin Otte
9f47be2216 gtk: gdk_drawable_get_screen/visual => gdk_window_get_screen/visual 2010-09-26 15:11:33 +02:00
Javier Jardón
b140884fec Use gtk_size_request_get_size() instead deprecated gtk_widget_size_request()
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=629598

Signed-off-by: Javier Jardón <jjardon@gnome.org>
Signed-off-by: Tristan Van Berkom <tristanvb@openismus.com>
2010-09-15 03:02:58 +02:00
Javier Jardón
3f101bb08c gtk/gtktooltip.c: use accessor functions to access GtkWidget 2010-08-22 21:25:22 +02:00
Matthias Clasen
dcdb00adb4 Avoid warnings with tooltips on toplevels
This was reported for tooltips on statusicons in bug 625235, but
it was affecting regular toplevel windows as well.
2010-08-05 00:12:41 -04:00
Javier Jardón
0a07e9733b gtk/: fully remove gtkalias hacks
https://bugzilla.gnome.org/show_bug.cgi?id=623845
2010-07-10 02:51:26 +02:00
Michael Natterer
6b4e19a132 Bug 607628 - DnD operation doesn't work when using offscreen
Turn find_widget_under_pointer() into internal API
_gtk_widget_find_at_coords() which is needed for fixing above
bug. This should actually be a public utility function, and will be
moved to another file when its final API has been decided.
(cherry picked from commit c4b1bbf3e2)
2010-05-26 17:21:09 +02:00
Matthias Clasen
bd4609b140 Merge the xi2-for-master branch 2010-05-25 18:38:44 -04:00
Matthias Clasen
51ddf0e1c9 Better tooltip positioning
Avoid the covering up the widget that you are tipping, as
far as possible. Bug 599618.
2010-05-07 23:28:07 -04:00
Michael Natterer
ece97b2359 Bug 615162 - Fix tooltips on offscreen widgets
Fix the "widget under pointer" logic and keyboard tooltip positioning
to do the right thing on offscreen widgets.
2010-04-15 13:03:43 +02:00
Javier Jardón
214a023e91 Deprecate widget flag: GTK_WIDGET_VISIBLE
Use gtk_widget_get_visible() instead

https://bugzilla.gnome.org/show_bug.cgi?id=69872
2010-03-01 07:52:07 +01:00
Javier Jardón
4f78f70b15 Deprecate widget flag: GTK_WIDGET_DRAWABLE
Use gtk_widget_is_drawable() instead.

https://bugzilla.gnome.org/show_bug.cgi?id=69872
2010-03-01 04:55:55 +01:00
Johan Dahlin
fe85272112 [annotations] Add allow-none
This commit was created using a script that searched for all docstrings
containing a parameter and the string 'or %NULL'.
Gdk backends and demos excluded as they are not part of a public API

https://bugzilla.gnome.org/show_bug.cgi?id=610474
2010-02-19 17:57:51 -02:00
Christian Dywan
bb1824c131 Deprecate flag macros for toplevel, state, no window and composite child
Deprecate widget flag macros GTK_WIDGET_STATE, GTK_WIDGET_SAVED_STATE,
GTK_WIDGET_FLAGS, GTK_WIDGET_TOPLEVEL, GTK_WIDGET_NO_WINDOW and
GTK_WIDGET_COMPOSITE_CHILD.

Also deprecate the type macros GTK_WIDGET_TYPE, GTK_OBJECT_TYPE_NAME and
GTK_OBJECT_TYPE which have become redundant.

Instances of GTK_WIDGET_TOPLEVEL are replaced with gtk_widget_is_toplevel,
GTK_WIDGET_TYPE is replaced with G_OBJECT_TYPE, GTK_WIDGET_COMPOSITE_CHILD
is replaced with use of the "composite-child" property and uses of
GTK_WIDGET_NO_WINDOW are adjusted to use gtk_widget_get_has_window.

Uses of GTK_WIDGET_SAVED_STATE and GTK_WIDGET_FLAGS inside GtkWidget are
changed to direct flag usage.

Documentation is updated to refer to gtk_widget_set_has_window and
gtk_widget_get_has_window.

Gail and tests are updated as well.

Fixes: https://bugzilla.gnome.org/show_bug.cgi?id=69872
2010-01-04 07:57:05 +01:00
Dan Winship
0b4af241b6 Change GtkIconSize to int in params/return values
GtkIconSize is an extensible enumeration (via
gtk_icon_size_register()), so methods that claim to take/return a
GtkIconSize need to actually use "int" to work correctly with bindings
that are strict about enum values.

https://bugzilla.gnome.org/show_bug.cgi?id=604895
2009-12-19 10:32:35 +01:00
Matthias Clasen
097b254e4b Documentation and stylistic fixups 2009-11-01 16:12:43 -05:00
Marek Kasik
cf8c4a6a80 A small correction of previous commit
Correct of a typo.
2009-10-19 11:44:09 +02:00
Matthias Clasen
52ef2f2a3e Correct a small oversight
When changing themes, we also need to update the box spacing of
tooltips.
2009-10-18 20:38:28 -04:00
Bastien Nocera
df53e6ad8b Add ability to set a tooltip's image from a GIcon
Makes it easier to implement fallbacks whilst following
theme changes.

https://bugzilla.gnome.org/show_bug.cgi?id=598261
2009-10-14 13:22:14 +01:00
Xan Lopez
f0f39c34f8 Update last_window only when needed
_gtk_tooltip_handle_event, which is called for many events in the GTK+
main loop, calls gtk_tooltip_set_last_window, which keeps a weak
reference to the last window we passed through. If the window being
set is the same than the last one there's really no need to update our
weak reference, so add a check for that and exit early.
2009-09-29 23:45:03 -04:00
Paolo Borelli
f97a33ad9c Move timer removal in dispose
Move removal of timer function in dispose to prevent potentially running
them on a diposed-but-not-finalized tooltip
2009-09-01 15:50:42 +02:00
Kristian Rietveld
f84df976a7 Bug 478519 - GtkTooltip segfaults on NULL gdk-display-current-tooltip
Make the tooltip code a bit more robust for a case that only occurs when
GTK+ is used from a language binding.  It looks like this case appears
because the memory management / ref counting is handled differently in
some of the language bindings.  Instead of asserting, we will fail
silently.  Also fix a think-o in gtk_tooltip_start_delay().  Patch from
O. Andrieu.
2009-08-22 23:21:44 +02:00
Lin Ma
d0f887ddb1 Fix GtkTooltip destroy the custom widget
Fixed 576091, Custom_widget does not get destroyed when the tooltip
goes away. Add a release note for this fix.
2009-05-25 10:01:04 +08:00
Matthias Clasen
4995ea0fcb Set the root coordinates in the event correctly. Patch by Kristian
* gtk/gtktooltip.c (gtk_tooltip_trigger_query): Set the root
        coordinates in the event correctly. Patch by Kristian Rietveld.


svn path=/trunk/; revision=22277
2009-02-04 01:16:35 +00:00
Matthias Clasen
f72dd13a36 Avoid uninitialized memory warnings
svn path=/trunk/; revision=21603
2008-10-07 18:06:00 +00:00