Commit Graph

56229 Commits

Author SHA1 Message Date
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
5c81cc2f36 GdkEvent: Make gdk_event_set_user_data private 2019-01-18 19:43:48 +01:00
Timm Bäder
01e985a830 GdkEvent: Remove unused struct 2019-01-18 19:43:48 +01:00
Timm Bäder
b2eff300b1 GdkEvent: Add a proper user_data member to GdkEventAny
Setting it as qdata on the object doesn't save any memory since we use
the user_data as the event target, which every event has set these days.
This way is also faster since just reffing the object doesn't do any
locking.
2019-01-18 19:43:48 +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
Timm Bäder
e14fe222e8 gl renderer: Don't add clip ops if the clip didn't change 2019-01-18 19:40:49 +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
Emmanuele Bassi
a5fcdca935 docs: Point people at the right place for bugs
We don't use Bugzilla for GTK any more, so our documentation should
reflect that change.

Closes #1559
2019-01-18 14:34:10 +00:00
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