Commit Graph

31261 Commits

Author SHA1 Message Date
Benjamin Otte
5e00cdbd74 rbtree: Add a trivial way to add rbtree tests to the testsuite.
The format of the printout will be suitable for addition as a new test to
  testsuite/gtk/rbtree-crash.c
by just grepping the printouts from the relevant rbtree.
2019-01-20 06:09:40 +01:00
Matthias Clasen
9baef5e101 Merge branch 'reference-include' into 'master'
Specify the C include for Unix printing API

See merge request GNOME/gtk!516
2019-01-19 01:13:42 +00:00
Michael Catanzaro
c7af14dea8 filechoosernativeportal: stuff the current filter into options
We need to tell the portal what filter is supposed to be selected by
default, or it will just pick the first one, which could be wrong and
annoying.

This will require updated xdg-desktop-portal and xdg-desktop-portal-gtk
to work properly.

Fixes #1492
2019-01-18 20:02:11 -05:00
Michael Catanzaro
f3f22b76dc filechoosernativeportal: remove redundant casts
We are casting from GtkFileChooserNative to... GtkFileChooserNative.
Boo.
2019-01-18 20:01:52 -05:00
Michael Catanzaro
a0f750f7c9 filechoosernative: forward current_filter to delegate dialog
gtk_file_chooser_set_filter() doesn't work for GtkFileChooserNative. The
code forwards added and removed filters to the delegate dialog, but
doesn't do anything to set the selected one, so the wrong one gets
chosen. So fix that.

This only fixes the fallback dialog. The portal will be fixed in a
subsequent commit.

Partial fix for #1492
2019-01-18 20:01:37 -05:00
Emmanuele Bassi
3543a54545 Specify the C include for Unix printing API
Instead of using the INCLUDE directive inside the sections file, we can
specify the default C include in the gtkdoc-mkdb arguments, and override
it inside the C sources that need it.
2019-01-19 00:00:34 +00:00
Emmanuele Bassi
95c0f07295 Merge branch 'master' into 'master'
A11y: export gtk_cell_accessible_parent_get_(row|column)_header_cells

See merge request GNOME/gtk!505
2019-01-18 23:13:31 +00:00
Matthias Clasen
8f697d6715 Merge branch 'switch-fallback' into 'master'
Add fallback glyphs for GtkSwitch states

See merge request GNOME/gtk!509
2019-01-18 22:43:54 +00:00
Matthias Clasen
28241cecff about dialog: Use ::activate-link for license
This should behave the same as all the other links
in this dialog.

Closes: #1561
2019-01-18 17:31:56 -05: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
a25d6b1dc7 tooltip: Use gdk_rectangle_contains_point 2019-01-18 19:43:52 +01:00
Timm Bäder
c8ec0f42a0 tooltip: Move tooltips enabled checks into tooltips_enabled 2019-01-18 19:43:51 +01:00
Timm Bäder
2353e0e03f tooltip: Look at the event's target widget
Since we now have a widget whenever we query tooltips, we can as well
get the events target_widget if we have an event (which is what we do
when coming from gtkmain.c). This keeps us from searching the entire
widget hierarchy for the target event even though we've already done
that for pointing events in gtkmain.c

This reduced the work done in gtk_tooltip_handle_event in normal motion
events to basically nothing since we already did all the heavy lifting
when handling the pointing event in gtkmain.c
2019-01-18 19:43:51 +01:00
Timm Bäder
11f9ae8202 tooltip: Remove gtk_tooltip_trigger_tooltip_query
As stated by the documentation, this should be called when a widget gets
updated, but in that case, one can equally use
gtk_widget_trigger_tooltip_query.
2019-01-18 19:43:51 +01:00
Timm Bäder
0e07912231 tooltips: Remove keyboard mode tooltips
Keyboard mode was only used in gtk_widget_real_show_help before, but now
that's gone and so is any usage of keyboard mode tooltips.
2019-01-18 19:43:50 +01:00
Timm Bäder
c49cc977fa gizmo: return void from snapshot func
This boolean return was from the old gadget code and we weren't using it
in the new gizmo code.
2019-01-18 19:43:50 +01:00
Timm Bäder
3ca688a6dd scrolledwindow: Reset indicators in unmap()
This is unrelated to any windowing resources these days, so no need for
an unrealize handler.
2019-01-18 19:43:49 +01:00
Timm Bäder
fae6113ce3 filechooserwidget: Show spinner when searching
This was lost it seems
2019-01-18 19:43:49 +01:00
Timm Bäder
dbc8d253c3 scrolledwindow: Fix a event widget/event target mixup 2019-01-18 19:43:47 +01:00
Timm Bäder
0f6e15cfa2 scrolledwindow: remove unused struct 2019-01-18 19:43:46 +01:00
Timm Bäder
ea2f66226a iconview: Fix scrolled drawing
We were only drawing the scrolled away first few items
2019-01-18 19:41:19 +01:00
Emmanuele Bassi
58d9c3d5bd switch: Update state labels when needed
If the text style changes, or the display settings do, we need to update
the state labels to ensure that the glyphs are available in the font
we're using.
2019-01-18 14:43:42 +00:00
Timm Bäder
9b15c6900a colorscale: Redraw correct widget after setting rgba
The entire color scale hack is still done in GtkRange, which draws the
color scale in the range gizmo. So, to correctly redraw the color scale
when setting a new color, we need to redraw the proper widget and that's
the trough widget.

Fixes #1453
2019-01-16 19:20:53 +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
374e93ef96 window: Directly find the cursor in the widget hierarchy
Instead of recording the way up from the target widget to the grab
widget (or toplevel) and then walking that path upwards, just walk the
parent chain and look at the cursor.
2019-01-16 19:01:40 +01:00
Timm Bäder
83f8056992 scrolledwindow: Remove unused drag_device member 2019-01-16 19:01:40 +01:00
Timm Bäder
cf1526cca6 snapshot: Add gtk_snapshot_from_parent
Most of the time, the GtkSnapshot objects we create while snapshotting
widgets don't end up containing all that many nodes or states in their
respective node or state stack. This undermines the amortized allocation
behavior of the G(Ptr)Array we use for the stacks. So instead, use the
(until now unused) parent_snapshot GtkSnapshot* passed to
gtk_widget_create_render_node and reuse its node and state stack.

We do not avoid allocating a new GtkSnapshot object, but we do avoid
allocating a ton of G(Ptr)Array objects and we also avoid realloc'ing
their storage.
2019-01-16 19:01:40 +01:00
Timm Bäder
c1c764255f window: Don't manually queue a draw on the new focus widget
This is either unneeded and OK to remove, or it is needed and there's a
bug somewhere else.
2019-01-16 19:01:38 +01:00
Timm Bäder
7dd54b5789 treeview: Don't get separator_height more than once
Closes !209
2019-01-16 18:58:15 +01:00
Timm Bäder
697aa95c7e treeview: cache expander size
We need to know it all the time and since we get it from CSS, doing that
is fairly expensive.
2019-01-16 18:58:15 +01:00
Emmanuele Bassi
5c50e48156 Add fallback glyphs for GtkSwitch states
Even though the IEC power glyphs are part of Unicode 9.0 (released in
2016) not all fonts have them.

To avoid showing the hexbox of doom when the system font does not have
the glyphs we'd like to use, add a fallback pair, using the old glyphs
we suggested when the labels were translatable.
2019-01-15 22:16:05 +00:00
Benjamin Otte
e104337704 rbtree: Fix removing last element
The refactoring of automatically updating tree->root when setting a
node's parent works very well - unless all nodes get removed and no
node's parent got updated.
2019-01-14 18:42:18 +01:00
Benjamin Otte
8a7706f2b5 rbtree: Make node getters not require tree argument
The tree is not needed to walk around the nodes.

It is however still needed for anything that requires modifying the
tree.

There is no immediate benefit in changing this API, but there might be
situations in the future where we can avoid looking up the tree when we
just want to check some details about the node.
2019-01-14 02:14:11 +01:00
Benjamin Otte
6a3c2a230a rbtree: Add gtk_rb_tree_node_get_tree()
Store a link to the tree in the root node. This allows looking up the
tree in O(log N) from the node without any extra memory usage.

This is useful because code can just store a pointer to the node and
doesn't need to keep the tree pointer around. And that can (for large
trees) save quite a bit of memory.
2019-01-14 02:14:11 +01:00
Benjamin Otte
a33ff4c6ab rbtree: Access node->parent only via accessors
This also adds a set_parent() function that automatically takes care of
updating tree->root for root nodes.
2019-01-14 02:14:11 +01:00
Benjamin Otte
7ff949ea30 rbtree: Remove gtk_rb_tree_find()
Searching through the tree is too specific to use a general function.
All the existing code just copies and slightly adapts the same 20 lines
instead, so there's no reason to keep the complicated API.
2019-01-14 02:14:11 +01:00
Matthias Clasen
25bca27bfe Rename GtkCssRBTree to GtkRBTree
This is a generally usable red-black tree api,
and it is not used in css at all.
2019-01-14 02:14:11 +01:00
Matthias Clasen
e269f43afc Rename GtkRBTree to GtkTreeRBTree
This frees up the generic name for a more
generic rbtree implementation.
2019-01-14 02:14:11 +01:00
Timm Bäder
44a2a49f31 overlay: Directly create cairo_region
Instead of doing a cairo_region_create + union, just pass the rect
directly to cairo_region_create_rectangle
2019-01-13 08:41:37 +01:00
Timm Bäder
69bc42f444 rendernodepaintable: Don't try to snapshot 0×0 nodes
Considering the operations that some of the rendernode constructors
do, nodes with width or height 0 (or both of course) are very well
possible. This would break in the rendernodepaintable when adding a
transform, which divides by width/height of the rendernode.
2019-01-13 08:39:05 +01:00
Timm Bäder
269535c844 overlay: Blur the clipped node, not clip the blurred node
Blurring is a lot more expensive than clipping, so try to blur less by
clipping first.
2019-01-13 08:23:25 +01:00
Timm Bäder
c7f773f3e3 overlay: Trivial indentation fix 2019-01-13 08:23:25 +01:00
Timm Bäder
d098cd5865 overlay: Don't offset the main window snapshot
We need the node without an offset applied.

Fixes the rose picture being offset in tests/testoverlay
2019-01-13 08:23:25 +01:00
Timm Bäder
5680393f9d label: Add missing nullable annotation 2019-01-13 08:23:25 +01:00
Mike Gorse
a52431d2b4 A11y: export gtk_cell_accessible_parent_get_(row|column)_header_cells
These functions were missing GDK_AVAILABLE_IN macros, so they were
listed in the gir but not exported.
2019-01-11 16:53:39 -06:00
Timm Bäder
5fd936beef spinbutton: Use increment/decrement icon names
And add list-{remove,add}-symbolic as fallback.

Fixes #1569
2019-01-11 18:29:20 +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
f4f0f0e6a0 snapshot: Get new GArray item directly
Instead of building it up ourselves, then coping it into the GArray and
then getting the last element of that array.
2019-01-11 17:02:23 +01:00