Commit Graph

433 Commits

Author SHA1 Message Date
Matthias Clasen
bf8a169cb9 docs: Another round of markup removal 2014-03-29 00:24:15 -04:00
Lars Uebernickel
a5d5106fcf gtkmenu: displace popups by their css margin
Without a margin, the pointer is above the first (or last) menu item,
making it easy to accidentally activate that item.

https://bugzilla.gnome.org/show_bug.cgi?id=591258
2014-03-06 10:44:28 +01:00
William Jon McCann
469d333aa2 docs: use Returns: consistently
Instead of Return value:
2014-02-19 18:56:05 -05:00
Matthias Clasen
7f6a964c47 Docs: Remove all entities and turn off sgml mode
With all element markup gone, it is time to turn off
sgml mode, and get rid of entities as well.
2014-02-09 17:58:07 -05:00
William Jon McCann
13998c55e7 docs: use proper quotations instead of '*' 2014-02-07 14:22:39 -05:00
William Jon McCann
e34bd4137d docs: use apostrophes in *n't 2014-02-07 13:32:47 -05:00
William Jon McCann
7a208fbbf3 docs: use proper apostrophe
https://wiki.gnome.org/Design/OS/Typography
2014-02-07 13:06:10 -05:00
William Jon McCann
2a45418b67 docs: use proper quotes 2014-02-05 15:08:42 -05:00
William Jon McCann
a22358c0c0 docs: use ` instead of <literal> 2014-02-04 18:24:29 -05:00
William Jon McCann
63e887e165 docs: replace all <examples> with markdown headings 2014-02-04 16:58:54 -05:00
William Jon McCann
4c8bd8e7cf docs: Identify examples that are C code
https://bugzilla.gnome.org/show_bug.cgi?id=723119
2014-01-29 12:45:49 -05:00
William Jon McCann
768bc44081 docs: use |[ ]| instead of <programlisting></programlisting>
https://bugzilla.gnome.org/show_bug.cgi?id=723119
2014-01-29 12:45:49 -05:00
Matthias Clasen
e1d9974537 Drop internal uses of gtk_widget_get_root_window
This function is just a one-line convenience function that
is about to be deprecated.
2014-01-24 20:16:33 -05:00
Philip Withnall
a265d8f32d gtkmenu: Fix potential use of uninitialised variables
The child_height out variable is only valid if compute_child_offset()
returns TRUE.

Found by scan-build.

https://bugzilla.gnome.org/show_bug.cgi?id=712760
2013-12-02 10:36:26 +00:00
Benjamin Otte
4e9356f339 menu: Do a proper min height request
The minimum height is the size of one menu item plus the arrows, not the
minimum size of all menu items.

https://bugzilla.gnome.org/show_bug.cgi?id=691974
https://bugzilla.gnome.org/show_bug.cgi?id=694859
2013-11-25 03:54:05 +01:00
Bastien Nocera
438cd857c4 all: Add names to timeouts
Add names to every timeout we setup, so it's easier to track their
usage, and debug possible misbehaviour.

https://bugzilla.gnome.org/show_bug.cgi?id=710651
2013-10-23 13:31:18 +02:00
Murray Cumming
22fe579d37 GMenu docs: Tiny grammar fix 2013-10-11 10:25:24 +02:00
Xavier Claessens
f979c3d7a2 GtkMenu: Document that gtk_widget_insert_action_group() can be used 2013-10-10 14:07:41 -04:00
Matthias Clasen
8383f003f3 Avoid deprecation warnings 2013-08-20 00:15:37 -04:00
Matthias Clasen
1398f8ea4c Add some missing deprecation annotations
These were reported missing in bug
https://bugzilla.gnome.org/show_bug.cgi?id=705672
2013-08-13 18:09:47 -04:00
Murray Cumming
9ea08fae04 docs: gtk_menu_attach_to_widget()
Add a few more clues about why this is useful,
based on
https://mail.gnome.org/archives/gtk-devel-list/2007-November/msg00176.html
and the reference to it from gtk_menu_new_from_model().
2013-07-22 14:10:53 +02:00
William Jon McCann
6f7b0cac94 Deprecate tear off menus 2013-07-18 12:16:02 -04:00
Emmanuele Bassi
0899ef7cc9 gtk: Use new macros for defining private data
https://bugzilla.gnome.org/show_bug.cgi?id=702996
2013-07-09 09:30:02 +01:00
William Jon McCann
76936193d5 Deprecate and ignore gtk-menu popup and popdown delay settings
Just pick good defaults. The a11y team confirmed that they don't
rely on them.
2013-06-26 14:08:37 -04:00
William Jon McCann
2d79334bb0 Deprecate and ignore gtk-can-change-accels
It is disabled by default
2013-06-26 12:00:42 -04:00
Matthias Clasen
1800dc4709 Remove gtk_widget_size_allocate from gtk_menu_popup_for_device
GtkMenu calls gtk_widget_size_allocate on its GtkWindow during
gtk_menu_popup_for_device if the menu has not been realised. This can cause the
allocation of the GtkWindow and the size of the GdkWindow to become out of sync
because a top level GtkWindow does not attempt to re-size the GdkWindow when
its allocation is set.
https://bugzilla.gnome.org/show_bug.cgi?id=695120
2013-05-09 12:06:05 -04:00
Matthias Clasen
f5f5b70355 Ignore deprecations where needed
There are a few places where we are still using deprecated
API internally - ignore deprecations around these uses.
2013-05-05 15:38:48 -04:00
Alexander Larsson
3d4cd4db3e Add gtk_widget_(un)register_window
This replaces the previously hardcoded calls to gdk_window_set_user_data,
and also lets us track which windows are a part of a widget. Old code
should continue working as is, but new features that require the
windows may not work perfectly.

We need this for the transparent widget support to work, as we need
to specially mark the windows of child widgets.

https://bugzilla.gnome.org/show_bug.cgi?id=687842
2013-02-07 11:11:37 +01:00
Benjamin Otte
b068b18c78 menu: Huh?
What was that code supposed to achieve? Why are we unsetting flags that
might be useful?
2012-12-29 02:07:09 +01:00
Cosimo Cecchi
01dc23cdec menu: deprecate horizontal-padding and vertical-padding
https://bugzilla.gnome.org/show_bug.cgi?id=689168
2012-11-28 10:09:16 -05:00
Ryan Lortie
dd143479fe gtkmodelmenu: simplify logic, expose bind API
Make the main (and only) entry-point to gtkmodelmenu.c the now-public
gtk_menu_shell_bind_model().

Move the convenience constructors (gtk_menu_new_from_model() and
gtk_menu_bar_new_from_model()) to their proper files.

Remove the private header file.

Simplify the code a bit by making the initial populate part of the
bind() call.

https://bugzilla.gnome.org/show_bug.cgi?id=682831
2012-09-17 12:31:22 -04:00
Lars Uebernickel
d30d56452c GtkWidget: Add gtk_widget_insert_action_group()
This allows adding a GActionGroup with a given name at an arbitrary
point in the widget tree.

This patch also adds an internal _get_action_muxer() API.  Calling this
will create a GActionMuxer associated with the widget.  The parent of
the muxer will be the muxer of the widget's conceptual parent.  For
non-menus, that is the normal parent.  For menus, it is the attach
widget.

In this way, we end up with a hierarchy of GActionMuxer that largely
reflects the hierarchy of GtkWidget, but only in places that the action
context has been requested.  These muxers are the ones on which the
inserted actions groups are installed.

A following patch will add a user of this API.
2012-08-20 13:09:04 -04:00
Carlos Garnacho
bd3ca2b30e menu: Fix touch scrolling on menus close to the monitor edge
Specially in the case of comboboxes, those menus could enable scrolling
even if the contents could fit in the work area, and could show blank
space in order to line up the selected item with the combobox.

When such thing happens, take into account scroll_offset when relocating
the menu contents so contents don't jump directly onscreen, and apply
it so scrolling is allowed in the direction that brings the menu onscreen
and blocked in the opposite direction.

Also, wait for cancelling the scroll operation until the touch is released
even if the scrolling arrows disappeared, so the menu item underneath isn't
selected right away.

https://bugzilla.gnome.org/show_bug.cgi?id=678113
2012-07-13 19:21:41 +02:00
Carlos Garnacho
36bcb3bf95 menu: small code cleanup
Don't check twice for the widget being realized to move
both windows
2012-07-13 14:49:47 +02:00
Carlos Garnacho
10fa09137e menu: code style fix
The newline before != looks unintentional
2012-07-13 14:47:38 +02:00
Cosimo Cecchi
f81bd6c52d menu: notify attach-widget property when menu is detached
When the menu is detached, the attach-widget property changes value to
NULL, so we should notify a property change, like
gtk_menu_attach_to_widget() does.

https://bugzilla.gnome.org/show_bug.cgi?id=679454
2012-07-06 11:14:15 -04:00
Cosimo Cecchi
f70fc49ebc docs: fix a number of typos and obsolete references 2012-07-02 10:41:11 -04:00
Cosimo Cecchi
66a2870bfd menu: add missing (scope async) annotation to gtk_menu_popup()
Or the g-i scanner will emit a warning.

https://bugzilla.gnome.org/show_bug.cgi?id=677127
2012-06-25 14:49:11 -04:00
Matthias Clasen
87cd49371a Make page up/down work again in scrolled menus
This was broken since before GTK+ 3.0, when we replaced
a use of requisition by allocation. Fix this by using the
requisition height, that is already cached by the menu code.

The math is not quite right here; if you page all the way
down a long menu, you end up on the second-to-last menuitem.
But at least, page up/down let you move up and down the menu
again.
https://bugzilla.gnome.org/show_bug.cgi?id=668931
2012-04-24 23:34:12 -04:00
Benjamin Otte
33f111a47c widget: Don't cache widget paths all the time
Add an internal API that allows GtkStyleContext to create a widget path
for the widget and with that bypassing gtk_widget_get_path() and that
  function caching the path.
2012-04-17 08:59:21 +02:00
Matthias Clasen
050cba6a31 Fix malformed doc comments
Most of these are forgotten :'s and similar details
which gtk-doc now warns about.
2012-04-12 21:12:16 -04:00
Benjamin Otte
7204724c9f menu: Undo a hack with style contexts
Widget implementations aren't allowed to fiddle with the widget's style
context.

Sheesh.
2012-04-07 13:01:25 +02:00
Matthias Clasen
aba316207d Undo the gtk_menu_popup_for_device rename-to annotation 2012-03-19 13:45:48 -04:00
Benjamin Otte
461803e407 gtk: Get gtkwidgetpath.h includes out of the public headers
and include them in the C files instead.
2012-03-19 02:26:16 +01:00
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