Commit Graph

698 Commits

Author SHA1 Message Date
Matthias Clasen
35a88c1440 widget: Rename a function
set_enabled is shorter and more to the point
than enabled_changed, now that we no longer have
a callback to query the state.

Adapt all callers.
2019-06-22 17:03:51 -04:00
Matthias Clasen
7e73da5f73 widget: Add parameter type back to install_action
Adapt all callers.
2019-06-22 16:48:16 -04:00
Matthias Clasen
a933a9bc79 Fix initial mnemonic visibility
We were showing mnemonics initially, which is not desired.
2019-06-21 02:38:05 +00:00
Matthias Clasen
90701cb655 label: Use the new action machinery
Port GtkLabel to use widget class actions.

Note that this also changes the names of
the GtkLabel actions away from a generic
"context" prefix.
2019-06-18 14:47:33 -04:00
Matthias Clasen
964b2574cf label: Redo context menus
Drop the ::populate-popup signal and implement
the new context menu api. Things are a bit more
complicated here, since we have different menus
on links and selectable text.
2019-06-13 11:59:50 +00:00
Matthias Clasen
6f689ec5b1 label: Fix mnemonic visibility handling
With non-widgets having children, we can no
longer assume that using gtk_container_forall
lets us walk the entire tree.
2019-06-09 17:38:54 +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
c34abb6775 label: Make final 2019-05-28 19:45:45 -04: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
Matthias Clasen
9059eee2f0 Review and replace uses of get_toplevel
Now that roots can have parent widgets, we need to
carefully examine all calls of gtk_widget_get_toplevel,
and replace them with gtk_widget_get_root if we want
the nearest root, and not the ultimate end of the parent
chain.
2019-05-28 20:24:39 +00:00
Matthias Clasen
965d0e04d1 gtk: Use root/unroot instead of display-changed
The display-changed signal is going away
2019-05-02 01:33:41 +00:00
Matthias Clasen
7553d0c471 label: Activate default via action
Switch to the new way of activating default.
2019-04-28 23:20:13 +00:00
Matthias Clasen
b26087845d label: Stop juggling cursors
We have a convenience api for this.
2019-04-18 15:06:09 -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
Matthias Clasen
2bf1561b48 Port widgets to the root focus API 2019-03-16 21:24:44 -04:00
Matthias Clasen
ef5108c89f label: Stop using ::hierarchy-changed
Use the new root and unroot vfuncs instead.
2019-02-23 09:43:57 -05:00
Timm Bäder
d54cccfdd5 label: Use pango_layout_get_log_attrs_readonly
No need to memdup the log attrs in this case.
2019-01-29 05:03:26 +01:00
Timm Bäder
5680393f9d label: Add missing nullable annotation 2019-01-13 08:23:25 +01:00
Timm Bäder
563b80d434 label: Skip updating link state if we have no layout
This can happen whenever the ::activate-link handler sets different
markup on the label, causing all links to be recreated. In this case,
the GtkLabelLink* passed to emit_activate_link is garbage after the
g_signal_emit call and we shouldn't try to do anything with it.

Fixes #1498
2019-01-11 17:46:12 +01: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
Matthias Clasen
b94c3166bf dnd: Rename gtk_drag_begin_with_coordinates
Now that the coordiate-less variant is gone,
rename this back to the shorter gtk_drag_begin.
2018-07-12 13:02:42 +02:00
Matthias Clasen
7733f646d6 gdk: Rename GdkDragContext to GdkDrag
This is to go along with the newly introduced GdkDrop.

This commit includes the necessary updates to the X11, Wayland
and Broadway backends. Other backends have to be updated separately.
2018-07-02 14:59:26 +02:00
Matthias Clasen
8755d884f3 Remove a lot of Since annotations
4.0 will represent a clean epoch. We don't want to have
lots of noise in the docs about 2.x or 3.x.
2018-06-25 19:55:04 -04:00
Benjamin Otte
9a91d3739d widget: Remove time argument from drag_data_get() vfunc 2018-06-18 23:49:53 +02:00
Mohammed Sadiq
8410d87eb5 label: Rearrange struct members
Rearranging so can save us 8 bytes per GtkLabel
on 32/64 bit aligned memory.
Not a big count, but we get it for free.
2018-05-11 16:10:03 +05:30
Benjamin Otte
4f3058f195 eventcontrollermotion: Port to new API model 2018-04-26 17:59:42 +02:00
Benjamin Otte
1e6eb1f8b9 draggesture: Port to new API model 2018-04-26 17:59:42 +02:00
Benjamin Otte
4ddc94b293 multipressgesture: Port to new API model 2018-04-26 17:59:42 +02:00
Benjamin Otte
73b4a62f51 snapshot: Redo debug messages
Instead of every snapshot function having debug messages, have an
explicit gtk_snapshot_push_debug() function that appends a debug node.
2018-04-24 04:06:58 +02:00
Benjamin Otte
169203951b widget: Remove clip from size-allocate vfunc
As the clip is no longer needed, get rid of it.
2018-04-05 14:56:38 +02:00
Benjamin Otte
60719bb67c textutil: Make gtk_text_util_create_drag_icon() return a paintable 2018-03-26 18:16:36 +02:00
Alexander Larsson
63e060a21d GtkWidget: Start renaming widget->window
This is an automated change doing these command:

git sed -f g gtk_widget_set_has_window gtk_widget_set_has_surface
git sed -f g gtk_widget_get_has_window gtk_widget_get_has_surface
git sed -f g gtk_widget_set_parent_window gtk_widget_set_parent_surface
git sed -f g gtk_widget_get_parent_window gtk_widget_get_parent_surface
git sed -f g gtk_widget_set_window gtk_widget_set_surface
git sed -f g gtk_widget_get_window gtk_widget_get_surface
git sed -f g gtk_widget_register_window gtk_widget_register_surface
git sed -f g gtk_widget_unregister_window gtk_widget_unregister_surface

git checkout NEWS*
2018-03-20 15:21:12 +01:00
Timm Bäder
6cfb720ab7 Fix a few get_allocated_width/height usages 2018-03-17 12:09:30 +01:00
Timm Bäder
81a7f8e00c label: Remove dead NULL check
We only create the gesture when priv->select_info is !NULL.
2018-03-13 23:43:29 +01:00
Timm Bäder
891c37a4cb label: Simplify ensure_layout()
use an early return for an already existing layout.
2018-03-04 19:12:04 +01:00
Benjamin Otte
f08bc40fbb a11y: Don't include gtk.h
Also add missing includes and sort them for all the widgets that relied
on that before.
2018-02-08 15:25:53 +01:00
Matthias Clasen
4c150d8eb5 The big versioning cleanup
Remove all the old 2.x and 3.x version annotations.
GTK+ 4 is a new start, and from the perspective of a
GTK+ 4 developer all these APIs have been around since
the beginning.
2018-02-06 01:16:32 -05:00
Timm Bäder
12be5ccbb7 label: Update layout width directly form allocation
For the one update_layout_width call in size_allocate, we can just use
the passed-in allocation width instead of a separate (relatively slow)
gtk_widget_get_width call.
2018-01-17 21:57:19 +01:00
Matthias Clasen
36e09f3ad9 label: Properly handle multi-line selections
They were rendered as a single rectangle, which is not
what is expected. Same for multi-line links.
2018-01-05 15:54:49 -05:00
Matthias Clasen
98da7730ea label: Plug a memory leak
We were sometimes leaking the content serializer object.
2018-01-04 22:24:43 -05:00
Matthias Clasen
06ad134876 Add an unrealize function to GtkLabel
We need to drpo the primary clipboard when the label
is getting unrealized while holding it. This fixes
a crash in the accessibility-dump test.
2017-12-26 23:33:39 -05:00
Matthias Clasen
e92c0e85ec Replace gdk_keymap_get_for_display by gdk_display_get_keymap
Replace all uses of the old function by the new one.
No functional change.
2017-12-15 07:44:58 -05:00
Matthias Clasen
ecdf8c64fe label: Use GtkEventControllerMotion
This lets us avoid legacy event signals here.
2017-12-12 09:42:05 -05:00
Benjamin Otte
04ac4c66ae dnd: Pass device, not event
You don't start a dnd operation with a device, you start it with an
event.
2017-12-12 00:31:49 +01:00
Benjamin Otte
756b276070 dnd: Remove button argument from drag_begin()
It was unused.
2017-12-12 00:29:51 +01:00
Matthias Clasen
072f06abf7 Fix fallout from g_object_ref change
g_object_ref now returns the type of the object that was
passed. Introduce cast as necessary to avoid warnings due
to this.
2017-12-08 17:48:47 -05:00
Timm Bäder
93df23d962 Remove some more gtk_widget_get_content_size uses 2017-12-04 12:42:52 +01:00
Benjamin Otte
5632d0eabb label: Port to new clipboard 2017-12-03 05:46:48 +01:00