Commit Graph

39223 Commits

Author SHA1 Message Date
Matthias Clasen
bb5eb3ba55 Merge branch 'docs-label' into 'master'
Various documentation fixes

See merge request GNOME/gtk!4029
2021-10-04 12:25:41 +00:00
Emmanuele Bassi
289394de30 docs: Replace gtk-doc internal link in GtkRequisition 2021-10-04 10:46:45 +01:00
Emmanuele Bassi
12d4a51679 docs: Remove gtk-doc link from GtkTreeView::row-activated 2021-10-04 10:45:34 +01:00
Emmanuele Bassi
9bd0674672 docs: Fix GtkCellLayout description
- Drop gtk-doc internal links
- Escape XML elements
2021-10-04 10:42:59 +01:00
Emmanuele Bassi
a9c1e1e468 docs: Remove gtk-doc links from GtkDrawingArea 2021-10-04 10:37:29 +01:00
Emmanuele Bassi
42ba6f0a34 docs: Fix up GtkTreeViewColumn
Remove the use of gtk-doc links.
2021-10-04 10:36:52 +01:00
Emmanuele Bassi
49603c24ad docs: Clean up GtkCellArea description
- Drop gtk-doc links
- Use gi-docgen links
- Use Markdown code blocks
- Fix code markers around types
2021-10-04 10:30:02 +01:00
Emmanuele Bassi
08aa77c243 docs: Fix GtkListStore description
- Escape XML elements
- Remove old gtk-doc links
- Add a few internal links
- Use Markdown code blocks
2021-10-04 10:16:26 +01:00
Emmanuele Bassi
4e6a76e11e docs: Fix internal links in for GtkLabel's text layout section 2021-10-04 10:15:51 +01:00
Pierre Ossman
34037c0550 searchenginemodel: finalize search results
It is necessary to signal the search engine that we are finished and
that we found something for it to reliably show the results. It would
sometimes work anyway since it is sufficient if any backend signals
completion. However if GtkSearchEngineModel was the only backend
returning results then things would break.
2021-10-04 09:23:39 +02:00
Matthias Clasen
8079f8ea3c Add depfiles back to resource generation
The recent change to faster resource generation
lost the depfiles to ensure that we regenerate
resources when any of the contents change.
Bring it back.
2021-10-03 22:23:56 -04:00
Matthias Clasen
e9828f1fcd Fix the build
I messed this up when I changed how we build resources.
2021-10-01 12:56:05 -04:00
Matthias Clasen
6339875989 Fix an oversight 2021-09-30 23:45:33 -04:00
Matthias Clasen
802ad39209 gtk: Speed up build
Avoid serializing the gresource blob into a C string
and running gcc over it. Instead, use ld to put it
directly into an .o file and add it to the build.

The build system machinations here were copied from
gobject/tests/meson.build, and should ideally be part
of the meson gnome module.
2021-09-30 23:30:48 -04:00
Benjamin Otte
5c3b368925 docs: Add note about stable sorting to SortListModel 2021-10-01 00:31:51 +00:00
Matthias Clasen
01abd1565e a11y: Simplify atspi context a bit
We don't really need a bus-address property
that gets copied for every single object.
We keep the address in object data on the
display anyway. Just use it from there.

This gets rid of a nice amount of strdups
at startup.
2021-09-29 10:58:23 -04:00
Matthias Clasen
160aeb4879 Simplify our ui files
Run gtk4-builder-tool simplify over our ui files,
we simplify some more things now.
2021-09-29 10:58:23 -04:00
Matthias Clasen
e99ac8f6d8 builder: Simplify parameter collection
This avoids setting the GValue only to toss it at the
end of the loop body. Instead, we can just do nothing
if this property isn't interesting to us.
2021-09-28 17:48:50 -04:00
Matthias Clasen
8aafee4e35 Merge branch 'matthiasc/for-master' into 'master'
entry: Clarify docs

See merge request GNOME/gtk!4005
2021-09-28 20:24:16 +00:00
Matthias Clasen
2c9a2e94c8 entry: Clarify docs
Mention that max length is in characters.
2021-09-28 15:40:41 -04:00
Matthias Clasen
8f817e67de Merge branch 'matthiasc/for-master' into 'master'
Fix the build

See merge request GNOME/gtk!4004
2021-09-28 19:39:57 +00:00
Matthias Clasen
32191bc18e Fix the build
gcc was complaining here with -Werror=return-type.
2021-09-28 15:19:17 -04:00
Matthias Clasen
c4069fdcee builder: Fix handling of <binding>
We were only applying <binding> elements when the
object is constructed, which can be triggered by
various things (e.g. a <style> element). Defer
this until we reach </object>, so we can be sure
that we pick up all the bindings.

Testcase included.

Fixes: #4147
2021-09-28 15:09:49 -04:00
Matthias Clasen
b17005ddab Merge branch 'fix-builder-parsing' into 'master'
builder: Fix parsing of mixed declarations

Closes #4208

See merge request GNOME/gtk!3997
2021-09-28 04:32:30 +00:00
Matthias Clasen
69cf1aa050 Merge branch 'builder-leaks' into 'master'
builder: Don't leak refs

See merge request GNOME/gtk!4001
2021-09-27 23:16:29 +00:00
Matthias Clasen
ec62402908 builder: Fix parsing of mixed declarations
The GtkBuilder parser constructs the object e.g.
when handling a <binding> element. There may be
more <property> elements after it, which we were
just not applying. Fix that by always applying
property when we see </object>. To do that, we
need to track the applied status per property.

Test included.

Fixes: #4208
2021-09-27 17:47:24 -04:00
Matthias Clasen
c8f29a689d builder: Consistently use builder_construct
It seems odd to use this helper in one place,
but not the other.
2021-09-27 17:46:24 -04:00
Matthias Clasen
e3ecd5d23e Add an assertion and comment
Maybe it helps the person unfortunate enough
to stumble in here.
2021-09-27 17:30:25 -04:00
Bart Jacobs
eac0e06a7a ConstraintGuide getters: annotate out parameters as such 2021-09-27 21:23:45 +00:00
Matthias Clasen
834c72bb0f coloreditor: Don't unref unless we own it
Calling gtk_widget_class_bind_template_child does
*not* give you a reference that you need to unref.
It manages the reference for you. So calling
g_clear_object on such a member is wrong.
2021-09-27 16:40:29 -04:00
Matthias Clasen
6b86848984 builder: Don't leak refs
We sometimes end up setting an object on a GValue
that we are then not interested in. We need to
unset it, or we'll leak the ref.
2021-09-27 16:38:32 -04:00
Benjamin Otte
659181f74b win32: Fix GTK warnings 2021-09-24 23:26:45 +02:00
Benjamin Otte
555993717b Merge branch 'wip/otte/gdk-headers' into 'master'
Clean up GDK headers

See merge request GNOME/gtk!3996
2021-09-24 21:16:55 +00:00
Benjamin Otte
a29474567a gdk: Remove gdkinternals.h 2021-09-24 22:50:29 +02:00
Benjamin Otte
811b5d995b gdk: Don't include gdkinternals.h in gdk-private.h 2021-09-24 22:11:57 +02:00
Matthias Clasen
610ba1cadf headerbar: Cosmetics
Use the box api we have.
2021-09-24 08:54:04 -04:00
Christian Hergert
659393049e textview: improve undo grouping when overwriting
We want to group in more than one undo group when removing a selection
and replacing it with a new character or characters, unless we're
replacing a single character. In that case, the natural thing is to treat
it as an atomic change.
2021-09-23 13:25:41 -07:00
Christian Hergert
b578c78eff texthistory: add barriers after final grouping
We don't want to allow new items to be grouped into a previous action
group after the end_user_action() is called. This ensures that we add a
barrier action in those conditions.

Fixes #4276
2021-09-23 13:25:35 -07:00
Matthias Clasen
d7db3f1546 Merge branch 'master' into 'master'
gtktextview: Fixed arrow key crash.

Closes #4275

See merge request GNOME/gtk!3984
2021-09-22 23:03:18 +00:00
Matthias Clasen
1430142ad8 Revert "Add delayed loading for textures"
This reverts commit 4a89cfe2c9.
2021-09-21 23:10:53 -04:00
Matthias Clasen
3a5091cb6e Revert "Use GtkLoader for image loading"
This reverts commit da115ad075.
2021-09-21 23:10:53 -04:00
Jordan Yelloz
5f913e9558 gtktextview: Fixed arrow key crash.
When pressing the keyboard arrows to move around when the insertion point is
hidden, it causes an assertion error in blink_cb.

Insertion point blinks should only be scheduled when blinking is enabled and the
insertion point is visible.

Closes #4275
2021-09-21 09:14:22 -07:00
Martin Kühl
a9d7282f00 gtkcomposetable: Accept long replacement strings
This change removes the assertions limiting replacement strings in the compose table to be less than 20 characters.
The limit seems arbitrary, is not required, will break some users' setups, and problems with it result in applications not launching.

Fixes #4273
2021-09-21 17:03:20 +02:00
Benjamin Otte
765e78f72b window: Add a titlebar property
It just turns get/set_titlebar into a property.
2021-09-21 02:52:30 +00:00
Benjamin Otte
32871f997e window: Make priv->titlebar the titlebar
It was priv->title_box before - unless priv->titlebar wasn't NULL, then
it was NULL.

Confusing? Yeah, that's why I changed it.
2021-09-21 02:52:30 +00:00
Benjamin Otte
9fb729ccc0 window: Improve set_titlebar() function
Get rid of a goto and check if the titlebar is already set.
2021-09-21 02:52:30 +00:00
Lukáš Tyrychtr
da20c68d48 Mention that after setting a button child the user is responsible for a11y relations 2021-09-20 10:52:16 +02:00
Benjamin Otte
d19f4ad53a Merge branch 'wip/otte/for-master' into 'master'
cssprovider: Be clearer about warnings vs errors

See merge request GNOME/gtk!3980
2021-09-20 05:38:27 +00:00
Matthias Clasen
0b4817a1c6 window: Drop some dead code
The gtk_window_set_buildable_property implementation
was only used to set the unused builder_visible flag.
Remove both the flag and the vfunc.

This means we no longer have any set_buildable_property
implementations and could eventually drop that vfunc and
the support for it in GtkBuilder.
2021-09-20 00:01:24 -04:00
Benjamin Otte
e931afdc9b cssprovider: Be clearer about warnings vs errors
The CSS parser tried to warn about unexpected syntax that the spec
doesn't define as an error.
2021-09-20 05:57:14 +02:00
Matthias Clasen
7dab5322df builder: Cosmetics 2021-09-19 23:54:38 -04:00
Matthias Clasen
138fd6f0f3 builder: Small optimization
Use g_object_setv where we can.

It would be much nicer if we could pass the
pspecs we already have, and avoid having GObject
look them up again.
2021-09-19 23:26:00 -04:00
Matthias Clasen
5c3bb42612 builder: Avoid a pointless call
pspec->name is guaranteed to be interned already.
2021-09-19 22:13:00 -04:00
Matthias Clasen
2c2d03a8d7 builder: Drop unused part of private api
The aliases arguments was used to support 'primary',
but we no longer have that, and all callers pass
NULL for aliases. So, just drop it.
2021-09-19 22:04:32 -04:00
Matthias Clasen
e1facc548a resources: Treat svgs as xml
They can have their whitespace removed just the same.
2021-09-19 08:27:08 -04:00
Matthias Clasen
87e4a542eb Clean up gesture icons
These had duplicate drawing in them, and were
saved with all the extra Inkscape data.
2021-09-19 08:27:08 -04:00
Matthias Clasen
56e6a51ac0 Merge branch 'delayed-loading' into 'master'
gtk-demo: Cosmetics

See merge request GNOME/gtk!3975
2021-09-18 23:02:00 +00:00
Matthias Clasen
da115ad075 Use GtkLoader for image loading
This avoids blocking on image loading while
we have better things to do.
2021-09-18 17:35:00 -04:00
Matthias Clasen
4a89cfe2c9 Add delayed loading for textures
Add a private GdkPaintable implementation that
loads a texture in a thread, and does not show
anything until the texture is loaded. This avoid
blocking on image loading in the main thread.
2021-09-18 17:35:00 -04:00
Matthias Clasen
164443a99a builder: Cosmetics 2021-09-18 14:14:55 -04:00
Timm Bäder
24415a6ffb cssimageurl: Explicitly check for local_error != NULL
This should always be the case since gdk_texture_new_from_file should
always set the error when it returns NULL, but make it explicit anyway.
2021-09-18 13:08:46 +02:00
Timm Bäder
ae08aa3622 constraintsolver: Remove a dead assignment 2021-09-18 12:53:41 +02:00
Timm Bäder
c2ab1f172d window: Fix mnemonics-visible getter+setter annotations 2021-09-18 08:29:18 +02:00
Timm Bäder
136a3f6e5a stackswitcher: Expand child buttons
Fixes #4196
2021-09-18 08:29:18 +02:00
Timm Bäder
2bc82da34d inspector: Cache if we have ever constructed a window
Silly optimization to get rid of

gtk_main_do_event
  gtk_inspector_handle_event
    gtk_inspector_window_get_for_display
      g_object_get_data

showing up in profiles even though it's useless since we've never even
created any inspector window in the first place.
2021-09-18 08:29:18 +02:00
Georges Basile Stavracas Neto
02bb23486f filechooserwidget: Return an id in get_choice()
gtk_file_chooser_widget_get_choice() is supposed to return the option
id of the choice, but it currently is returning the option label.

Return the option id instead.
2021-09-18 00:22:05 -03:00
Georges Basile Stavracas Neto
bc0d9488ee filechooserwidget: Match choice id from "options"
When choices are added to the file chooser widget, the options of
that choice are stored object data under the "options" key. However,
gtk_file_chooser_widget_set_choice() was checking for "choices".

Retrieve the options from the "options" key stored data object data.
2021-09-18 00:20:42 -03:00
Matthias Clasen
9cfce67d0f textview: Remove a dead store
Pointed out by clang.
2021-09-17 22:06:21 -04:00
Matthias Clasen
295d406207 listitemmanager: Add a few assertions
This might help poor static analyzers.
2021-09-17 22:06:21 -04:00
Matthias Clasen
c4e558da46 imcontextsimple: Rewrite a function slightly
This hopefully avoids upsetting static analyis.
2021-09-17 20:02:12 -04:00
Matthias Clasen
be1a60d5d0 label: Remove a dead assignment
It may have quieted gcc at some point, but
it upsets clang nowadays. Remove it.
2021-09-17 19:54:16 -04:00
Benjamin Otte
cf3830704b icontheme: Fix variable mixup leading to crashes
Note: Don't have 2 variables named "icon" and "gicon", you will screw
them up.

reftests included.

Fixes #4269
2021-09-17 17:41:13 +00:00
Matthias Clasen
76d31ff04b Merge branch 'menu_button_a11y_improvements' into 'master'
Set correct accessible relations for GtkMenuButton

Closes #4254

See merge request GNOME/gtk!3950
2021-09-17 16:51:52 +00:00
Emmanuele Bassi
15ffd49efb Apply 4 suggestion(s) to 1 file(s) 2021-09-17 16:26:00 +00:00
Matthias Clasen
37a54eb9fc Merge branch 'matthiasc/for-master' into 'master'
gsk: Add a test for transform_bounds

See merge request GNOME/gtk!3966
2021-09-17 16:22:04 +00:00
Matthias Clasen
52a8492887 rendernodepaintable: Provide accurate aspect ratio
Since we report width and height as integers, the
default implementation of this introduces rounding
errors. This shows up in the node-editor, as having
uneven scale factors like sx=1.0 and sy=1.0035.
Text nodes don't handle uneven scales like that well
and overdraw.
2021-09-17 10:28:49 -04:00
Lukáš Tyrychtr
ba5d010e39 Delete unneccessary comment and make other more descriptive 2021-09-17 15:11:26 +02:00
Matthias Clasen
0cce92ab19 Merge branch 'fix-typo' into 'master'
gtkcolorbutton: Fix documentation

See merge request GNOME/gtk!3965
2021-09-17 10:52:59 +00:00
James Westman
f95c21b67c
gtkcolorbutton: Fix documentation 2021-09-16 23:53:42 -05:00
Benjamin Otte
37a7c6780a icontheme: Implement gtk_icon_theme_lookup_by_gicon() for textures
More feature parity.

Before this, it would have worked just as well - just going via a PNG
bytes step inbetween.
2021-09-17 04:31:46 +02:00
Benjamin Otte
e58f70d7bb pixbufutils: Don't hardcode formats
Just let the loaders figure out the file format themselves.
2021-09-17 02:34:15 +02:00
Benjamin Otte
4fcf54757f icontheme: Insist that people provide proper values
Seriously...
2021-09-17 02:29:59 +02:00
Benjamin Otte
b5da07f0e1 icontheme: Use textures more
We were going via GLoadablieIcon/GInputStream for everything previously
and we have no API for that with GdkTexture.

With this commit, gdk-pixbuf isn't used anymore when starting
widget-factory for anything but SVG.
2021-09-17 02:12:07 +02:00
Benjamin Otte
a85f4ec6c2 icontheme: Load textures directly when possible
This doesn't fix the codepaths for SVG (both for recoloring and
resizing) and doesn't handle streams yet.
2021-09-17 02:02:51 +02:00
Matthias Clasen
fecb31b706 builder: Stop using pixbufutils
We can just use gdk_pixbuf_new_from_resource here.
2021-09-17 02:02:51 +02:00
Matthias Clasen
729ad8e64a cssimageurl: Just create a texture directly
We don't need to use the pixbufutils api here.
2021-09-17 02:02:51 +02:00
Matthias Clasen
dcd873a6d8 builder: create textures without pixbufs
Load textures using the GdkTexture apis, without
going through a pixbuf first.
2021-09-17 02:02:51 +02:00
Benjamin Otte
679c93e843 texture: Add private can_load() function
... and use it to load textures in gtk_picture_set_from_file().
2021-09-17 00:25:22 +02:00
Jakub Steiner
ed679703b8 theme: make toggled tbuttons in toolbars visible
- do what Alex does in libadwaita

Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/4264
2021-09-16 12:47:26 +02:00
Benjamin Otte
7fd8899092 pixbufutils: Simplify function 2021-09-15 22:00:41 -04:00
Matthias Clasen
8b85e7f35a Annotate gtk_get_default_language as const 2021-09-14 16:38:08 -04:00
Matthias Clasen
d7909dccdc Annotate gtk_editable_get_chars as malloc 2021-09-14 16:38:08 -04:00
Matthias Clasen
7773ae4538 csstypes: Add annotations and inlines
Inline _gtk_css_change_for_sibling and
_gtk_css_change_for_child, and mark a few
other functions as const or malloc.
2021-09-14 16:38:08 -04:00
Matthias Clasen
bec44acdeb Annotate some builder apis as malloc 2021-09-14 16:38:08 -04:00
Matthias Clasen
5bfac597f6 Annotate gtk_accelerator_get_default_mod_mask as const 2021-09-14 16:38:08 -04:00
Matthias Clasen
44a031c3c1 Annotate gtk_css_tokenizer_get_location as const 2021-09-14 16:38:08 -04:00
Matthias Clasen
be885c888f cssparser: Mark some functions as pure and malloc 2021-09-14 16:38:08 -04:00
Lukáš Tyrychtr
0120ff3518 Merge branch 'master' into menu_button_a11y_improvements 2021-09-14 15:34:14 +02:00
Matthias Clasen
2e63b53b1e Merge branch 'fix_accessible_described_by' into 'master'
Fix generation of accessible description in presence of described by relations

See merge request GNOME/gtk!3948
2021-09-14 13:29:28 +00:00
Lukáš Tyrychtr
955d50a080 Fix generation of accessible description in presence of described by relations
The loop going through the relation list should have stopped on the NULL sentinel value, however it never accesed the next list element.
2021-09-14 14:33:30 +02:00
Lukáš Tyrychtr
b664b2d1fd Set correct accessible relations for GtkMenuButton
Up until now, as the focus was moved to the inner button, it was not possible for
assistive technologies to determine the correct labels and descriptions
because developers could set them only for the parent widget.
Now, the proper relations are added so the labels should be picked up properly.

Fixes #4254
2021-09-14 14:26:18 +02:00
Alexander Mikhaylenko
8f9a5175f0 media-controls: Make play button flat
Match the volume button.
2021-09-14 12:23:03 +05:00
Alexander Mikhaylenko
099c923679 searchbar: Vertically center the close button 2021-09-14 12:22:45 +05:00
Julian Sparber
cdc1fa166d stack: Dispose children before emitting items-changed
This makes sure that the `GListModel` returned by
`gtk_stack_get_pages()` actually has the items removed before
`items-changed` is emitted.

Fixes: https://gitlab.gnome.org/GNOME/gtk/-/issues/4255
2021-09-13 17:19:05 +02:00
James Westman
0782c8a051
gdk_rgba_parse: Support HSL colors 2021-09-10 16:56:42 -05:00
Matthias Clasen
72dc9a21f7 GtkApplication: Call setlocale early
If we don't call setlocale early enough,
--help output may come out misformatted.

Fixes: #4234
2021-09-06 01:38:47 -04:00
Matthias Clasen
d75246a543 inspector: Cosmetics
Make some settings entries smaller, and make the
scales match in size. Also, inline adjustments
in the ui file, since we can do that now.
2021-09-05 12:59:11 -04:00
Matthias Clasen
f703744564 Merge branch 'ebassi/accel-parse-doc' into 'master'
Improve the gtk_accelerator_parse() docs

See merge request GNOME/gtk!3921
2021-09-04 23:39:10 +00:00
Matthias Clasen
754212d0f9 textview: Invalidate Pango contexts
We need to invalidate the Pango contexts when
font settings change. Use the new helper
gtk_widget_update_pango_context to make it less
likely that we forget to update some things.
2021-09-04 15:42:05 -04:00
Matthias Clasen
a9b81577c6 widget: Provide a helper for updating pango contexts 2021-09-04 15:42:05 -04:00
Matthias Clasen
eaa2dada54 Rename an internal function
It occupies a name I want to reuse for something else.
2021-09-04 15:42:05 -04:00
Matthias Clasen
06423d807f Revert "gtk: Pass font options along"
This reverts commit 062a15310a.
2021-09-04 15:42:05 -04:00
Emmanuele Bassi
c3ca48b249 Improve the gtk_accelerator_parse() docs
We need to escape the modifiers in angular brackets, or Markdown will
consider them as HTML tags.

We also should document the modifiers we're parsing.
2021-09-04 18:56:08 +01:00
Matthias Clasen
26e632e549 widget: Redraw when font options change
Its the right thing to do, even if it is a rare event.
2021-09-03 13:56:29 -04:00
Matthias Clasen
062a15310a gtk: Pass font options along
Pass the widget's font options along when we
are creating text nodes.
2021-09-03 12:52:05 -04:00
Alexander Mikhaylenko
8b48cf11f9 menubutton: Support custom children
Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/4205
2021-09-03 17:52:46 +05:00
Matthias Clasen
d4b7a78c54 Add a README in gtk/compose 2021-09-02 20:10:19 -04:00
Matthias Clasen
b26a370ce4 Add a gtk-hint-font-metrics setting
This lets people switch back to font rendering that is closer
to what GTK 3 does. It is not perfect - subpixel antialiasing
is not going to work. But it give us an Escape hatch while
we shake out the bugs in our linear layout.

Related: #3787
2021-09-01 15:52:07 -04:00
Matthias Clasen
ad3dad1965 Initial support for new Pango attributes
This is still missing the GtkTextTag hookup,
but it fixes the build.
2021-09-01 10:32:45 -04:00
Matthias Clasen
fa57b006c9 editable: Clarify the docs
Make it clear that your class must have all the editable properties
already before you call the (confusingly named) function
gtk_editable_install_properties.
2021-08-31 08:41:45 -04:00
Matthias Clasen
3667c6b053 Merge branch 'wip/smcv/compose-files' into 'master'
Fix Compose handling on big-endian host architectures

Closes #4217

See merge request GNOME/gtk!3902
2021-08-30 12:52:54 +00:00
Simon McVittie
1071818df8 compose: Update sequences from libX11 1.7.2
This adds support for sequences like <Compose>,G,u -> capital G with
breve. Previously, only a capital U was accepted for E, G, I and O
(but a lower-case u was accepted for A and U for some reason).

Signed-off-by: Simon McVittie <smcv@debian.org>
2021-08-30 13:09:27 +01:00
Simon McVittie
11c2d9ea30 compose: Document how to get compose-parse input from libX11 source
Signed-off-by: Simon McVittie <smcv@debian.org>
2021-08-30 13:09:05 +01:00
Simon McVittie
52cdf3056d compose: Generate endian-dependent compact Compose data
The GtkComposeTable cache is always in big-endian format and is
byteswapped on load for the more common little-endian CPUs, but
init_builtin_table() in GtkIMContextSimple can't byteswap the built-in
data without copying it, which is undesirable. Pregenerate both big-
and little-endian compose data, and compile the correct flavour into
each build of GTK. This fixes failure of the composetable test when
building for a big-endian architecture such as s390x and (traditional,
big-endian) powerpc.

Resolves: https://gitlab.gnome.org/GNOME/gtk/-/issues/4217
Signed-off-by: Simon McVittie <smcv@debian.org>
2021-08-30 11:29:46 +01:00
Benjamin Otte
cbc050b9ed recorder: Make the render nodes in the list draggable
You can (soon) drag any of the nodes directly into the node-editor.
2021-08-30 06:02:16 +02:00
Benjamin Otte
18affbd390 dragicon: Add a default drag icon for GskRenderNode
Somebody should make this default drag icon machinery pluggable.
2021-08-30 06:02:16 +02:00
Benjamin Otte
552b71d4e2 stylecontext: Remove unneeded headers 2021-08-30 06:02:15 +02:00
Benjamin Otte
480112f9aa fontbutton: Destroy dialog in unrealize()
This way, we can be sure it's always using the right display.

We can also be sure that it doesn't leak.
2021-08-30 06:02:15 +02:00
Benjamin Otte
9a2f4d8026 fontbutton: Make sure the window is on the same display
We don't want the font buttons created by the inspector to run on the
default display.
2021-08-30 06:02:15 +02:00
Benjamin Otte
3b15f32335 Merge branch 'wip/otte/symbolic-paintable' into 'master'
Add GtkSymbolicPaintable

See merge request GNOME/gtk!3895
2021-08-30 03:54:35 +00:00
Benjamin Otte
7404a6fc4f Merge branch 'wip/otte/G_TYPE_POINTER' into 'master'
Get rid of G_TYPE_POINTER

See merge request GNOME/gtk!3900
2021-08-30 03:50:30 +00:00
Benjamin Otte
91d1ec41c2 symbolicpaintable: Refactor default colors path 2021-08-30 05:29:04 +02:00
Benjamin Otte
9237c8be67 icontheme: Refactor gtk_icon_theme_lookup_symbolic_colors()
With the new enum, the code looks much cleaner.
2021-08-30 04:52:47 +02:00
Benjamin Otte
6c87d362c5 enums: Add a GtkSymbolicColor enum
That way we don't nedmagic numbres to index the colors array.

Use it in the symbolic paintable demo.
2021-08-30 04:36:16 +02:00
Benjamin Otte
e2d321a16a searchengine: Rename private headers
The code uses G_TYPE_POINTER and I got all sorts of scared.
2021-08-29 06:52:28 +02:00
Benjamin Otte
7366f5099a filesystemmodel: Don't use G_TYPE_POINTER
It's a GError, use G_TYPE_ERROR.
2021-08-29 06:52:28 +02:00
Benjamin Otte
4fbef5f466 placessidebar: Don't use G_TYPE_POINTER
We have a type for lists of GFiles. We invented it for DND.

Keep the annotation info, so bindings don't have to know this.
2021-08-29 06:52:28 +02:00
Benjamin Otte
2e48ff3362 pathbar: Use correct GType in signal 2021-08-29 06:52:28 +02:00
Benjamin Otte
2808f9c75b gtk: Port icontheme to GtkSymbolicPaintable 2021-08-29 04:29:53 +02:00
Benjamin Otte
49d109c29e gtk: Add the GtkSymbolicPaintable interface 2021-08-29 04:29:53 +02:00
Matthias Clasen
369ccfc34f Merge branch 'matthiasc/for-master' into 'master'
Draw negatively sloped carets correctly

See merge request GNOME/gtk!3892
2021-08-28 17:18:21 +00:00
Florian Müllner
3fa26861cd window: Prefer menu bars when handling F10
Focusing the first widget in the titlebar is a good fallback,
but a "real" menubar or :primary menu button should take
precedence.
2021-08-28 00:19:23 +02:00
Matthias Clasen
ef2b0ccd6c Draw negatively sloped carets correctly
The code for handling negatively sloped caret
positions was not tested, and naturally did
not work. Fix it.
2021-08-27 17:20:35 -04:00
Matthias Clasen
3a50ff57d8 Clean up the code
Avoid compiler warnings, and make the code
a bit more compact.
2021-08-26 20:45:17 -04:00
Matthias Clasen
8ac2e8d495 textview: Apply font features from css
We were forgetting to propagate these values from
CSS to the default attributes. Share the code for
getting these values out of a GtkCssStyle.
2021-08-26 20:21:23 -04:00
Matthias Clasen
e56cf85fd1 textview: Apply text transform from css
We were forgetting to propagate these values from
CSS to the default attributes.
2021-08-26 18:53:30 -04:00
Matthias Clasen
1c6aef1862 textview: Apply line decoration from css
We were forgetting to propagate these values from
CSS to the default attributes.
2021-08-26 18:46:57 -04:00
Matthias Clasen
4653cbe56e Merge branch 'css-letter-spacing' into 'master'
textview: Don't forget to collect css letterspacing

Closes #4207

See merge request GNOME/gtk!3889
2021-08-26 19:37:55 +00:00
Matthias Clasen
93148d302f textview: Don't forget to collect css letterspacing
There are more properties missing, this is just
the start.

Fixes: #4207
2021-08-26 15:01:23 -04:00
Christoph Reiter
a0c147d246 build: fix implicit-fallthrough errors with clang
The clang build fails due to -Werror=implicit-fallthrough being
on by default and some fallthrough cases not being marked as such.

Use G_GNUC_FALLTHROUGH or duplicate the code in those cases.
2021-08-26 07:08:38 +02:00
Matthias Clasen
989ecf69ad Merge branch 'new-pango-attributes' into 'master'
Support new pango attributes

See merge request GNOME/gtk!3878
2021-08-25 20:11:45 +00:00
Matthias Clasen
b9cad7cc54 textview: Implement new pango attributes
Implement the word and sentence attributes.
2021-08-25 14:57:13 -04:00
Matthias Clasen
357b97b5a6 Support new pango attributes
Support new Pango attributes for segmentation
in GtkBuilder.
2021-08-25 14:57:13 -04:00
Jan Lukas Gernert
318160d836 GtkTreeExpander: claim expander-icon gestures
Claim the pressed, released and canceled gestures
meant for the expander-icon of the TreeExpander.
This avoids selecting the row when expanding or collapsing it.

Closes #4199
2021-08-25 17:50:12 +02:00
Matthias Clasen
5e90d63373 Merge branch 'sloped-caret' into 'master'
Implement sloped caret drawing

See merge request GNOME/gtk!3880
2021-08-25 13:43:24 +00:00
Matthias Clasen
e281bbbb55 Merge branch 'treeexpander-indent-property' into 'master'
GtkTreeExpander: indent-without-expander property

Closes #4175

See merge request GNOME/gtk!3858
2021-08-25 11:48:59 +00:00
Matthias Clasen
2f1db4b77c Use pango_layout_get_caret_pos
This new api returns rectangles for sloped carets,
in contrast to pango_layout_get_cursor_pos, which
always returns a rectangle with a width of zero.
2021-08-25 06:53:53 -04:00
Matthias Clasen
f90e9b26f8 Implement sloped caret drawing
Prepare for Pango to return slope information for carets.

While we are at it, improve the shape of our carets a bit.
2021-08-25 06:53:53 -04:00
Matthias Clasen
b9c51e65c1 Merge branch 'wip/carlosg/gesture-state-in-entries' into 'master'
Claim clicks further at GtkEntry/GtkSearchEntry

See merge request GNOME/gtk!3873
2021-08-24 17:20:20 +00:00
Matthias Clasen
51f953a1aa Revert "imwayland: Tweak preedit text"
This reverts commit d84a028455.

IBus uses the same character now.

Fixes: #4123
2021-08-24 12:53:48 -04:00
Emmanuele Bassi
5e311d4d85 Release an extra reference on GtkExpander:child
The child of a GtkExpander is owned directly by the expander whenever
the "expanded" flag is unset.

We are adding an additional reference to the child of an expander when
expander is not expanded.

Additionally, if a GtkExpander is disposed while not expanded, we need
to explicitly release the reference on the child widget that we own.

This reference leak was masked in GTK3 by GtkContainer removing each
child from the parent container by recursively calling
gtk_widget_destroy().
2021-08-24 11:28:59 +01:00
Carlos Garnacho
e652054d50 gtkpasswordentry: Add a "catchall" click gesture handler
This gesture is set on the whole widget surface, since there's
multiple input targets inside an entry (icons, the GtkText itself)
it makes sense to consider the full entry an area handling clicks.
Ensure these events don't propagate further up, and result in other
actions.
2021-08-24 01:13:29 +02:00
Carlos Garnacho
58c31b8627 gtkpasswordentry: Consume click events after pressing on icon
This may result in user actions, so the gesture should consume the
events.
2021-08-24 01:12:31 +02:00
Qiu Wenbo
92d2867170 docs: Fix documentation for gtk_icon_view_create_drag_icon
Fixes: #4190
2021-08-24 00:24:08 +08:00
Kalev Lember
552a4b2c82 build: Fix detection for pre-compiled css files
The default theme changed from Adwaita to Default and this tripped up
the logic to detect if the tarball builds contain pre-built css files or
not. Fix this by looking at pre-compiled css files in themes/Default/
instead of themes/Adwaita/.
2021-08-23 16:15:48 +02:00
Carlos Garnacho
7a4afb08bd gtksearchentry: Add a "catchall" click gesture handler
This gesture is set on the whole widget surface, since there's
multiple input targets inside an entry (icons, the GtkText itself)
it makes sense to consider the full entry an area handling clicks.
Ensure these events don't propagate further up, and result in other
actions.
2021-08-23 15:38:33 +02:00
Carlos Garnacho
c5cd1ac630 gtkentry: Add a "catchall" click gesture handler
This gesture is set on the whole widget surface, since there's
multiple input targets inside an entry (icons, the GtkText itself)
it makes sense to consider the full entry an area handling clicks.
Ensure these events don't propagate further up, and result in other
actions.
2021-08-23 15:38:33 +02:00
Carlos Garnacho
90edb76415 gtksearchentry: Consume click events after pressing on icon
This results in user actions, so the gesture should consume the
events.
2021-08-23 15:38:33 +02:00
Carlos Garnacho
8f397502df gtktext: Set claimed state on button1 click gesture
All possible ramifications after button1 press (move cursor,
begin drag, begin dnd, select word/line, ...) result in user
actions. The right thing after that is consuming the events,
set the gesture state for that.
2021-08-23 15:28:27 +02:00
Jan Lukas Gernert
1cb17d8613 GtkTreeExpander: indent-for-icon property
A property to determine if the TreeExpander should indent the child
by the width of an expander-icon when it is not expandable.

Closes #4175
2021-08-23 07:54:45 +02:00
Matthias Clasen
417b3f9c6b Implement text transforms for GtkTextView
Add a property to GtkTextTag and do all the
legwork to translate it to the Pango attribute.
2021-08-22 15:57:50 -04:00
Matthias Clasen
2d84a1c63e css: Implement text-transform
Implement the text-transform property from
https://www.w3.org/TR/css-text-3/#text-transform-property
using a new Pango attribute.
2021-08-22 15:57:50 -04:00
Matthias Clasen
ba95ef63da Drop PANGO_VERSION_CHECK checks
We require Pango 1.49 now.
2021-08-22 15:26:23 -04:00
Matthias Clasen
2cc06f60c5 textview: Set line height from markup
Note that we ignore the absolute-line-height
attribute for now.
2021-08-22 15:15:50 -04:00
Matthias Clasen
4759afcc3e textview: Set line height from css
Set the line height in the default attributes from
the CSS style. This makes line height work in
GtkTextView.
2021-08-22 15:15:50 -04:00
Matthias Clasen
66b297e408 textview: Add line height plumbing
This adds a line-height property to GtkTexttag and a
line_height field to GtkTextAttributes, and translates
it to a pango attribute.
2021-08-22 15:15:50 -04:00
Matthias Clasen
ae767dc5bf css: Translate line-height to a Pango
Pango 1.50 introduces a line-height attribute. Use it.
This is enough to make line-height work for labels
and entries.
2021-08-22 15:15:50 -04:00
Matthias Clasen
d923402934 css: Add line-height property
This adds the plumbing to parse the line-height
property from CSS. Widgets are not picking it
up yet.
2021-08-22 15:15:50 -04:00
Matthias Clasen
7be3c2974a windowhandle: Quiet a compiler warning
gesture was left uninitialized in the default case.
2021-08-22 14:19:14 -04:00
Matthias Clasen
fd885e42b0 Merge branch 'drop-gl' into 'master'
gsk: Drop the gl renderer

See merge request GNOME/gtk!3863
2021-08-22 17:04:25 +00:00
Matthias Clasen
1bf5aab18c testutils: Don't include gsk/gl/gskglrenderer.h 2021-08-22 12:29:13 -04:00
Matthias Clasen
5feba67a3d Handle new pango attribute type
Update all the places where we switch over
PangoAttrType to handle PANGO_ATTR_TEXT_TRANSFORM,
and do nothing for now - text-transform support
will land in 4.6.
2021-08-22 11:04:28 -04:00
Matthias Clasen
92817b0603 Merge branch 'cut-shortcut-activation-short' into 'master'
shortcutcontroller: Only do round-robin for mnemonics

Closes #4130

See merge request GNOME/gtk!3824
2021-08-20 13:50:51 +00:00
Matthias Clasen
f8a1726ffa shortcutcontroller: Only do round-robin for mnemonics
Don't do round-robin activation unless we are looking
for mnemonics, where this is an expected feature.

Fixes: #4130
2021-08-20 09:26:37 -04:00
Emmanuele Bassi
12c5518e2b Merge branch 'master' into 'master'
a11y: Send correct object reference for the root accessible

See merge request GNOME/gtk!3800
2021-08-20 13:18:37 +00:00
Matthias Clasen
da1232caaf textview: Don't eat block cursors
We need to render even an empty paragraph when
it has a block cursor at the end. This fixes block
cursors not showing up in empty lines.
2021-08-20 01:57:31 -04:00
Matthias Clasen
f5b6488eb2 window: Make resizeability changes work
We were forgetting to update the toplevel
properties here.
2021-08-19 16:03:58 -04:00
Matthias Clasen
8aa25046dc textview: Improve word selection
Avoid selecting a whole extra paragraph when a select-by-words
selection is extended beyond the end of the previous paragraph.

Fixes: #4177
2021-08-19 00:33:03 -04:00
Matthias Clasen
071a6bcc06 Cosmetics 2021-08-18 22:33:23 -04:00
Matthias Clasen
1599b659cf infobar: Update buildable docs
Document the current state of GtkBuilder support in
GtkInfoBar, not what we had in GTK3.

Fixes: #4164
2021-08-18 17:42:54 -04:00
Matthias Clasen
81e5d4c327 Merge branch 'master' into 'master'
gtkbuilderparser: Fix duplicate object id detection

See merge request GNOME/gtk!3848
2021-08-18 12:00:41 +00:00
Ye Moran
f8111125ef gtkbuilderparser: Fix duplicate object id detection 2021-08-18 12:00:40 +00:00
Matthias Clasen
f6659fea8d imcontext: Improve docs
Add some more docs around GtkIMContext.
2021-08-17 22:33:26 -04:00
Alexander Mikhaylenko
342f02711b widget: Fix gtk_widget_class_query_action() annotations
Add transfer none on all out values as they aren't being copied.
2021-08-11 14:33:38 +05:00
Matthias Clasen
528ebfabf0 Handle the new line height pango attribute
Update all the places where we switch over PangoAttributeType
to handle (and ignore, for now) the new line height attribute.
2021-08-10 08:22:52 -04:00
Matthias Clasen
04f3c8054b Merge branch 'callback-annotation-again' into 'master'
widget: Change callback scope

See merge request GNOME/gtk!3796
2021-08-10 01:16:56 +00:00
Matthias Clasen
4e1ea58503 Cosmetics: Tweak css parser error messages
These show up in tooltips, so they should a) be capitalized
and b) not end with a period.
2021-08-07 18:18:10 -04:00
Matthias Clasen
f328ab9d83 Merge branch 'wip/chergert/revert-top-margin' into 'master'
Revert "textview: fix yoffset position when top_margin is set"

See merge request GNOME/gtk!3828
2021-08-06 13:13:21 +00:00
Matthias Clasen
bdbe0acd1f Merge branch 'matthiasc/for-master' into 'master'
settings: Default gtk-split-cursor to FALSE

See merge request GNOME/gtk!3827
2021-08-05 19:17:54 +00:00
Christian Hergert
fc701baef8 Revert "textview: fix yoffset position when top_margin is set"
This reverts commit 908b1e5e12.

This commit broke top-margin altogether.
2021-08-05 11:52:45 -07:00