Commit Graph

56206 Commits

Author SHA1 Message Date
Emmanuele Bassi
215903c4f1 Merge branch 'get-timings-transfer' into 'master'
g-i: Add transfer none annotations for frame clock timings getters

See merge request GNOME/gtk!511
2019-01-16 23:43:14 +00:00
Tomasz Miąsko
16867d8abf g-i: Add transfer none annotations for frame clock timings getters 2019-01-17 00:01:38 +01: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
Daniel Mustieles
a93f984b16 Updated Spanish translation 2019-01-16 09:54:54 +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
Carmen Bianca BAKKER
c7af3e61e2 Update Esperanto translation 2019-01-14 21:16:22 +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
59bf76dce1 gl renderer: Force blur shadow node children offscreen
This broke the overlay blur demoe when resizing the window to a size
that would completely move the image below a button, causing the
GtkSnapshot code to remove the clip node below the blur node.
2019-01-13 08:41:37 +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
c6da0c9a7a demo: Fix tranparency overlay demo
We'd like the rose picture to be bigger than 16×16. Also remove the
scrolledwindow since the GtkPicture now automatically scales down the
rose image. This also fixes the picture always being allocated at y=0.
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
4dc8ab58a3 testoverlay: Re-enable blurring
Accidentally disabled in 8b14c8d0a8
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
Piotr Drąg
aadcec3d1e Update Polish translation 2019-01-12 13:19:35 +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
Emmanuele Bassi
ba9b0c6f7d Use the IEC power symbols for GtkSwitch labels
Unicode 9.0 introduced glyps for the "on" and "off" power states, in the
form of:

 - U+23FD POWER ON SYMBOL, or ⏽
 - U+2B58 HEAVY CIRCLE, or ⭘

With `HEAVY CIRCLE` as "power off symbol" selected to avoid adding yet
another circle to the standard.

Since we moved GtkSwitch to always show glyphs instead of (translatable)
strings, asking the localisation teams to either come up with a suitable
short string to replace the English "ON" and "OFF", or to fall back to
Unicode glyphs, we should ensure we're using the appropriate symbols to
begin with.

See also: gtk!503 for the corresponding gtk-3-24 change.
2019-01-11 15:25:30 +00:00
Timm Bäder
3ce3de98da Merge branch 'wip/muktupavels/listbox-master' into 'master'
listbox: set selected_row before emitting signal

See merge request GNOME/gtk!502
2019-01-11 11:38:27 +00:00
Alberts Muktupāvels
1cd934e105 listbox: set selected_row before emitting signal
Signal emittion was added in 6f857f87dc commit and it seems that
this is only place where selected_row is set after emitting signal.

Because of this gtk_list_box_get_selected_row currently returns NULL
as selected row if selection mode is set to GTK_SELECTION_BROWSE.
2019-01-11 13:19:28 +02:00
Timm Bäder
dc1d3824a2 Merge branch 'wip/dboles/EventControllerKey-docs-4' into 'master'
EventControllerKey: Add missing documentation bits

See merge request GNOME/gtk!454
2019-01-11 09:39:25 +00:00
Matthias Clasen
927e49ed86 switch: Always use I/O
This allows for smaller switches, and goes better with
modern themes that have round switches.
2019-01-10 17:21:48 -05:00
Timm Bäder
d55fc8b7b1 gl renderer: Dont't try to draw glyphs at scale 0
Fixes #1475
2019-01-10 17:14:48 +01:00
Timm Bäder
e72d0a9118 gl glyphcache: Only support one dirty glyph per atlas 2019-01-10 16:49:19 +01:00
Timm Bäder
8b14c8d0a8 testoverlay: Fix fancy effect 2019-01-10 16:49:19 +01:00
Timm Bäder
913b4fcc49 iconcache: Remove unused defines 2019-01-10 16:49:19 +01:00
Timm Bäder
fb7d033953 gl renderer: Remove debug code 2019-01-10 16:49:19 +01:00
Timm Bäder
cfa440bbae gl renderer: Fix hidpi transform nodes 2019-01-10 16:49:19 +01:00
Timm Bäder
7ac9fe3b60 shadowvalue: Remove unused API 2019-01-10 16:49:19 +01:00
Timm Bäder
b0a8b7da63 gl renderer: Only compile the vertex shader once
All our programs use the same vertex shader, so don't compile it over
and over again. This improves startup times by at least 0.001%, I swear.
2019-01-10 16:49:19 +01:00
Timm Bäder
b2ff6e91cd gl renderer: Don't forget the offset when rendering blur nodes 2019-01-10 16:49:19 +01:00
Daniel Mustieles
b4d906c464 Update Spanish translation 2019-01-10 08:50:55 +00:00
Timm Bäder
ae03caacc4 Merge branch 'patch-1' into 'master'
Fix a typo in “popup-context-menu” documentation.

See merge request GNOME/gtk!500
2019-01-10 06:23:09 +00:00