Commit Graph

389 Commits

Author SHA1 Message Date
Benjamin Otte
2353d60b8a types: Move GtkAdustment declaration to gtktypes.h
... and make all the headers to not include gtkadjustment.h anymore. Of
course, also include it in the source files instead.
2012-03-03 19:45:03 +01:00
Carlos Garnacho
a5c394e901 menu: Handle smooth scrolling
event->scroll.delta_y will be used to scroll the menu contents,
GDK_SMOOTH_SCROLL_MASK has been set as well
2012-03-01 16:29:00 -05:00
Carlos Garnacho
535b4150fd menus: Don't popdown submenus on button release for touch devices
This is so submenus stay open as the parent menu item is
pressed/released, since the user would typically lift the
finger in order to select a submenu item.
2012-03-01 16:25:24 -05:00
Carlos Garnacho
5b08ececa2 menus: Remove gtk-touchscreen-mode from scrolling code
Scrolling is handled via ::captured-event dynamically, so remove
this now unused code.
2012-03-01 16:25:23 -05:00
Carlos Garnacho
c49fc433de menus: Select the first item for touch devices
This was done through gtk-touchscreen-mode. Now it is handled
dynamically on the current event source device.
2012-03-01 16:25:23 -05:00
Carlos Garnacho
47f9435e99 menus: Implement scrolling through event capture for touch devices
This makes overflown menus scrollable via direct manipulation.
Once past the threshold, the item below the pointer is unselected
and scrolling starts.
2012-03-01 16:25:23 -05:00
Carlos Garnacho
5139617b91 menus: Handle item selection for touch devices dynamically
Instead of using gtk-touchscreen-mode, the behavior changes depending
on the source device in use.
2012-03-01 16:25:22 -05:00
Rob Bradford
7cc3eb04ec menu: Deactivate the menu if the GdkWindow is withdrawn
If the display server or GDK hides the window - fire the "deactivate" signal
to ensure that the internal state is consistent.

This patch also ensures that the "deactivate" signal will not be fired for a
menu that is not active.

Bug: https://bugzilla.gnome.org/show_bug.cgi?id=670881
2012-02-29 12:18:30 +00:00
Javier Jardón
9d0febc9a6 Change FSF Address 2012-02-27 17:06:11 +00:00
Carlos Garcia Campos
73449a4e28 gtkmenu: Use symbolic names for button numbers 2012-01-27 09:47:43 +01:00
Matthias Clasen
dbd66a8f02 GtkMenu: Improve annotations
Add a 'Rename to' annotation so gtk_menu_popup_for_device
appears in bindings as gtk_menu_popup (which we skip anyway).

https://bugzilla.gnome.org/show_bug.cgi?id=657385
2012-01-25 21:14:52 -05:00
Andrea Cimitan
4a18fe7ef2 Introduce gtk_window_get/set_attached_to()
gtk_window_get/set_attached_to() is a new API that allows for windows to
be attached to a GtkWidget.
The attachment is a logical binding between the toplevel window and the
widget that generated it; this kind of information is currently used to
propagate style information from the widget to the window, but is also
useful e.g. for accessibility.

https://bugzilla.gnome.org/show_bug.cgi?id=666103
2012-01-12 14:03:00 -05:00
Matthias Clasen
c74ac08143 Another attempt at fixing menu positioning corner cases
The code for moving the menu into monitor / workarea was duplicated,
once for the push-in scenario and once for without. The problem with
the second case is that we've stored the menu position before adjusting
it. That made us remember an out-of-monitor position that then later
triggered _another_ copy of this code in the size-request implementation.

Unify this to only have one copy of code, and only store the menu
position after adjusting it to be inside the monitor. This fixes both
statusicon menus that get popped up from the panel, outside the workarea,
to not have scroll arrows, and the gedit language menu which was not
placed in the monitor at all after the initial workarea commit.

As a side-effect of this change, we now make large scrolling menus
occupy the full height of the workarea. Before this change, we were
keeping either the top or bottom edge put while shrinking the menu
to fit in the monitor.

https://bugzilla.gnome.org/show_bug.cgi?id=667249
2012-01-05 23:30:41 -05:00
Matthias Clasen
fbc3db8ba9 Fix scroll_offset handling
scroll_offset can be negative here, so replace a > 0 test
by != 0.
2011-12-23 00:36:20 -05:00
Matthias Clasen
f1bfdda3fd Only push the menu in if the position function said so 2011-12-23 00:36:20 -05:00
Matthias Clasen
a553cb50ab Use gtk_widget_get_allocated_width/height where it makes sense 2011-12-23 00:36:20 -05:00
Matthias Clasen
53ce519b1f Remove an unneeded variable 2011-12-23 00:36:20 -05:00
Matthias Clasen
547baf0e5f Remove an unused struct 2011-12-23 00:36:19 -05: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
Michael Natterer
1c8481a6ea Bug 663856 - Make option-foo accelerators use the right symbol
If the keyboard group shifting modifier is *also* a normal
accelerator modifier, we need to special case it when calling
gdk_keymap_translate_keyboard_state(), so we get the right
key symbol for accelerators (for example we want Option-O,
not Option-Ø displayed in menu items). This patch should only
affect quartz where the Alt key both shifts the group and can
be used as accel modifier, and not X11 or Win32 where AltGr
is not used for accelerators.

- fix quartz' gdk_keymap_translate_keyboard_state() to return
  the right consumed_modifiers
- add _gtk_translate_keyboard_accel_state() which does the
  special casing
- use it everywhere instead of gdk_keymap_translate_keyboard_state()
2011-11-18 13:06:27 +01:00
Matthias Clasen
068e1f0390 Move wholly deprecated files to a subdirectory
Also install their headers to a subdirectory.
2011-11-01 23:51:18 -04:00
Matthias Clasen
8370052180 Don't use *DISABLE_DEPRECATED guards
Instead define GDK_DISABLE_DEPRECATION_WARNINGS where appropriate.
2011-11-01 22:35:57 -04:00
Benjamin Otte
b13544171a menu: Deprecate GtkTearoffMenuItem 2011-10-01 05:59:04 +02:00
Matthias Clasen
6f39855c08 More include cleanups 2011-08-28 01:54:55 -04:00
Matthias Clasen
0e2f3271b9 Convert GailMenu to GtkMenuAccessible 2011-07-05 16:08:57 -04:00
Javier Jardón
bf0d8402f5 gtk: Use const instead G_CONST_RETURN 2011-06-10 13:07:54 +01:00
Javier Jardón
a1ce49c30e gtk: Clean some includes 2011-06-08 15:23:53 +01:00
Javier Jardón
fdf979dce2 gtkwidget: Move private functions to private header
https://bugzilla.gnome.org/show_bug.cgi?id=651707
2011-06-04 14:00:55 +02:00
Benjamin Otte
067dc19177 menu: Realize window before positioning
We want the menu realized so we know the size it's allocating to itself.
And we need that size to position the menu properly.
This is best visible on right-to-left.
2011-05-25 04:48:20 +02: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
Cosimo Cecchi
091a4d7f22 menu: don't use the border as a padding value
Borders should be rendered inside the allocation, not act as a second
padding.

https://bugzilla.gnome.org/show_bug.cgi?id=650418
2011-05-18 10:45:50 -04:00
John (J5) Palmieri
a47a7abe23 [gi] don't skip gtk_menu_attach_to_widget, correctly annotate the async callback 2011-03-03 16:06:28 -05:00
Murray Cumming
f91c04e284 Minor documentation improvements
Mostly correcting it's to its and changing some , to .
2011-02-23 10:26:21 +01:00
Matthias Clasen
394ae46ec0 Add some missing symbols to the docs 2011-02-08 23:21:39 -05:00
Matthias Clasen
beb8c290d1 Always chain up in ::style-updated
This was not handled consistently, but the default handler
does useful things, so we should always chain up.
2011-02-07 07:30:37 -05: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
Pavel Holejsovsky
374e76a19d [GI] Mark unintrospectable constructs as (skip)
Also adds 'Rename to:' annotation to some constructs replacing the
skipped ones.
2011-01-20 13:57:21 +01:00
Pavel Holejsovsky
2f0d40335b [GI] Add missing (transfer) annotations 2011-01-20 13:57:18 +01:00
Pavel Holejsovsky
a1c297a310 [GI] Cosmetic cleanups of annotations and doc comments
This change does not introduce any functionality change, mostly
cosmtic cleanups, like re-linebreak when introduced annotations messed
up indentation or whitespace errors fixes.
2011-01-18 17:31:59 +01:00
Pavel Holejsovsky
4dab3a601d Move GtkMenu docs inline 2011-01-17 15:27:04 +01:00
Carlos Garnacho
26db0b7276 Make GtkMenu(Shell) use GtkStyleContext
The default CSS has also been modified to theme these sensibly
2011-01-12 20:55:36 +01:00
Benjamin Otte
1af3a95e8c menu: Update adjustment usage for sealing 2011-01-05 23:50:21 +01:00
Benjamin Otte
8ea3372395 menu: Update adjustment usage for sealing
Call gtk_adjustment_set_value() instead of manually updating the value
in gtk_menu_scroll_to()
2011-01-05 23:50:21 +01:00
Matthias Clasen
98440ad031 Remove gtktypeutils altogether
Based on patches by Javier Jardón.

https://bugzilla.gnome.org/show_bug.cgi?id=629955
2011-01-04 14:51:19 -05:00
Javier Jardón
7245ca82f0 gtkmenu: Use private pointer instead G_TYPE_INSTANCE_GET_PRIVATE 2011-01-04 18:46:43 +01:00
Matthias Clasen
b5c6904c2f Drop explicit includes of gdkkeysyms.h
These are no longer needed. At the same time, port gtkimcontextsimpleseqs.h
to use the new GDK_KEY_ symbols.
2011-01-04 12:21:41 -05:00
Tristan Van Berkom
58cdd6d38e Removed GtkMenuItem->show_submenu_indicator flag
The show_submenu_indicator flag was explicitly set in various
places from GtkMenu/GtkMenuBar at request times, since the
GtkMenuItem already checks the parent type for GTK_IS_MENU_BAR()
in various places, removed this flag in favor of just checking
the parent type (only in the interest of better readable code).
2011-01-04 23:37:05 +09:00
Benjamin Otte
0c285341a9 API: gdk: gdk_display_get_device_state() => gdk_device_get_position()
The API was not display-specific, but belonged to the device. Also, we
didn't find a user of the modifier mask, so we dropped it.
2010-12-27 18:46:41 +01:00
Matthias Clasen
9dee9a84d0 Removed sealed members from GtkMenuItem 2010-12-26 22:58:57 -05:00
Matthias Clasen
2ed81aa57c Remove sealed members from GtkMenuShell 2010-12-23 18:21:53 -05:00