Commit Graph

611 Commits

Author SHA1 Message Date
Timm Bäder
d570121704 menu: Align function parameters 2019-10-12 17:59:23 +02:00
Timm Bäder
93122ac935 menu: Remove unused members 2019-10-12 17:59:23 +02:00
Timm Bäder
f9e100cb1e menu: Remove menu_queue_resize
The have_layout flag is unused, so this is equal to a normal
gtk_widget_queue_resize().
2019-10-12 17:59:23 +02:00
Timm Bäder
9ceb41f9a4 menu: Fix an uninitialized value
If the menu does not have any children, we'd otherwise end up calling
g_object_ref() on an uninitialized value.
2019-07-15 06:43:25 +02:00
Jonas Ådahl
f66e764855 menu: Remove unused variable 2019-07-03 11:42:28 +02:00
Matthias Clasen
c7ccaa5ef2 menu: Update scrollbar policy
We want to avoid sizing problems for small menus
due to the vertical scrollbar imposing a min-height on
its slider.

Closes: https://gitlab.gnome.org/GNOME/gtk/issues/1930
2019-06-03 14:49:13 +00:00
Matthias Clasen
feef0ef93a menu: Fix destruction
Now that menubar and menu are containers
with internal structure, we need to be
careful about doing the right thing in
forall and dispose.
2019-06-01 03:32:10 +00:00
Matthias Clasen
6c201e7927 menu: Fix keynav between submenus
Left/Right arrow now work again to enter
or leave a submenu.
2019-05-31 23:36:35 +00:00
Matthias Clasen
ace30d42ea menu: Bring back the scroll keybindings
Home, End, Page Up/Down, work again.
2019-05-31 23:36:35 +00:00
Matthias Clasen
e599336ad4 menu: Keep selected item in view
This gets us most of the way to working scrolling.
2019-05-31 23:36:35 +00:00
Matthias Clasen
8ba3c75682 More menu work 2019-05-31 23:36:35 +00:00
Matthias Clasen
3f6272f56e More menu restructuring
Make GtkMenuBar use a box as well,
and let GtkMenuShell get the items
from GtkMenuBar and GtkMenu via
a vfunc. Use that to fix the keynav
implementation in GtkMenuShell.
2019-05-31 23:36:35 +00:00
Matthias Clasen
13e010deb6 menu: Use a scrolled window
This brings back some support for scrolling.
We still need to reinstate some of the
scroll-to-selected and keynav functionality.
2019-05-31 23:36:35 +00:00
Matthias Clasen
ae1ba79f63 menu: Use a box
This makes some of the GtkMenuShell api
no longer work, since we don't let the
menu shell code maintain the list of
children anymore.
2019-05-31 23:36:35 +00:00
Matthias Clasen
f645c4e923 menu: Remove global coordinates
This commit removes support for scrolling and
for the keep-up triangle from GtkMenu, and gets
rid of all use of global coordinates.
2019-05-31 23:36:34 +00:00
Benjamin Otte
4e464b4960 menu: Only set position in one place 2019-05-31 23:36:34 +00:00
Benjamin Otte
d971c4e69d menu: Simplify function
No need to do complicated math when we can just look at the allocation.
2019-05-31 23:36:34 +00:00
Matthias Clasen
7f65e5f96b Rename GtkGestureMultiPress to GtkGestureClick
The name just made it hard for people to find the
right gesture to use.
2019-05-29 17:10:46 +00:00
Matthias Clasen
7447abb52b Stop using gtk_widget_get_toplevel
All uses of it can be replaced by gtk_widget_get_root.
2019-05-28 20:25:16 +00:00
Matthias Clasen
302d2a04ae Stop using gtk_widget_get_surface
Replace all uses of gtk_widget_get_surface by
gtk_native_get_surface.
2019-05-28 20:25:16 +00:00
Matthias Clasen
d2951d3aac Rename surface constructors
We want to use a gdk_surface_new_popup for popups,
and align the constructor names with the surface
types, so rename

gdk_surface_new_popup -> gdk_surface_new_temp
gdk_surface_new_popup_full -> gdk_surface_new_popup

The temp surface type will disappear eventually.
2019-05-28 20:25:14 +00:00
Matthias Clasen
346bd3f6b5 menu: Stop using gdk_surface_new_temp
We can just as well use gdk_surface_new_popup.
2019-05-28 20:25:14 +00:00
Matthias Clasen
55c286661b menu: Stop using gtk_widget_register_surface
It does not seem to be necessary at all.
2019-05-28 20:25:14 +00:00
Matthias Clasen
d7c54920ee menu: Listen only for notify::root
We no longer emit the display-changed signal,
so stop listening.
2019-05-01 23:05:09 +00:00
Matthias Clasen
78d254370c Merge branch 'inspector-menu-fix' into 'master'
Inspector menu fix

See merge request GNOME/gtk!804
2019-05-01 23:01:50 +00:00
Matthias Clasen
377ec33069 menus: Fix menus on non-default displays
Currently, we sometimes emit display-changed
when the display changed, and sometimes we don't
since the display is changed via gtk_widget_root.

Listen for notify::root as well and update our
display. This is a temporary fix - all display
changes should go through gtk_widget_root,
eventually.
2019-05-01 22:50:29 +00:00
Matthias Clasen
62b7ea7611 Remove gtk_menu_set_display
Menus should always be attached to a toplevel,
in which case they get their display that way.
2019-05-01 21:54:57 +00:00
Benjamin Otte
8ad38e5ae5 menu: Remove unused function parameter
The parameter was only ever set to TRUE.

And to make matters even more fun, the function didn't ever look
at the parameter.
2019-04-15 14:38:23 +02:00
Benjamin Otte
5473d13470 menu: remove bottom attach
bottom attach is top attach + 1, so use that everywhere
2019-04-15 14:38:23 +02:00
Benjamin Otte
31ccb7ca70 menu: get rid of 2 variables
They are always 0 and 1 respectively, so treat the code like that.
2019-04-15 14:38:23 +02:00
Benjamin Otte
dba1926a42 menu: Yeah cool, you're the last child
Nobody cares.
2019-04-15 14:38:23 +02:00
Benjamin Otte
b1b12a239f menu: Remove attach properties
They're never changed from being -1. So just replace them with -1
everywhere.
2019-04-15 14:38:23 +02:00
Matthias Clasen
21580309d3 Rename gdk_surface_get_device_position_double
Drop the _double suffix, now that the int version is gone.
2019-03-26 18:12:54 -04:00
Matthias Clasen
2d10a7b9c4 gtk: Stop using gdk_surface_get_device_position
Use the double version directly.
2019-03-26 18:08:32 -04:00
Matthias Clasen
8650980797 Adapt to motion controller api change
The signature of the enter/leave signals changed.
Adapt all users.
2019-03-18 09:24:42 -04:00
Benjamin Otte
01f7f255b5 gtk: Check return value of compute_bounds()
Half of these calls will completely break if anybody ever uses CSS
transforms with them, but hey...
2019-02-20 05:26:31 +01:00
Emmanuele Bassi
25fd230327 gtk: Drop the "plus"
Source names should use "[gtk]" without the plus.
2019-02-05 11:26:20 +01:00
Timm Bäder
20429f4764 Remove :active state handling on widgets 2019-01-29 07:19:54 +01:00
Matthias Clasen
9dee863217 menu: Drop the child properties
These were only there in support of tabular menus.
2019-01-23 23:36:04 -05:00
Matthias Clasen
e31a96123e Drop gtk_menu_attach
We no longer support tabular menus.
2019-01-23 23:30:18 -05:00
Timm Bäder
ade171a2ed widget: Don't pass a position to ->size_allocate
The values have been 0/0 for a long time now, so just drop the
GtkAllocation argument and replace it with width and height.
2018-11-13 16:28:54 +01:00
Ernestas Kulik
edc4b2f7d0 eventcontrollerscroll: Conditionally propagate ::scroll
Currently, gtk_event_controller_scroll_handle_event() always returns
TRUE if it is handled, which stops the propagation of the event. If
there’s a single GtkEventControllerScroll in the widget hierarchy, that
means that no others will run, depending on the propagation phase. In
Nautilus, this can be observed when adding a scroll controller to the
GtkScrolledWindow (ctrl-scrolling controls the zoom level) - either the
scrolling or the zooming breaks.

Fixes https://gitlab.gnome.org/GNOME/gtk/issues/45
2018-11-12 10:35:37 +01:00
Timm Bäder
e89bd7dfa2 menu: Remove useless if statement 2018-09-23 17:34:03 +02:00
Timm Bäder
2f6e998a27 menu: Show scroll arrows if necessary 2018-09-23 17:34:03 +02:00
Timm Bäder
7b7296410e menu: Remove arrow visibility flags 2018-09-23 17:34:03 +02:00
Timm Bäder
dcb6c9b4cf menu: Remove seen_item_enter flag
Unused.
2018-08-18 20:54:29 +02:00
Timm Bäder
afdeffd820 menu: Remove have_position flag
It's always FALSE.
2018-08-18 20:54:29 +02:00
Timm Bäder
10439aaefe menu: Remove an unnecessary gtk_widget_destroy() call
The unref will already properly free the menu item's resources.
2018-08-18 20:54:29 +02:00
Timm Bäder
b749fe4270 menu: Use correct content height 2018-08-05 10:22:10 +02:00
Timm Bäder
933cb857cf menu: Allocate children according to scroll_offset
This was done by simply moving the bin_window before but now we have to
do it ourselves.
2018-08-05 10:22:10 +02:00