Commit Graph

36809 Commits

Author SHA1 Message Date
Emmanuele Bassi
97276a5cd4 Remove gtk-doc stanzas from private GtkBuildable API
Various functions were moved to the private GtkBuildable header by
commit 2715b3ec31, but the functions still
have gtk-doc stanzas.
2020-09-29 19:39:34 +01:00
Matthias Clasen
4a2c817690 docs: Document various entry ::activate signals 2020-09-29 07:04:07 -04:00
Matthias Clasen
aac9414117 statusbar: Remove a misleading doc comment 2020-09-29 07:04:07 -04:00
Matthias Clasen
c897daf797 snapshot: Document radial gradient apis 2020-09-29 07:04:07 -04:00
Matthias Clasen
3af249c046 Silence a compiler warning
These variables are not used anymore since
commit 11e4a46967.
2020-09-29 07:04:07 -04:00
Alexander Larsson
950cc41e15 GtkSnapshot: Add gtk_snapshot_push_glshader() 2020-09-29 09:51:16 +02:00
Alexander Larsson
7ea755e206 Add GskGLShaderNode and GskGLShader
A GskGLShader is an abstraction of a GLSL fragment shader that
can produce pixel values given inputs:
 * N (currently max 4) textures
 * Current arguments for the shader uniform
Uniform types are: float,(u)int,bool,vec234)
There is also a builder for the uniform arguments which are
passed around as immutable GBytes in the built form.

A GskGLShaderNode is a render node that renders a GskGLShader inside a
specified rectangular bounds. It renders its child nodes as textures
and passes those as texture arguments to the shader. You also pass it
a uniform arguments object.
2020-09-29 09:51:16 +02:00
Alexander Larsson
645fc6a9a5 GtkWindow: Create renderer before realizing child widgets
This way the child widgets can rely on the renderer (for example what
type it is) to decide details about how they render (such as if they
should use OpenGL shaders).
2020-09-29 09:51:16 +02:00
Matthias Clasen
a91b6b4786 css: Move the last parser api to the new header
This lets us use it from the render node parser
in gsk.
2020-09-29 09:51:16 +02:00
Matthias Clasen
e29c586b7c Merge branch 'arnaudb/menubutton-direction' into 'master'
Make GtkMenuButton::direction more useful.

Closes #2811

See merge request GNOME/gtk!2636
2020-09-29 01:55:24 +00:00
Matthias Clasen
a799c86edb textbuffer: Elaborate docs
Explain a bit more what gtk_text_buffer_get_content_provider()
is for.

Fixes: #3202
2020-09-28 20:51:13 -04:00
Matthias Clasen
68bb532290 window: Don't get surfaces needlessly
There is a 1-1 correspondence between natives and
surfaces, so we can just compare the natives, no
need to get the surface for every single one.
2020-09-28 20:51:13 -04:00
Matthias Clasen
d2f0e3fa6b doc: Document some apis as widget implementor only
A better solution for this would be nice. For the
time being, just add a sentence to the docs.
2020-09-28 20:51:13 -04:00
Arnaud Bonatti
4684082232 Make GtkMenuButton::direction more useful.
This property was only used until now when
there was neither an icon nor a label set,
for arrow direction and popover placement.

Starting with Gtk4, a GtkMenuButton with a
label shows an arrow at the right (in LTR)
of the label. Allow disabling the arrow or
changing its direction using the direction
property, to have a way to restore a Gtk3-
like look or to improve popover placement.

Fixes #2811.
2020-09-29 02:26:13 +02:00
Carlos Garnacho
11e4a46967 gtkeventcontrollerscroll: Drop device type checks
Kinetic scrolling (and begin/end tracking) broke with commit cab1dcb696
since the pointing device used on X11 does not get as much GdkInputSource
granularity as the source device used to have in GTK3.

Actually this is kinda pointless, devices incapable of smooth scroll
should send discrete events, without those devices in the picture, we
want kinetic scroll to apply on every other device capable of smooth
scroll, so just do that.

Fixes: https://gitlab.gnome.org/GNOME/gtk/-/issues/3210
2020-09-28 23:35:36 +02:00
Matthias Clasen
27b3bb59eb Merge branch 'another-attempt-to-fix-shadertoy' into 'master'
Flip GLArea textures

See merge request GNOME/gtk!2634
2020-09-28 16:16:51 +00:00
Matthias Clasen
5206cfa837 Merge branch 'wip/otte/for-master' into 'master'
snapshot: Don't flip textures

See merge request GNOME/gtk!2633
2020-09-28 15:43:02 +00:00
Matthias Clasen
b711c12bbe glarea: Flip our texture
The texture that produce is upside-down, compared to what
GSK expects, so flip things around with a transform.

This fixes the shadertoy demo being upside-down after a
recent fix to avoid downloading and reuploading the texture.
2020-09-28 11:34:23 -04:00
Benjamin Otte
651c92c0ed snapshot: Don't flip textures
... or gradients or borders or shadows. Instead, ensure that affines
have non-negative scale factors. Otherwise add a transform node.

The only place where this check is not necessary is color nodes, but
special casing them seems not worth it.
2020-09-28 16:14:28 +02:00
Matthias Clasen
536e1a1954 Merge branch 'patch-1' into 'master'
treestore: Document the fact that iter is modified by the function, in a machine-readable fashion.

See merge request GNOME/gtk!2613
2020-09-27 15:03:04 +00:00
Danny Milosavljevic
32baa0a549 Update gtktreestore.c: gtk_tree_store_remove didn't have the proper comment annotation
"inout" for the parameter ITER passed.  This means that bindings would misjudge what
the function does.  In the case of guile-gi, it would be misjudged for a predicate,
see gulie-gi bug 87.
2020-09-27 15:03:03 +00:00
Matthias Clasen
752270253f fontchooser: Fix builds without PangoFT2
Currently, only if PangoFT2 is present and used it is supported
to retrieve the languages that are supported by a particular font.

If we don't have PangoFT2, remove the language filtering and the
sample text selection.

Based on earlier work by Chun-wei Fan, see
https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/2614
2020-09-26 19:15:45 -04:00
Matthias Clasen
92e551f895 Merge branch 'BUG_gtktreeview_headers_focus_on_click_GTK4' into 'master'
GtkTreeviewColumn: don't focus-on-click header buttons

See merge request GNOME/gtk!1806
2020-09-26 22:50:23 +00:00
Florian Müllner
2715b3ec31 buildable: Make vfunc accessor functions private
With the exception of gtk_buildable_get_id(), those are only used
to construct objects from XML descriptions, which is functionality
internal to GTK.

The API is therefore unlikely to be missed, and keeping it internal
means they can no longer unintentionally shadow object methods in
bindings with less namespacing; for example it's currently ambiguous
whether `infoBar.add_child()` refers to gtk_info_bar_add_child() or
gtk_buildable_add_child().

https://gitlab.gnome.org/GNOME/gtk/-/issues/3191
2020-09-26 02:16:57 +02:00
Florian Müllner
12189bc10f buildable: Rename set_name() to set_buildable_id()
GtkBuildable's get_name()/set_name() methods may shadow
GtkWidget's methods. Avoid that by renaming the API to
get_buildable_id()/set_buildable_id(), which also reflects
the name of the XML attribute the API refers to.

https://gitlab.gnome.org/GNOME/gtk/-/issues/3191
2020-09-26 02:16:05 +02:00
Matthias Clasen
a9de1d702e Merge branch 'matthiasc/for-master' into 'master'
columnview: Simplify column constructors

See merge request GNOME/gtk!2622
2020-09-25 18:25:09 +00:00
Matthias Clasen
0c3f42e06e columnview: Simplify column constructors
Drop gtk_column_view_column_new_with_factory and
just make gtk_column_view_column_new accept a
nullable factory. This follows what we've been
doing elsewhere.

Update all callers.
2020-09-25 13:57:10 -04:00
Carlos Garnacho
d9d494826f gtkbutton: Clean up priv->in_button
This is now only toggled around, may be cleaned up.
2020-09-25 19:20:27 +02:00
Carlos Garnacho
ea6e575901 gtkbutton: Check release coordinates on all release event types
The priv->in_button state that used to be relied upon for pointer
events has been reduced over time to a broken state, since the button
does not track crossing events anymore.

Make the coordinate-based checks apply for pointer events too, besides
touch events. This fixes GtkButton mistakenly emitting ::clicked with
pointer button releases outside the widget.

Fixes: https://gitlab.gnome.org/GNOME/gtk/-/issues/3121
2020-09-25 19:20:04 +02:00
Carlos Garnacho
0ccdbfd802 gtktextview: Avoid GtkGestureClick claiming on touch press
We still want the drag gesture (and text selection) to work. Avoid claiming
the gesture early, like it's done in the pointer case.
2020-09-25 19:02:26 +02:00
Carlos Garnacho
7d5accc69f gtkscrolledwindow: Do not eagerly claim touch press event
Claiming early makes the contents unable to react to the touch press
event. Do this on GtkGestureDrag::update past a threshold, so the
child widget(s) can claim before the scrolledwindow does.

Fixes: https://gitlab.gnome.org/GNOME/gtk/-/issues/3125
2020-09-25 18:58:44 +02:00
Carlos Garnacho
b1606db839 gtkscrolledwindow: Drop gtk_scrolled_window_set_capture_button_press()
This API is kinda stuck in the GdkEvent days, we now negotiate ownership
of the input sequence via GtkGestures. Remove it as it reflects a way to
work that was not exactly accurate and it will turn plainly wrong soon.
2020-09-25 18:57:40 +02:00
Timm Bäder
09564a5798 Merge branch 'wip/baedert/for-master' into 'master'
Wip/baedert/for master

See merge request GNOME/gtk!2617
2020-09-25 13:35:20 +00:00
Matthias Clasen
e6d5a3c4e8 Merge branch 'matthiasc/for-master' into 'master'
Matthiasc/for master

Closes #3180, #3178, and #3179

See merge request GNOME/gtk!2618
2020-09-24 18:50:26 +00:00
Matthias Clasen
e70ed905d1 columview: Don't overdraw
Just always tell the title and cell widgets to
clip their children to the right size. Otherwise
we risk things getting out of sync and unintended
overdraw.

Fixes: #3179
2020-09-24 14:30:40 -04:00
Matthias Clasen
7eb0ae39c5 columview: Fix column resizing
We were not handling the fixed_width quite right,
and that was causing screaming from the GTK size
allocation machinery.

Fixes: #3178
2020-09-24 14:18:38 -04:00
Timm Bäder
2f93287473 cssimagefallback: Whitespace 2020-09-24 19:08:22 +02:00
Timm Bäder
484dcc043b cssimagefallback: Avoid allocating GPtrArray for colors
If we just parse a color, like image(#FFF), avoid allocating the
GPtrArray to store images. This happens in Adwaita for background images
of backdrop buttons. We save around 70 GPtrArrays this way.
2020-09-24 19:08:22 +02:00
Timm Bäder
716b5afe6a Adwaita: Fix calendar header button backdrop bg color 2020-09-24 19:08:22 +02:00
Timm Bäder
12cc178756 textbuffer: Don't try to inset NULL text from clipboard
That used to generate a critical error message.

Also free() the data.
2020-09-24 19:08:22 +02:00
Matthias Clasen
9fde0137a0 listview: Avoid a critical when reordering
When sorting a cell into the place its already at,
we were triggering criticals. Avoid that.

Fixes: #3180
2020-09-23 22:53:21 -04:00
Matthias Clasen
9dab51e7be Merge branch 'matthiasc/for-master' into 'master'
Matthiasc/for master

Closes #3188

See merge request GNOME/gtk!2612
2020-09-23 22:44:22 +00:00
Matthias Clasen
810218b2f5 fontchooser: Don't center the list
The centered layout of the font previews don't look appealing
and make it harder to judge the relative width and weight of
the individual styles.

Fixes: #3188
2020-09-23 16:32:48 -04:00
Thomas Holder
4325c20013 gtktreeview: Fix child access after TEST_EXPAND_ROW
In gtk_tree_view_build_tree with recurse=TRUE, the TEST_EXPAND_ROW
signal might invalidate the child iterator. Getting the iterator after
the signal (instead of before) fixes the issue.

Fixes https://gitlab.com/inkscape/inkscape/-/issues/1879
2020-09-23 07:53:33 -04:00
Matthias Clasen
7bae48335f Merge branch 'wip/jimmac/osd-spinbutton' into 'master'
Adwaita: osd spinbutton specificity bump

Closes #2769

See merge request GNOME/gtk!2610
2020-09-23 11:47:01 +00:00
Matthias Clasen
571f15cac6 Merge branch 'make-claiming-button-release-work' into 'master'
gestures: Make claiming button release work

See merge request GNOME/gtk!2576
2020-09-23 11:35:59 +00:00
Jakub Steiner
78236bfdbe Adwaita: osd spinbutton specificity bump
- mimic the peculiar selector from the normal style onto osd to
  override.

Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/2769
2020-09-23 10:16:55 +02:00
nana-4
2d6a9990b7 Adwaita: Don't restrict columnview editablelabel style to .data-table
This should be available without .data-table.
2020-09-22 10:40:15 +09:00
nana-4
42be26f1b1 Adwaita: Improve columnview styling
- Move padding from parent row to child cell.
- Align horizontal sizing of cell with header button.
- Properly support GtkColumnView:show-column-separators.
- Change cell height with and without .data-table.
2020-09-22 10:37:04 +09:00
nana-4
f98055b075 Adwaita: Fix separator color for lists 2020-09-22 10:35:15 +09:00