Commit Graph

529 Commits

Author SHA1 Message Date
Matthias Clasen
329994291a Merge branch 'wip/baedert/for-master' into 'master'
Wip/baedert/for master

See merge request GNOME/gtk!1867
2020-05-11 14:24:45 +00:00
Matthias Clasen
b93631164f Remove lots of focus vfuncs
In many cases, the default widget vfuncs work just fine,
combined with setting focusable.
2020-05-11 00:11:37 -04:00
Matthias Clasen
edc31a264c widget: Add a :focusable property
Add back a property that determines whether an individual
widget will accept focus or not. :can-focus prevents the
focus from ever entering the entire widget hierarchy
below a widget, and :focusable just determines if grabbing
the focus to the widget itself will succeed.

See #2686
2020-05-10 23:24:48 -04:00
Timm Bäder
d015b1b29e scrolledwindow: Always keep the main child first
Otherwise we can't pick the scrollbars, which are allocated behind it.
2020-05-10 09:30:15 +02:00
Timm Bäder
6566fdc1e3 scrolledwindwo: Add a permanent junction node
Use that instead of save_named'ing a junction node.
2020-05-10 09:30:15 +02:00
Matthias Clasen
9d7b77f874 scrolledwindow: Derive from GtkWidget
We want to remove GtkBin and GtkContainer as they don't
provide much useful functionality anymore. This requires
us to move get_request_mode and compute_expand down.

We have to implement GtkBuildable, in order to keep
the <child> element in ui files working for aspect
frames.

See #2681
2020-05-04 22:53:07 -04:00
Matthias Clasen
54b613392b scrolledwindow: Add a child property 2020-05-04 22:53:07 -04:00
Matthias Clasen
e9ddf0fda5 Use gtk_viewport_set_child throughout
Replace all uses of gtk_container_add on viewports
by gtk_viewport_set_child.
2020-05-04 17:01:18 -04:00
Matthias Clasen
13b6b9f2b4 scrolledwindow: Stop setting focus adjustments
Stop setting focus adjustments on the automatically
generated viewport.
2020-04-18 14:43:48 -04:00
Emmanuele Bassi
dd23a37ca1 Reconcile documentation with declaration and definition
The arguments name in the documentation must match declaration and
definition, or gtk-doc and g-ir-scanner will get very cross at us.
2020-04-17 22:34:10 +01:00
Matthias Clasen
285aa226e5 scrolledwindow: Drop shadow-type
We were only using this as a boolean, so change it
to a boolean property named has-frame.
2020-04-17 10:57:36 -04:00
Matthias Clasen
f297d0684d scrolledwindow: Document the .frame style class 2020-04-17 10:57:36 -04:00
Matthias Clasen
0ee58e9ef4 gtk: Port widgets away from gtk_get_current_ apis
Use the event controller equivalents where needed.
This commit covers the simple cases.
2020-04-11 17:29:27 -04:00
Matthias Clasen
632524f679 Reinstate expected focus behavior
After the :can-focus change in the previous commit, widgets
need to set suitable focus and grab_focus implementations
to implement the desired focus behavior.

This commit does that for all widgets.
2020-04-09 17:50:29 -04:00
Benjamin Otte
f54d3a3aca scrolledwindow: Port bindings to use shortcuts 2020-03-25 22:36:03 -04:00
Matthias Clasen
31db615885 Revert "Merge branch 'disable-window-test' into 'master'"
This reverts commit 3ac4c76b18, reversing
changes made to 6ec96d2e98.
2020-03-19 18:03:16 -04:00
Benjamin Otte
fb7d1095d1 scrolledwindow: Port bindings to use shortcuts 2020-03-18 23:00:50 -04:00
Timm Bäder
6ff057f36a scrolledwindow: Remove an unnecessary cast 2020-02-25 14:18:24 +01:00
Timm Bäder
54bf739e8f scrolledwindow: Remove useless local variables 2020-02-25 14:18:24 +01:00
Benjamin Otte
0c4c88b449 scrolledwindow: Inline variable into return_if_fail() 2020-02-22 07:33:41 +01:00
Matthias Clasen
cadeca74e2 Go back to ::enter/::leave for pointer changes
These signals are behaving a little differently from
what ::focus-in/::focus-out used to do.
2020-02-21 00:51:03 -05:00
Matthias Clasen
b1eaa502df events: reorganize getters
Restructure the getters for event fields to
be more targeted at particular event types.

Update all callers, and replace all direct
event struct access with getters.

As a side-effect, this drops some unused getters.
2020-02-21 00:51:03 -05:00
Matthias Clasen
31bf9da63a Strip const from GdkEvent
Events are refcounted structs, and we generally don't
pass these as const.
2020-02-21 00:51:02 -05:00
Matthias Clasen
2416b4e2a0 Stop using gdk_event_get_target
We can now get the target widget from the gesture
that we are using to find the event in the first
place.
2020-02-21 00:51:02 -05:00
Matthias Clasen
2bac066a63 gesture: Keep the target widget for events
We already store the events; keep the target widget
in addition. This is a step towards getting rid of
gdk_event_get_target.
2020-02-21 00:51:02 -05:00
Matthias Clasen
e3158a1bfb Make crossing events handled the same way 2020-02-21 00:50:59 -05:00
Matthias Clasen
9402e335d0 wip: scrolledwindow stop using targets 2020-02-21 00:47:53 -05:00
Matthias Clasen
1b2289ad9b Stop using gtk_get_event_target
This is just a thin wrapper around gdk_event_get_target,
so use that directly.
2020-02-21 00:47:53 -05:00
Matthias Clasen
c343031a0e Stop using g_object_ref/unref on events
Use gdk_event_ref/unref instead of g_object_ref/unref.
Events will stop being object soon.
2020-02-21 00:47:53 -05:00
Timm Bäder
655711fef2 Rename gtk_widget{get,set,has}_style_class to _css_class
We want to use css instead of style everywhere now.
2020-02-07 13:16:45 -05:00
Timm Bäder
b7ee2cbc28 Start using GtkWidget's new style class API 2020-02-07 13:16:32 -05:00
Benjamin Otte
146b921246 cssnode: Convert name + id from interned string to GQuark
The reason for this is simply that I want to get hash functions that
have their values close together, so they can fit in a smaller range
(the goal here is 12 bits). By using GQuark, we get consecutive numbers
starting with 1 (and applications have <1000 quarks usually), whereas
interned strings can be all over the place.

As a side effect we also save 64 bytes per declaration.
2020-01-28 02:17:03 +01:00
Matthias Clasen
1e000c3dac Remove gtkdnd.h 2020-01-08 18:48:20 -05:00
Timm Bäder
108aac9ee3 scrolledwindow: Don't snapshot junction if we use indicators
The junction doesn't make sense when we use indicators, since the
scrollbars overlap anyway. Not snappshotting it anymore has no visual
effect since it's being drawn below the scrollbars anyway.
2020-01-07 17:27:18 +01:00
Timm Bäder
1e55e01692 scrolledwindow: Remove a useless local variable 2020-01-07 17:27:17 +01:00
Timm Bäder
412fcb0330 scrolledwindow: Avoid using gtk_widget_get_preferred_size
This way we only measure in the direction we need.
2020-01-07 17:27:17 +01:00
Benjamin Otte
07f2024bfc scrolledwindow: Use dispose(), not destroy() 2019-11-05 20:06:44 +01:00
Timm Bäder
8122156e84 scrolledwindow: Remove set_placement_internal()
set_placement() does the exact same thing.
2019-09-25 17:51:52 +02:00
Timm Bäder
cc9faf3cfa scrolledwindow: Actually add controller to widget
Closes #2127
2019-09-09 17:36:27 +02:00
Timm Bäder
6669ddad09 scrolledwindow: Stop using _gtk_widget_set_captured_event_handler
We can use an event controller with phase = CAPTURE these days.
2019-08-15 16:23:01 +02:00
Matthias Clasen
28c40a4c3d Merge branch 'wip/dboles/scrolledwindow-annotations' into 'master'
ScrolledWindow: Replace deprecated annotations; add (nullable) to set_[hvadjustment]()

See merge request GNOME/gtk!868
2019-06-12 16:18:36 +00:00
Christian Hergert
41e373f10c gtk: fix all uses of g_cclosure_marshal_generic
This adds specific marshallers for all of the locations where a generic
marshaller is being used. It also provides va_marshallers to reduce the
chances that we get stack traces from perf going through ffi_call_unix64.

This is forward ported from gtk-3-24.

# Conflicts:
#	gtk/gtkeventcontrollerkey.c
#	gtk/gtkeventcontrollermotion.c
#	gtk/gtkgesture.c
#	gtk/gtkgesturemultipress.c
2019-06-02 14:24:51 -07:00
Matthias Clasen
97e15b8718 scrolled window: respect overlay-scrolling setting
If the gtk-overlay-scrolling setting is FALSE,
don't use overlay scrollbars.
2019-05-31 15:04:23 +00:00
Matthias Clasen
bc739e607b scrolled window: Make final 2019-05-28 22:35:36 +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
948347afa9 Stop using gtk_widget_is_toplevel 2019-05-28 20:25:16 +00:00
Matthias Clasen
18788c2a86 Remove gtk_widget_get/set_has_surface
These serve no purpose anymore - widgets don't
have surfaces, unless they're a GtkNative.
2019-05-28 20:25:15 +00:00
Daniel Boles
7575d5216f ScrolledWindow: Annotate h|vadjustment as nullable
The code interprets NULL to mean 'create a new Adjustment and use that,
deposing the old one', but we neither documented nor annotated that
ability, so users could be unsure how to "unlink" a specific Adjustment.
While users could pass their own Adjustment in if this wasn't nullable,
we already support NULL in the code, and it doesn't hurt to document
that this is available as a convenience while retaining the behaviour.
2019-05-21 21:21:14 +01:00
Daniel Boles
45a98d6a93 ScrolledWindow: Replace deprecated (allow-none)
We prefer (nullable) for in arguments and (optional) for out arguments
that can be passed as NULL to avoid assigning anything to them.
2019-05-21 21:21:14 +01:00
Matthias Clasen
0d91481587 One forgotten leave signal handler 2019-03-18 15:35:07 -04:00