Commit Graph

731 Commits

Author SHA1 Message Date
Benjamin Otte
83dc9dabed label: Port bindings to use shortcuts 2020-03-18 23:00:50 -04:00
Matthias Clasen
a43d13aa74 popover: Drop ::relative-to
It is enough to just set the parent (and make the parent
call gtk_native_check_resize in size_allocate).

This commit removes the relative_to argument to the
constructors of GtkPopover and GtkPopoverMenu, and
updates all callers.
2020-02-24 20:46:41 -05: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
e3158a1bfb Make crossing events handled the same way 2020-02-21 00:50:59 -05:00
Matthias Clasen
e3afb2fec8 label: Don't use gtk_widget_peek_style_context
We may just not have a style context. And we can just
as well go directly to the css styles.
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
546a748cd8 widget: Replace style-updated signal with css_changed vfunc
1. Rename the thing
2. Turn it from a signal to a vfunc
3. Pass the GtkCssStyleChange to it

We don't export any public API about the GtkCssStyleChange yet, it's
just a boring opaque struct.
2020-02-05 02:46:13 +01: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
Timm Bäder
45455f1bdb Remove GtkCssShadowsValue
Previously, we wrapped all GtkCssShadowValues in a GtkCssShadowsValue,
even if it was just one shadow. This causes an unnecessary bloat in
css values.

Make each GtkCssShadowValue able to handle multiple shadows instead, and
use gtk_css_shadow_value* API everywhere.
2020-01-18 08:49:52 +01:00
Matthias Clasen
5a6ab8cbd3 label: Use gdk_drag_begin
Use gdk_drag_begin directly for one-off drags.
2020-01-08 18:48:21 -05:00
Matthias Clasen
e8b830a3dd dragsource: Reshuffle api a bit
Remove arguments from the constructor.

For actions, we now default to COPY, which is the most common one
that we should enable by default (MOVE requires handling deletion
on the the source side, and ASK only makes sense if we have
multiple actions).

For the content provider, we add a new ::prepare signal where
it should be provided just-in-time.
2020-01-08 18:48:21 -05:00
Matthias Clasen
1e000c3dac Remove gtkdnd.h 2020-01-08 18:48:20 -05:00
Matthias Clasen
2612331282 label: Port to GtkDragSource 2020-01-08 18:48:19 -05:00
Timm Bäder
73b8212bf3 label: Fix assumptions regaring link 2020-01-07 17:27:18 +01:00
Matthias Clasen
7ee5779efc gtk: Remove menu code
GtkMenu, GtkMenuBar, GtkMenuItem and their subclasses
and supporting classes are replaced by model-based popover
implementations.
2019-12-29 20:31:58 -05:00
Matthias Clasen
0854140b22 label: Stop referring to GtkMenuItem in the docs 2019-12-29 20:31:58 -05:00
Matthias Clasen
9e15f3df75 label: Remove menu support code 2019-12-29 20:31:58 -05:00
Benjamin Otte
503d988c1b label: Compute label baselines correctly
When we were switching smallest and widest, we were not switching the
baselines.
2019-12-09 16:35:41 +01:00
Matthias Clasen
828b58247c label: Handle new pango attributes
overline and overline-color were introduced in Pango 1.45.
2019-11-01 13:01:54 -04:00
Matthias Clasen
de29c3e193 label: Handle insert_hyphens pango attribute
This was introduced in Pango 1.44.4.
2019-11-01 13:01:54 -04:00
Benjamin Otte
427deb4f13 widget: Make gtk_widget_grab_focus() return a boolean
So now it can actually fail.

It doesn't yet though.
2019-10-15 16:33:05 +02:00
Timm Bäder
a3cef6c05e label: Use TRUE/FALSE instead of 1/0 2019-10-09 16:57:22 +02:00
Timm Bäder
703fda3be8 label: Remove set_selectable_hint
It's just updating the cursor, so do it via update_cursor()
2019-10-09 16:57:21 +02:00
Timm Bäder
2f6d6f2473 label: Remove gtk_label_realize
We don't need this to update the cursor anymore.
2019-10-09 16:57:21 +02:00
Timm Bäder
3f3c8436c5 label: Don't update cursor after unsetting select_info
update_cursor() doesn't do anything in the priv->select_info == NULL
case.
2019-10-09 16:57:21 +02:00
Timm Bäder
d8b0a78c1e label: Change cursor even if unrealized
Cursor don't depend on that anymore.
2019-10-09 16:57:20 +02:00
Alexander Larsson
96b37f4eb8 Use the new GtkBuildableParser type in GtkBuildable interfaces 2019-09-10 12:08:20 -04:00
Timm Bäder
4cc4868e93 label: Remove "line" from wrap properties
The property names are "wrap" and "wrap-mode", so it doesn't make sense
that the accessors refer to line_wrap and line_wrap_mode.
2019-09-09 17:36:23 +02:00
Дилян Палаузов
6ded38de2b Minor typos in the Documentation (a/an) 2019-08-25 12:52:46 +00:00
Matthias Clasen
988fac404a Add pango version checks
Seems the ci does not have pango 1.44 yet.
2019-07-28 10:50:14 -04:00
Matthias Clasen
f1c7803f80 label: Parse new pango attributes
Support allow-breaks and show attributes.
These will be in pango 1.44
2019-07-27 00:02:08 -04:00
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