Commit Graph

39402 Commits

Author SHA1 Message Date
Benjamin Otte
de3c50a237 sizerequest: Use g_printerr() for debug messages
glib doesn't print debug messages by default anymore.
2021-11-20 06:04:10 +01:00
Benjamin Otte
244ddea0ea paned: Always query at least min size
For shrinking children, we would not make sure of this and just throw
the current size at them.
2021-11-20 06:04:10 +01:00
Benjamin Otte
6c94835f5d stack: Make sure to not under-measure children
When the stack is homogeneous in only one direction, the other direction
may produce min sizes to small for all children. Make sure to query at
least the min size for those.
2021-11-20 06:04:10 +01:00
Benjamin Otte
617566128d stack: Index the homogeneous array by orientation 2021-11-20 06:04:10 +01:00
Benjamin Otte
7bf772111c stack: Turn the homogenenous variables into an array
that way, we can index them by orientation.
2021-11-20 06:04:10 +01:00
Benjamin Otte
50e0893497 widget: force adjustment method is one size is FILL
If halign=fill, force adjustment to height-for-width.
If valign=fill, force adjustment to width-for-height.
Otherwise look at request mode.

This way we don't try to adapt the filled dimension and only adjust
the one that is not set to fill.
2021-11-20 06:04:10 +01:00
Benjamin Otte
7459d430eb widget: Don't forget margins when adjusting
This could lead to the wrong values being passed and computing invalid
sizes which would then lead to very unhappy code.

Test included.
2021-11-19 23:46:59 +01:00
Benjamin Otte
163616cc0a sizerequest: Add a critical when for_size is too small
It's not expensive to check it because we'll cache the dfault size
request anyway, and people do it wrong a lot.
As a bonus, don't do any return_if_fail(), just use the min size
instead.
2021-11-19 23:46:59 +01:00
Fred Morcos
f019e9d856 Documentation fix and whitespace cleanup
- gtk_init() does not parse command-line options anymore.
- Gitlab's  WebIDE automatically cleans up whitespace.
2021-11-19 13:21:56 +00:00
Benjamin Otte
899cb44519 label: Don't add a pixel where none should be added
When the text width is larger than the measuring width, set the min
width to that value, don't also add 1 to it.
2021-11-18 07:16:09 +00:00
Marco Melorio
d3347e64ba picture: Setting keep-aspect-ratio requires a redraw 2021-11-18 02:39:15 +01:00
Matthias Clasen
0c53b608f9 Merge branch 'bilelmoussaoui/since-annotations' into 'master'
g-i: add missing since annotations

See merge request GNOME/gtk!4154
2021-11-16 21:34:58 +00:00
Matthias Clasen
d9d220cfc9 Merge branch 'wip/carlosg/x11-wm-drags' into 'master'
gtkmain: Disable implicit grab active state on CROSSING_GRAB leave events

Closes #4416

See merge request GNOME/gtk!4162
2021-11-16 17:21:38 +00:00
Matthias Clasen
2026256823 Merge branch 'compose-cache-symlinks' into 'master'
composetable: invalidate cache based on symlink mtime too

See merge request GNOME/gtk!4163
2021-11-16 17:21:04 +00:00
Matthias Clasen
012baeb909 Merge branch 'wip/carlosg/cancelled-gestures' into 'master'
gtkwidget: Do not check event sequence state before cancelling gesture

Closes #4387

See merge request GNOME/gtk!4160
2021-11-16 17:19:55 +00:00
Emmanuele Bassi
c4b2fe6ee5 docs: Add blurb for GtkEditableProperties. 2021-11-16 13:50:52 +00:00
Emmanuele Bassi
cea320af24 docs: Fix description for CellRendererAccelMode
Link to the property, instead of copy-pasting its description.
2021-11-16 13:41:52 +00:00
Emmanuele Bassi
a5bf0591ee docs: Fix link in GtkSymbolicColor description 2021-11-16 13:37:33 +00:00
Naïm Favier
22f5236943
composetable: invalidate cache based on symlink mtime too
When the compose file is a symbolic link, take the link itself's
modification time into account (in addition to its target's) in
determining whether to invalidate the compose cache.

This is useful e.g. on NixOS systems where the compose file might point
to a store path with an irrelevant modification time, and we want the
cache to expire when the symlink itself changes.
2021-11-16 12:53:38 +01:00
Carlos Garnacho
f84bcfbb97 gtkmain: Disable implicit grab active state on CROSSING_GRAB leave events
This grab-induced crossing event may come from outer means while there are
buttons pressed (e.g. WM window drags/resizes in X11), the implicit active
state should be undone in that situation.

Also, separate the handling of GDK_LEAVE_NOTIFY, as it's fundamentally
different from GDK_TOUCH_END/CANCEL handling.

Fixes: https://gitlab.gnome.org/GNOME/gtk/-/issues/4416
2021-11-16 10:58:03 +01:00
Carlos Garnacho
f36ee67226 gtkgesture: Do not cancel gesture when setting DENIED state
Touchpoint state and tracking are tangential, this is mixing up both.
This change was added in the fixes for
https://gitlab.gnome.org/GNOME/gtk/-/issues/3016 but is now unnecessary.
2021-11-16 00:47:57 +01:00
Carlos Garnacho
615b8fc569 gtkwidget: Do not check event sequence state before cancelling gesture
The sequence should be cancelled from the gesture despite its current state.
Also, there was a piece of pointer emulation that was not dropped here,
maybe breaking things further for the pointer emulated touchpoint.

Fixes: https://gitlab.gnome.org/GNOME/gtk/-/issues/4387
2021-11-16 00:41:17 +01:00
Emmanuele Bassi
ff3bb7f671 docs: Annotate Label.get_selection_bounds() out arguments
They are optional, and should be marked as such.

See issue: #4452
2021-11-15 15:35:13 +00:00
Bilal Elmoussaoui
40c08954db g-i: add missing since annotations 2021-11-13 17:50:53 +01:00
Benjamin Otte
7f7809f523 label: Don't do more work than necessary
We only want to determine the size pixel-exact, not pango-unit-exact, so
don't spend lots of time wondering if text is half a pixel or a quarter
pixel wider.
2021-11-11 05:24:58 +01:00
Benjamin Otte
46f8600b6a css: Don't crash when color stop offsets descend
Testcase included.

Fixes #4424
2021-11-10 17:28:14 +01:00
Benjamin Otte
1e47b1c610 label: Handle width-chars > text width
This was broken in wrapping labels.

Testcase included.
2021-11-09 18:34:35 +01:00
Matthias Clasen
bf40b89b53 Merge branch 'wip/jimmac/unfocused-selections' into 'master'
styling: Have unfocused selections

Closes #4393

See merge request GNOME/gtk!4113
2021-11-09 11:34:37 +00:00
Benjamin Otte
76c4673944 boxlayout: Fix broken min-size-for-opposite-size
Assume a vbox with 2 wrapping labels saying
  Hello World
  Hi Ho
being measured for their minimum width for 3 rows of text.
This should be layouted like
  Hello
  World
  Hi Ho
and measured accordingly.

However, previously this was layouted as
  Hello World
  Hi Ho
with 1.5 lines being assigned to both labels.
That will obviously not compute the above wrapping which clearly
results in a smaller min width.

A reftest testing exactly this was included.
2021-11-09 03:41:43 +01:00
Benjamin Otte
0a31201c88 boxlayout: Split loop into if statmement
Turns it into 2 loops, one for the homogeneous part and one for the
complicated part.
2021-11-09 03:41:43 +01:00
Benjamin Otte
afe94e303a boxlayout: Don't listen to comments
... when they are wrong.

Instead, remove them.

Or in other words: GTK4 does not have a fill child property anymore, so
we don't need to run the measuring loop above to determine the size.
2021-11-09 03:41:43 +01:00
Benjamin Otte
b004706009 Revert "sizerequest: Only check reported baselines if requested"
This reverts commit cf7fa931d3.

We store the baseline in the cache and we do not know if baselines might
be queried in the future. So always store them.

No reftest because I don't know how to write one.

premature optimization == √😈
2021-11-09 03:41:43 +01:00
Benjamin Otte
81169d18c3 label: max-width-chars should be ignored sometimes
When a widget is neither wrappable nor ellipsizable, we cannot modify
the label to fit into any size. So we cannot respect max-width-chars.
2021-11-09 03:41:43 +01:00
Benjamin Otte
cce6a603a6 label: max-width-chars has no effect on smaller text
Having a short text and a large max-width-chars should request the
natural width of the text, not the limit from max-width-chars.

This caused huge message dialogs.

Reftests added.
2021-11-09 03:41:43 +01:00
Matthias Clasen
60c45dac56 css: Change the way case variants are handled
Instead of translating font-variant-caps directly
to OpenType features, translate them to a PangoVariant,
now that that enumeration reflects all the css values.

This allows pango to emulate Small Caps for fonts that
don't support the OpenType feature.
2021-11-08 14:17:42 -05:00
Matthias Clasen
7bee4fa44b Handle new pango api
The PangoVariant enumeration has gained new values
to match css. Handle those in switches.
2021-11-08 14:17:42 -05:00
Matthias Clasen
4c029af6cd textview: Don't leave embedded children behind
When scrolling embedded widgets out of view,
they sometimes get left behind because we don't
reallocated them. To avoid that, move _all_ children
out of view in size_allocate, and let the current
child allocation plumbing move the visible ones
back in place.
2021-11-08 14:17:42 -05:00
Matthias Clasen
1c6efea370 Remove a confusing comment
It talks about propagating to unanchored children,
but then iterates over anchored_children. That does
not add up.
2021-11-08 14:17:42 -05:00
Emmanuele Bassi
018388d321 Unrealize ATContext on unroot
Non-root widgets should unrealize their ATContext, if they have one,
when they are unrooted, as they don't have a connection to a top level
any more.

Fixes: #4421
2021-11-08 10:18:22 +00:00
Emmanuele Bassi
59f45aa30c docs: Fix wrong fragments in type links
Due to a bug in gi-docgen we're not getting a warning if a fragment to a
type does not match the actual type, and we're generating a broken link.

See: https://gitlab.gnome.org/GNOME/gi-docgen/-/merge_requests/120
2021-11-07 18:40:24 +00:00
Marco Melorio
da72cfea40 docs: Tag Gdk.ModifierType as flags 2021-11-07 18:14:15 +01:00
Benjamin Otte
4f4f2d169a Merge branch 'wip/otte/for-master' into 'master'
boxlayout: Be more careful with what to consider natural size

See merge request GNOME/gtk!4129
2021-11-06 03:54:08 +00:00
Benjamin Otte
222d6f1db1 label: Don't deduce label width from logical rect
The width of a logical rect after line breaking is sometimes not
wide enough to cause line breaking to break at the exact same points.
(Is that by design or a bug in Pango? I don't know.)

So don't use the width, and only relyon values we actually set to
pango_layout_set_width().
2021-11-06 03:15:04 +01:00
Benjamin Otte
4ffa60be50 boxlayout: Be more careful with what to consider natural size
Don't just use the natural size as the max size, the natural size
is the ideal size, not necessarily the maximum size.

Also check the nat size for opposite min size.
2021-11-06 00:56:55 +01:00
Matthias Clasen
7da72d1295 Merge branch 'remove_some_unused_declarations' into 'master'
remove some unused declarations

See merge request GNOME/gtk!4125
2021-11-05 23:08:56 +00:00
Matthias Clasen
c9735e8ea9 Merge branch 'wip/baedert/for-master' into 'master'
paned: Don't pass values < -1 to gtk_widget_measure()

Closes #4404

See merge request GNOME/gtk!4126
2021-11-05 23:08:28 +00:00
Benjamin Otte
8a7868d006 Merge branch 'wip/otte/for-master' into 'master'
Revert "label: Never measure more than max-width-chars"

Closes #4399

See merge request GNOME/gtk!4120
2021-11-05 22:11:00 +00:00
Benjamin Otte
c4e5242be0 picture: Setting can-shrink requires a resize
So queue one.
2021-11-05 20:51:00 +01:00
Benjamin Otte
5c9ae28937 boxlayout: Compute opposite size properly
For size -1 in the opposite orientation, GtkBoxLayout used to measure
the children based on their min size in the box's orientation instead of
-1. That wasn't really intended, but was a side effect of how the sizing
code did (not) distribute extra size above the minimum size.

This is clearly not what we want.
What we want is measuring the orientation as is for size -1. Then we
want to just take the maximum of all children and use that.

A reftest is incldued that ensures a vbox wraps a label just like an
hbox does.
2021-11-05 20:30:49 +01:00
Benjamin Otte
8e27fc7f9b label: Redo measure() code
The old code couldn't properly do height-for-width because it only
computed the widest and smallest layout instead of looking at the actual
passed in for-size.

The label-sizing reftest has been adapted as the label code is now smart
enough to always display the whole text and no longer requests a too
small width-for-single-row when wrapping.
2021-11-05 20:29:42 +01:00
Timm Bäder
c87d1c2fb9 paned: Don't pass values < -1 to gtk_widget_measure()
Fixes #4404
2021-11-05 17:41:42 +01:00
Caolán McNamara
c66d24b41a remove some unused declarations 2021-11-05 14:03:47 +00:00
Caolán McNamara
155b791d43 update focus indicators in popovers
https://gitlab.gnome.org/GNOME/gtk/-/issues/4383
2021-11-05 13:50:48 +00:00
Benjamin Otte
53acff167b Revert "label: Never measure more than max-width-chars"
This reverts commit ba44e7a228.

The change was meant to revert to old GTK3 behavior but it actually
broke new GTK4 behavior that is in use where max-width-chars is used to
determine an ideal size, but where we don't want to limit the width to
that size.

So what happens is the reintroduction of GTK3-style lots of whitepsace
bugs, and we really don't want those.

We also don't want to break backwards compat if we can avoid it.

So let's revert this.

The reftest that was made for this purpose has been adapted.

Fixes #4399
2021-11-05 06:12:33 +01:00
Emmanuele Bassi
a1861112ee build: Don't use ld when cross-compiling
We can't guarantee anything on the target toolchain, in that case.
2021-11-04 13:41:35 +00:00
TAO ZUHONG
db2a03ed33 Update gtk/ui/gtkdialog.ui 2021-11-04 08:25:03 +00:00
TAO ZUHONG
9e8bf10653 Make dialog content_area box as vertical, keep compatibility with GTK3 2021-11-04 08:23:04 +00:00
Matthias Clasen
c20a631ab7 Merge branch 'listview-sink-adjustment' into 'master'
listbase: Sink adjustments

Closes #4403

See merge request GNOME/gtk!4117
2021-11-04 01:58:56 +00:00
Matthias Clasen
3c2818b30a listbase: Sink adjustments
gtk_adjustment_new returns floating objects.
Sink them.

Fixes: #4403
2021-11-03 21:09:37 -04:00
Maximiliano Sandoval R
0aa3a7e71c
combo_box: Use mnemonic_activate on override
This is changing the existing behavior where the mnemonic activation
would just grab the focus of the button, this was the behavior in GTK 3.
2021-11-04 00:48:05 +01:00
Maximiliano Sandoval R
3918cdd989
dropdown: Make DropDown activatable
The activation is simply forwarded to the button
within.
2021-11-04 00:47:02 +01:00
Maximiliano Sandoval R
c4df987eef
combobox: Make combo box activatable
The activation is simply forwarded to the button
within.
2021-11-04 00:46:47 +01:00
Jakub Steiner
96f63a6bf3 styling: Have unfocused selections
Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/4393
2021-11-03 13:08:01 +01:00
Tobias Bernard
9b23602806 icon: revert object-symbolic check to be smaller
The larger check works well in the headerbar, but not inline in various UI elements. This reverts the larger check since the latter is more common. For selection mode, a separate larger icon (selection-mode-symbolic) has been added to adwaita-icon-theme.
2021-11-01 18:54:22 +01:00
Emmanuele Bassi
5cc6b3e342 docs: Add missing annotation 2021-11-01 12:54:35 +00:00
Alexandros Theodotou
266fceddf0
fix typo in GtkDragSource doc
GtkDrag => GdkDrag
2021-11-01 03:48:52 +00:00
Bilal Elmoussaoui
d1e246c68d gtk: fix broken gi-docgen annotation in IconView 2021-10-30 09:37:12 +00:00
Bilal Elmoussaoui
13defc7ceb gtk: remove unneeded backtick from gi-docgen item 2021-10-29 18:32:06 +00:00
Matthias Clasen
031c37c7b0 theme: Remove GtkToolbar remnants
We don't ship a widget with css name 'toolbar'
anymore, so don't waste selectors on it.
2021-10-29 11:51:18 -04:00
Matthias Clasen
860821114a Don't make all buttons in toolbars flat
When a combobox is put in a toolbar, we don't want
its button to lose its border.

Fixes: #4384
2021-10-29 11:51:18 -04:00
Benjamin Otte
c97a758aa7 cssparser: Remove unused argument
The base_directory argument is never used. So don't have it.
2021-10-28 03:19:08 +02:00
Matthias Clasen
68eb601194 Merge branch 'gtkeventcontroller.c-fix' into 'master'
master: premature controller unreferencing in gtk_event_controller_handle_event

See merge request GNOME/gtk!4099
2021-10-27 23:50:13 +00:00
Maxim Zakharov
af2d0f188c gtk: Hold reference on controller until events are fully handled
Fixes premature controller unreferencing in
gtk_event_controller_handle_event() if the controller itself is being
removed while handling the event.
2021-10-28 10:23:32 +11:00
Benjamin Otte
ac8c4245b2 css: Don't throw warnings on broken URL in image css
If a URL can't be loaded, we might end up with a NULL file. Handle that
case properly by creating an invalid image instead and don't crash or
complain to stderr when files are NULL.

This was broken since 0886ade182

A new reftest has been included. We need a reftest instead of a
CSS parser test, because the error only becomes visible when
compute()ing the actual image.

Fixes #4373
2021-10-26 23:52:38 +02:00
Matthias Clasen
4ea84d3144 Merge branch 'bilelmoussaoui/missing-since-annotations' into 'master'
since annotations cleanup

See merge request GNOME/gtk!4086
2021-10-26 17:53:06 +00:00
Alexander Mikhaylenko
83319a3ea6 inspector: Expand the controllers column view 2021-10-24 22:27:50 +05:00
Alexander Mikhaylenko
516dc79605 inspector: Use .list for property list as well 2021-10-24 22:27:50 +05:00
Alexander Mikhaylenko
2aa2b7f61e inspector: Clean up the .list style
Make it work with the property list as well, handle spinbuttons, adjust
paddings so that buttons don't touch each other, don't override horizontal
padding unnecessarily.
2021-10-24 22:27:24 +05:00
Alexander Mikhaylenko
0053160f28 inspector: Stop using .sidebar for the recorder page
Those aren't sidebars. Add separators manually instead of misusing the
style class.
2021-10-24 04:01:35 +05:00
Alexander Mikhaylenko
2ac8132499 inspector: Use consistent GtkTextView margins 2021-10-24 03:58:21 +05:00
Alexander Mikhaylenko
7aa34cb3d2 inspector: Add a separator under toolbar in css editor
Same as object properties.
2021-10-24 03:55:26 +05:00
Alexander Mikhaylenko
3aee23c172 inspector: Use tabular figures for list position label
Avoid buttons jumping around while moving through list models.
2021-10-24 03:37:01 +05:00
Alexander Mikhaylenko
bec9141233 inspector: Use .toolbar for toolbars
Remove all of the manual margins, spacing and has-frame=0, be more
consistent.
2021-10-24 03:37:01 +05:00
Alexander Mikhaylenko
131683fdcf inspector: Use a GtkSeparator for the object details toolbar
Remove a hardcoded light grey border from the sidebar that was used for
this.
2021-10-24 02:53:22 +05:00
Alexander Mikhaylenko
8176b0c2fc inspector: Remove list header style
The one from the theme works just fine.
2021-10-24 02:51:07 +05:00
Benjamin Otte
2b2fd23815 Merge branch 'wip/otte/center-center-center' into 'master'
Add a bunch of reftests and fix their failures

Closes #4285

See merge request GNOME/gtk!4085
2021-10-22 16:35:41 +00:00
Benjamin Otte
1606a41116 widget: adjust allocation even better
This fixes fallout from 3742fabae0 where
we would no longer allocate widgets to their natural size when
align flags where used.

GtkPicture wants to be allocated at 100% in that case, so a picture with
a 100x100 image inside a 200x200 window should be allocated 100x100.

The new adjustment code now does the following (for width-for-height
instead of height-for-width, swap width and height in the following):

1. query the minimum width for the allocated height
2. query the natural width
3. compute the maximum of (1) and (2)
4. set the widget width to the minimum of (3) and the allocated
   width.
5. compute the natural height for (4)
6. set the widget height to the minimum of (5) and the allocated height.
2021-10-22 17:51:40 +02:00
Bilal Elmoussaoui
cb3eae1042 g-i: add missing since 4.6 annotations 2021-10-21 15:34:39 +01:00
Benjamin Otte
350a5edb87 css: Emit a special error for a common error
This CSS:
  calc(5px+3px)
is wrong because it gets broken to:
  calc(  5px  +3px  )
which is 2 numbers inside the calc, and what you want is:
  calc(  5px  +  3px  )
but you need to add a space to get this, like so:
  calc(5px + 3px)
which is the recommended way to write calc() statements.

So whenever we encounter an error, check if the next token is a signed
number and if so, include it in the error message.
2021-10-21 00:16:20 +02:00
Benjamin Otte
c11bd57422 css: Split dimension token
Add a signed and an unsigned version.

This will become useful real soon.
2021-10-21 00:16:20 +02:00
Matthias Clasen
14e6d9555d Merge branch 'setlocale-gapplication-help' into 'master'
GtkApplication: Call setlocale early

Closes #4234

See merge request GNOME/gtk!3928
2021-10-19 02:48:41 +00:00
Matthias Clasen
46ba4b9d8c Merge branch 'fix-win11-sdk' into 'master'
Fix building against the Windows 11 SDK (GTK master/4.x)

See merge request GNOME/gtk!4063
2021-10-19 02:42:15 +00:00
Matthias Clasen
464f76ce5d Merge branch 'line-height-percentage' into 'master'
css: Fix handling of percentage for line-height

Closes #3254 and #4354

See merge request GNOME/gtk!4075
2021-10-19 02:41:09 +00:00
Matthias Clasen
9965f26d97 Merge branch 'wip/exalm/levelbar' into 'master'
levelbar: Fill the whole space for discrete level bars

See merge request GNOME/gtk!4042
2021-10-19 02:40:26 +00:00
Benjamin Otte
bf5350e13c Merge branch 'label-sizing' into 'master'
Make label-sizing reftest pass

See merge request GNOME/gtk!4076
2021-10-19 00:19:52 +00:00
Benjamin Otte
3742fabae0 widget: Don't overadjust allocations
When adjusting allocations, don't query height for the current width,
but query it for the adjusted width.

And adjust width not to the width-for-any-height, but to
width-for-allocated-height.
2021-10-19 01:55:59 +02:00
Benjamin Otte
ba44e7a228 label: Never measure more than max-width-chars
Even when we have tons of width available, still do the wrapping at
max-width-chars.

This is what happened in GTK3, too, but it happened automatically
because GTK3 did for_size = MIN (for_size, nat_size) and GTK4 does not.

So we do this manually in the label now.

Fixes the label-sizing.ui reftest.
2021-10-19 01:04:25 +02:00
Alexander Mikhaylenko
1c5a4de176 levelbar: Fill the whole space for discrete level bars
Ideally this would be using box layout, but it overrides measure() so it's
not possible - so reimplement it instead. Fix an accidentally int division
along the way.
2021-10-19 02:13:49 +05:00
Emmanuele Bassi
ad46e65dff Merge branch 'wip/cdavis/flowbox-add-functions' into 'master'
gtkflowbox: Add prepend() and append()

Closes #4277

See merge request GNOME/gtk!4013
2021-10-18 21:09:10 +00:00
Matthias Clasen
5dec1b0cc0 Merge branch 'wip/baedert/for-master' into 'master'
Some fixes, hmm yes

See merge request GNOME/gtk!4068
2021-10-18 20:58:46 +00:00
Matthias Clasen
c80e877c28 css: Fix handling of percentage for line-height
We weren't doing the right thing here.
This is simpler, and works.

Fixes: #4354
2021-10-18 16:53:46 -04:00
Matthias Clasen
5ff9f4a435 Merge branch 'matthiasc/for-master' into 'master'
Small fixes

Closes #4248

See merge request GNOME/gtk!4072
2021-10-18 18:00:33 +00:00
Matthias Clasen
bd1649e5f4 Merge branch 'feature/calendar-first-day' into 'master'
calendar: Fix abbreviated day names

Closes #4338

See merge request GNOME/gtk!4061
2021-10-18 15:08:35 +00:00
Matthias Clasen
bddf9f9ca3 docs: Cosmetics
Do a round of "the the" removal.
2021-10-18 08:35:54 -04:00
Timm Bäder
085f0171c1 Ensure blur nodes have a positive blur radius 2021-10-17 12:15:34 +02:00
Timm Bäder
e7ac8275ea main: Flip set_widget_active_state() logic
The function used to take a boolean, just to set the active state of the
widget to the exact opposite of that boolean. Fix that.
2021-10-17 11:21:00 +02:00
Timm Bäder
03d4ac1863 theme: enable tabular numbers in GtkCalendar
It aligns numbers a lot so this makes sense.
2021-10-17 11:12:14 +02:00
Timm Bäder
beda50f631 cssparser: Make a signed expression unsigned 2021-10-17 11:12:14 +02:00
Chun-wei Fan
3481ebdafb gtk: Fix version resource on for Windows 11 SDK
The rc.exe that comes with the Windows 11 SDK does not allow one to include
winuser.h directly in the .rc scripts, so make sure that it is not included
by gtk-win32.rc.body.in, but instead include windows.h with WIN32_LEAN_AND_MEAN
defined.
2021-10-13 12:21:10 +08:00
Christopher Davis
454ca897bb gtkflowbox: Add prepend() and append()
These functions are common across container implementations,
but GtkFlowBox was missing them.

Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/4277
2021-10-12 11:07:17 -07:00
Niels De Graef
41ca09d645 calendar: Add an explanatory comment
On the magic numbers used to get the abbreviated day names.
2021-10-12 19:37:13 +02:00
Niels De Graef
dcbfd61558 calendar: Fix abbreviated day names
... if the current locale has a different starting day than Sunday.

This needed 2 fixes:
* We need to take into account `calendar->week_start` when
  creating/adding the appropriate `day_name_labels` field
* we were only calculating `calendar->week_start` _after_ attaching the
  `day_name_labels`, so it was still set to 0 (the default value).

Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/4338
2021-10-12 19:29:26 +02:00
Bilal Elmoussaoui
257adb4464 gtk: fix Snapshot.push_shadow annotation 2021-10-12 09:00:03 +00:00
Matthias Clasen
49a64da7ec Merge branch 'ngl-is-the-new-gl' into 'master'
Rename ngl to gl

Closes #4318

See merge request GNOME/gtk!4037
2021-10-11 06:43:41 +00:00
John Ralls
cfadca696b [gtkimcontextquartz] Accommodate moving GdkSurface widget to private.
Fixes macOS build.
2021-10-10 13:16:49 -07:00
Benjamin Otte
8c1f7f7531 glcontext: Deprecate gdk_gl_context_set_use_es()
Make it call gdk_gl_context_set_allowed_apis().

Also port callers to use this function.
2021-10-08 03:31:07 +02:00
Benjamin Otte
222d927e93 Merge branch 'wip/otte/for-master' into 'master'
css: Render the background-clip area, not the background-origin

Closes #4324

See merge request GNOME/gtk!4043
2021-10-07 19:11:28 +00:00
Benjamin Otte
30164d5b46 css: Render the background-clip area, not the background-origin
Testcase included

Fixes #4324
2021-10-07 19:59:44 +02:00
Matthias Clasen
f868c67429 Skip gsk_ngl type funcs
The only type we have with this prefix is the
deprecated duplicate of gsk_gl_renderer_get_type(),
and including it causes some tests to break.
So skip it.
2021-10-07 13:05:53 -04:00
Matthias Clasen
144f727d5a Rename ngl to gl
We have only one gl renderer now, and it is
a bit odd for it not be called gl.
2021-10-07 13:05:53 -04:00
Christopher Davis
0775e21131 Add support for pango markup in menu items
Before c4a2234a28
menu models could use markup for items and the markup would
be parsed, but this was not intended behavior.

This commit adds official support for using markup
for menu items via the `use-markup` property.

Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/4306
2021-10-07 02:49:11 -07:00
Matthias Clasen
c7d6bf733a filechooserportal: Take a ref on transient-for
This may fix a crash that has been reported in
file_chooser_portal_data_free.

Fixes: #4314
2021-10-06 22:37:45 -04:00
Christian Hergert
cd2debdfc6 dropdown: fix extraneous * in documentation 2021-10-06 09:56:11 -07:00
Christian Hergert
cd45e6edee dropdown: add GtkDropDown:show-arrow property
This allows hiding the arrow on the dropdown which cannot otherwise be
controlled via CSS.
2021-10-06 09:55:40 -07:00
Matthias Clasen
0969d9db83 Merge branch 'wip/otte/gl-hdr' into 'master'
Rework GL for HDR support

See merge request GNOME/gtk!4032
2021-10-06 02:59:05 +00:00
Benjamin Otte
c8204a902c surface: Add a private struct
Adding a random member to it resulted in a lot of header surgery as a
side effect.
2021-10-06 03:43:47 +02:00
Matthias Clasen
3f5107cea5 inspector: Export gtk_inspector_init
Quietly export this function mainly for the benefit
of libadwaita, which can can use this to install its
implementation of the gtk-inspector-page extension
point.
2021-10-05 20:10:34 -04:00
Benjamin Otte
75370a2fee pathbar: Use correct marshaler
Recent changes to types didn't update the marshaler. Oops.
2021-10-05 04:48:15 +02:00
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