Commit Graph

1057 Commits

Author SHA1 Message Date
Robert Ancell
2b6162116d Fix docstring errors with drag and drop code 2020-01-13 12:30:17 +13:00
Matthias Clasen
e09f2b8b56 entry: Use gdk_drag_begin
Use gdk_drag_begin 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
f3be49838f Move code over
Move remaining code from gtkdnd.c to gtkdragdest.c
and nuke gtkdnd.c and gtkdndprivate.h.
2020-01-08 18:48:21 -05:00
Matthias Clasen
1e000c3dac Remove gtkdnd.h 2020-01-08 18:48:20 -05:00
Matthias Clasen
337057eb35 entry: Port icon dnd to GtkDragSource
This requires a small change in the api,
since we need to provide a GdkContentProvider now.
2020-01-08 18:48:19 -05: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
Timm Bäder
11a38dd455 entry: Remove unused function 2019-10-22 09:37:08 +02:00
Benjamin Otte
bab7f56f64 entry: Return boolean from gtk_entry_grab_focus_without_selecting()
This follows recent changes to gtk_widget_grab_focus().
2019-10-16 22:08:53 +02: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
Matthias Clasen
222e05c2d2 Remove unused includes
Don't include gtkmenu.h in places where
it isn't used anymore.
2019-09-16 07:23:17 -04:00
Rico Tzschichholz
97231ca231 gtk: Fix some g-i annotation warnings 2019-09-15 17:57:28 +02:00
Timm Bäder
b658a1a8e3 entry: Measure icons again
This was previously removed because it changes the minimum and natural
size of the entry when the icons are shown/hidden at runtime. Just not
measuring them does not work however, so reintroduce this.
2019-07-21 09:58:08 +02:00
Matthias Clasen
72d306c132 entry: Remove hacky code
We can leave it up to apps to not set less-than-useful
combinations, such as show-emoji-icon, but a no-emoji
input hint.
2019-06-15 21:40:50 -04:00
Matthias Clasen
1b21d6ecba password entry: Adapt to new context menu api 2019-06-13 11:59:50 +00:00
Matthias Clasen
a28d5d1888 text, entry: Implement context menu api
Drop the ::populate-popup signal and implement
the new context menu api.
2019-06-13 11:59:50 +00:00
Christian Hergert
bd26cce812 gtk: rely on default marshallers
Similar to previous removals of g_cclosure_marshal_VOID__VOID we can remove
other marshallers for which are a simple G_TYPE_NONE with single parameter.
In those cases, GLib will setup both a c_marshaller and va_marshaller for
us. Before this commit, we would not get a va_marshaller because the
c_marshaller is set.

Related to GNOME/Initiatives#10
2019-05-30 20:56:50 -07: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
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
4cab6ae61a entry: Allocate popovers 2019-05-28 20:25:15 +00:00
Matthias Clasen
4bf4f04d1f Adapt to new popover lifecycle
We need to unparent popovers in dispose.
2019-05-28 20:25:13 +00:00
Matthias Clasen
ff115472e3 entry: Use standard padding 2019-05-27 03:03:47 +00:00
Matthias Clasen
44b0a893fc entry: Drop our own Emoji chooser
We were using one Emoji chooser when triggered
via the context menu, and another one when
triggered via the icon.

Change things to always use the same Emoji
chooser instance.
2019-05-04 18:54:37 +00:00
Matthias Clasen
b2a23a9a90 entry: only notify properties we have
GtkText now has the propagate-text-width property,
which is not present on GtkEntry, so we can't just
blindly forward all properties.
2019-05-01 04:41:28 +00:00
Matthias Clasen
218d635ca2 entry: Activate default via action
Switch to the new way of activating default.
2019-04-28 23:20:13 +00:00
Timm Bäder
59fd48cee0 entry: Fix primary icon allocation in RTL entries
The primary icon is on the right in RTL, so don't offset the text child
to the right for it.
Fixes the text and icon overlapping in the second entry
in tests/testentryicons
2019-04-28 08:36:36 +02:00
Timm Bäder
ddd044f283 entry: Remove some unused constants 2019-04-13 06:18:43 +02:00
Matthias Clasen
ef982b7d46 Rename things
Rename the can-pick property to can-target,
and redo the pick flags with more descriptive names.
2019-04-08 08:42:25 -04:00
Matthias Clasen
56df49971a entry: Disconnect text signals in dispose
This was showing up as crashes when closing
the file chooser.
2019-03-21 19:15:55 -04:00
Matthias Clasen
c3f43cf1f2 entry: Make progress bar not pickable
There is no need for that, we don't want to
handle input here at all.
2019-03-14 19:15:31 -04:00
Timm Bäder
39fbf13fcb entry: Update CSS node docs
Remove all the nodes that are subnodes of GtkText nowadays and refer to
the GtkText docs instead.
2019-03-06 09:03:17 +01:00
Matthias Clasen
02318dbda7 entries: Fix mnemonic activation
Since entries are no longer can-focus, the default
mnemonic_activate handler refuses to act on them.
2019-03-03 22:25:52 -05:00
Matthias Clasen
9e0c471b03 entry, spin button: Drop redundant API
Avoid duplicating GtkEditable APIs. Port existing users.
2019-02-28 16:34:00 -05:00
Matthias Clasen
5caf8ca76b entry: Don't use the buffer directly
We want to be a wrapper of the GtkText, which in turn
wraps the GtkEntryBuffer. Not some weird mix.
2019-02-28 00:36:44 -05:00
Matthias Clasen
9335cde8e8 entry: Make placeholder-text work again 2019-02-25 09:21:56 -05: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
Matthias Clasen
45fb1d06e3 entry: Delegate to GtkText
Use a GtkText child, and delegate the editable functionality
to it. Also forward all the properties that are provided by
GtkText.

Some of the more internal APIs, such as layout and im context
access and caps-lock warning, are removed here, but we preserve
most of the plain GtkEntry API by forwarding it to the GtkText
child.
2019-02-19 00:25:59 -05:00
Matthias Clasen
32795963c0 entry: Implement new editable iface 2019-02-17 23:07:18 -05:00
Emmanuele Bassi
25fd230327 gtk: Drop the "plus"
Source names should use "[gtk]" without the plus.
2019-02-05 11:26:20 +01:00
Matthias Clasen
99c5a3d72c gtk: Stop using deprecated pango api 2019-02-04 18:28:31 -05:00
Carlos Garnacho
a15325ef44 gtkentry: Fix text handle coordinates calculation
The text allocation is already in widget-local coordinates, involving the
GtkAllocation here is not right.
2019-01-29 12:00:07 +01:00
Benjamin Otte
359bc7695c build: Reintroduce warning flags from autotools
Some of the flags got lost in the meson transition or were demoted from
error flags to warning flags.
This commit reintroduces them.

It also includes fixes for the code that had warnings with those flags.
The big one being -Wshadow.
2019-01-22 04:33:12 +01:00
Timm Bäder
7843da1f2b entry: Use pango_layout_get_log_attrs_readonly
Since we're not modifying anything...
2019-01-18 19:43:53 +01:00
Timm Bäder
7aad0896a7 entry: Use a label as placeholder
This gives us a better way of choosing the color of the placeholder text
(and enabled general css styling on it of course).

Closes #378 (If you want to keep the placeholder on focused and empty
entries, just don't set the placeholder opacity to 0 in
entry:focus>placeholder. This is the default behavior but this commit
includes a rule in Adwaita to hide it.
2019-01-18 19:43:53 +01:00
Timm Bäder
7c72712b0f entry: Trivial indentation fix 2019-01-18 19:43:52 +01:00
Timm Bäder
135cf16969 entry: Remove _gtk_entry_grab_focus
We have API for both the select and !select behavior these days, so use
that one.

Fixes #1457
2019-01-16 19:18:13 +01:00
Timm Bäder
3d6bdb9af3 entry: Remove unused struct 2019-01-03 08:52:08 +01:00
Timm Bäder
08a07d4ae5 entry: Shorten finalize implementation
By using g_clear_pointer and g_clear_object where appropriate.
2018-11-20 12:45:18 +01:00
Timm Bäder
359d874ddb Use g_clear_pointer to unparent widgets 2018-11-13 20:53:14 +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