Commit Graph

36429 Commits

Author SHA1 Message Date
Matthias Clasen
83682d919f treeview: Don't react to clicks on cell editables
We need to let these pass through, otherwise we
interfere with the entries that are used for editing.

Fixes: #3008
2020-08-03 07:51:09 -04:00
Matthias Clasen
348a38a876 textview: Make insert-emoji replace the selection
This is the expected behavior, and matches what
GtkText does.

Fixes: #2996
2020-08-02 20:48:14 -04:00
Matthias Clasen
0d98bab82b Merge branch 'filechooser-completions' into 'master'
filechooser: Prevent over-eager completions

Closes #2995

See merge request GNOME/gtk!2347
2020-08-03 00:23:28 +00:00
Matthias Clasen
992c5fade7 Merge branch 'wip/chergert/gtk4-textview-fix-selections' into 'master'
textlinedisplaycache: short-circuit y_range invalidation

Closes #2975

See merge request GNOME/gtk!2348
2020-08-03 00:23:13 +00:00
Christian Hergert
94d17a6809 textlinedisplaycache: short-circuit y_range invalidation
If we have a y==-1 then we are generally invalidating the whole textview.
For this case, we can just discard the entire GtkTextLineDisplay cache.

Fixes #2975
2020-08-02 16:35:50 -07:00
Matthias Clasen
9605e49fbf filechooser: Prevent over-eager completions
We don't want the completions to pop up after we call
gtk_file_chooser_set_current_name(). This used to be
handled by gtk_entry_set_text() blocking the completion
signal handler. We don't have that anymore, so block
popup completion around the call to gtk_editable_set_text()
instead.

Fixes: #2995
2020-08-02 19:18:11 -04:00
Matthias Clasen
71be1751c6 builder-tool: Rewrite top/left-attach
Rewrite the GtkGrid:top/left-attach child properties
to the GtkGridLayoutChild:row/column layout properties.

Update expected test output to match.
2020-08-02 17:58:03 -04:00
Matthias Clasen
ed13e6a41e grid layout: Rename some properties
Rename GtkGridLayoutChild:left-attach/top-attach to
GtkGridLayoutChild:column/row. Update all users.

Fixes: #2967
2020-08-02 17:58:03 -04:00
Matthias Clasen
4340f75304 textbuffer: Fix a test failure
The previous change to gtktextbuffer.c was breaking
the textiter testcase.
2020-08-02 17:23:26 -04:00
Matthias Clasen
0add626822 textbuffer: Be careful with tags when copying
We can only insert tags in the buffer if they come
from the same GtkTextTagTable as the buffer uses.
If that is not the case, paste the text without tags.

Fixes: #2991
2020-08-02 13:54:06 -04:00
Matthias Clasen
793ea05f4a Merge branch 'text-drag-select' into 'master'
textview: Only claim the event when appropriate

Closes #2999

See merge request GNOME/gtk!2344
2020-08-02 17:45:30 +00:00
Matthias Clasen
c959f9c701 textview: Only claim the event when appropriate
Don't claim the event unconditionally for the click gesture,
since we may want to start a drag selection.

Fixes: #2999
2020-08-02 13:32:37 -04:00
Matthias Clasen
f8a303b0e5 popovermenu: Avoid a critical
While we guarantee that the widget that a controller
is attached to stays around while it is handling an event,
the same is not true for the root that the widget belongs
to. In corner cases (such as clicking "Close" in the
fallback window menu), it may already be gone.
Avoid a critical in that case.

Fixes: #2998
2020-08-02 13:09:00 -04:00
Matthias Clasen
ddda963f81 Merge branch 'selectable-label-draw' into 'master'
label: Redraw when focus changes

See merge request GNOME/gtk!2342
2020-08-02 16:40:12 +00:00
Matthias Clasen
9bf50e5650 Merge branch 'linked-button-fixes' into 'master'
Adwaita: Add linked styling for particular button widgets

Closes #2939 and #1903

See merge request GNOME/gtk!2339
2020-08-02 16:39:59 +00:00
Matthias Clasen
1c8471c38f label: Redraw when focus changes
When focus changes in a selectable label, we need to
redraw to make the text caret (dis)appear.
2020-08-02 12:11:38 -04:00
Matthias Clasen
17208ca7fa Go back to keeping a list of event controllers
This reverts 4b9e5304cc. It caused a number of regressions,
such as event controller ordering changes.
2020-08-02 12:01:06 -04:00
Matthias Clasen
1c16cb751f Revert "Add gtk_widget_prepend_controller"
This reverts commit 692cc42e10.
2020-08-02 12:01:06 -04:00
Matthias Clasen
127612d213 Revert "entry completion: Make keynav work again"
This reverts commit 53a30eaa12.
2020-08-02 12:01:06 -04:00
Matthias Clasen
888a65c1fb shortcutswindow: Clear search entry on unmap
Otherwise, the search term will linger around until
somebody clicks the search button again.

Fixes: #2981
2020-08-02 09:33:52 -04:00
nana-4
891027f0c3 Adwaita: Add linked styling for particular button widgets
Those button widgets need some special linked styling like what
combobox has.

Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/1903
Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/2939
2020-08-02 19:14:26 +09:00
nana-4
5f00675de4 appchooserbutton: Set a CSS name
Otherwise it has a CSS name "widget".
2020-08-02 18:26:40 +09:00
Matthias Clasen
d17e51df06 Merge branch 'inspector-device-details' into 'master'
inspector: Introspect enum values

See merge request GNOME/gtk!2338
2020-08-02 03:25:33 +00:00
Matthias Clasen
0d608c492d inspector: Introspect enum values
Stop hardcoding arrays with names for enum values.
This has bitten us repeatedly as these enums were
changed around; time to stop doing it.
2020-08-01 23:05:24 -04:00
Matthias Clasen
e0c7d7daeb menusectionbox: Avoid a critical warning
The popover may already be gone when the item
is activated. Don't trigger a critical in that
case.

Related: #2986
2020-08-01 22:03:41 -04:00
Matthias Clasen
64ed69c56f label: Be more selective when selecting on focus-in
We don't want to select on focus-in when the focus
comes from a child. The case where this does harm
is when you activate copy or paste actions from the
context menu. We close the menu before triggering the
action, and if that causes the text in the label to
be selected, unexpected things happen, since the action
applies to the current selection.

This is the equivalent of cd9f5733b3 for GtkLabel.
2020-08-01 22:01:52 -04:00
Matthias Clasen
74662776d4 togglebutton: Don't crash on click
The code used to do
if (parent_class->clicked)
  parent_class->clicked (...)
That is pointless because the parent_class never changes,
so there' no need for that if and commit 415946eb0f
took it out. Unfortunately, p arent_class->clicked is NULL
though, so the whole call needs to go.
2020-08-01 20:09:05 -04:00
Timm Bäder
41b458fba7 Fix and improve various code samples 2020-08-01 20:01:04 +02:00
Timm Bäder
f716daa483 aboutdialog: Fix a code sample
gdk_texture_new_from_file takes a GFile these days.
2020-08-01 19:30:31 +02:00
Timm Bäder
415946eb0f togglebutton: Modernice source file
Make this a little less ancient looking.
2020-08-01 19:24:54 +02:00
Timm Bäder
65b79d2585 Avoid refering to old GtkContainer API in the docs 2020-08-01 15:34:59 +02:00
Timm Bäder
e976825342 button: Use g_object_notify_by_pspec() 2020-08-01 15:34:07 +02:00
Timm Bäder
b489a1f6b5 stack: Allow NULL names
Does this work?
2020-08-01 15:27:13 +02:00
Timm Bäder
2f65459fcc stack: Only compare page names if the new page has one 2020-08-01 15:26:53 +02:00
Timm Bäder
f5af18738b listbox: Add _append
To have easy replacement API for gtk_container_add.
2020-08-01 15:26:28 +02:00
Timm Bäder
b37b85333d adwaita: Reset popover background in backdrop
Otherwise it inherits the generic background color from .background

Fixes #2766
2020-08-01 10:34:04 +02:00
Timm Bäder
76f2396764 popover: Use gtk_widget_add_css_class 2020-08-01 10:31:38 +02:00
Timm Bäder
547842e7f0 window: Keep titlebar after main child
Fixes #2949
2020-08-01 09:30:48 +02:00
Timm Bäder
ebaea07286 inspector: Avoid some failing casts
We might be inspecting a non-widget here, so can't just cast that.
2020-08-01 08:59:46 +02:00
Timm Bäder
0822de1971 textview: Only show "insert emoji" menu item if editable
Fixes #2974
2020-08-01 08:59:46 +02:00
Timm Bäder
bf24da0d80 inspector: Add a type check
We only connect to this signal if sl->obejct is a GtkAccessible, so only
disconnect from it on the same condition.

Fixes #2980
2020-08-01 08:59:41 +02:00
Rico Tzschichholz
d1cab4fbdd gtk: Add annotations to improve GIR API 2020-07-31 20:56:36 +02:00
Matthias Clasen
fc31f3d629 placesview: Keep up with GLib deprecations
We were using deprecated GBookmarkFile api here too.
2020-07-31 12:54:57 -04:00
Matthias Clasen
72e14bd6dd recentmanager: Keep up with GLib deprecations
All the time_t based apis in GBookmarkFile have
been deprecated; use GDateTime instead. This
changes a few GtkRecentManager APIs.
2020-07-31 12:18:47 -04:00
Matthias Clasen
99bb8bb3f7 numericsorter: Ignore deprecations
We use g_value_get_char here; replacing it with
g_value_get_schar is not entirely trivial, so just
ignore deprecations for now.
2020-07-31 11:36:03 -04:00
Matthias Clasen
ff42c94174 gtkicontheme: Stop using GTimeVal
It has been deprecated and the deprecation warnings
break our -Werror build in ci.
2020-07-31 11:22:16 -04:00
Matthias Clasen
8c66e2ff66 widget: Drop unnecessary includes
We don't need to include gobjectnotifyqueue.c anymore,
since style properties are gone. This should fix the
build with -Werror.
2020-07-31 10:34:37 -04:00
Matthias Clasen
62803c19f5 Merge branch 'focus-active' into 'master'
Focus active

Closes #2390

See merge request GNOME/gtk!2324
2020-07-30 17:50:54 +00:00
Matthias Clasen
643d873f47 eventcontrollerkey: Update im focus when active window changes
Use the new GTK_CROSSING_ACTIVE crossing events to update
the im context focus when the window becomes active or
inactive. IBus requires this, since it has only a single,
global focus location.

Fixes: #2390
2020-07-30 13:23:45 -04:00
Matthias Clasen
b0d40403e1 window: Emit GTK_CROSSING_ACTIVE crossing events
Emit crossing events when the active window changes.
We don't want to emit GTK_CROSSING_FOCUS events, since
every window has its own focus location (focus does not
jump from window to window), so we use the new
GTK_CROSSING_ACTIVE type of crossing event for this.
2020-07-30 13:22:26 -04:00