Commit Graph

81568 Commits

Author SHA1 Message Date
Matthias Clasen
cefaec5d6f node-editor: Add Ctrl-Shift-V
Make Ctrl-Shift-V trigger a 'paste-as-node' action which replaces
the current content with the render node in the clipboard.
2024-08-18 15:44:40 -04:00
Matthias Clasen
29b6eab0ea inspector: Add some shortcuts
While the inspector is open, look for some shortcuts:

Super-r to toggle recording
Super-c to take a screenshot

A screenshot here means just a single-frame recording.
For convenience, we put the recorded frame onto the
clipboard too.
2024-08-18 15:44:40 -04:00
Matthias Clasen
360674f523 inspector: Add a snapshot function
Add a function that records just a single frame, and puts it
on the clipboard.
2024-08-18 15:44:40 -04:00
Matthias Clasen
7900f91e46 widget: Record event traces
Use the newly introduced inspector api to add event traces.
2024-08-18 15:44:40 -04:00
Matthias Clasen
e4248503cf inspector: Add event traces
When recording events, make it possible to add 'traces' of the
events journey, and show those in the recorder.
2024-08-18 15:44:40 -04:00
Matthias Clasen
168bab34f7 inspector: Simplify
We can just put the render node on the clipboard directly, no
manual serialization required.
2024-08-18 15:44:40 -04:00
Matthias Clasen
46e7ea8c1e Fix a misleading comment 2024-08-18 15:44:40 -04:00
Matthias Clasen
1ce7de0fb8 Cosmetics 2024-08-18 10:44:38 -04:00
Matthias Clasen
d9a0f3cfe2 Merge branch 'matthiasc/for-main' into 'main'
node parser: Move parse_color even earlier

See merge request GNOME/gtk!7625
2024-08-17 23:35:44 +00:00
Matthias Clasen
200cec3321 inspector: Minor GdkRGBA -> GdkColor porting 2024-08-17 18:56:05 -04:00
Matthias Clasen
d4e730db0c node parser: Move parse_color even earlier
It will be used by parse_stops in the future, so move it above.

No functional change.
2024-08-17 16:24:20 -04:00
Benjamin Otte
ca78d845df Merge branch 'wip/otte/for-main' into 'main'
gsk: Don't print any sRGB color as rgb() or rgba()

See merge request GNOME/gtk!7624
2024-08-17 20:19:01 +00:00
Benjamin Otte
9ff31dd29b testsuite: Improve testcase
This should have gone into !7619 but gitlab managed to finish the CI run
just as I was pushing a new version to the MR with
merge_request.merge_when_pipeline_succeeds and apparently gitlab applied
that to the previous version or something.

So now that MR merged an incomplete version to main. And here's the fix
for that.
2024-08-17 21:31:14 +02:00
Benjamin Otte
0815359a20 Merge branch 'wip/otte/for-main' into 'main'
gsk: Don't print any sRGB color as rgb() or rgba()

See merge request GNOME/gtk!7619
2024-08-17 19:28:07 +00:00
Benjamin Otte
96139a902d gsk: Don't print any sRGB color as rgb() or rgba()
If the color value is not inside the proper range for rgb() or rgba()
values being integers, use color() instead.

Tests added/adapted.
2024-08-17 21:09:25 +02:00
Benjamin Otte
a6233ac852 rendernodeparser: Check color values aren't out of range
Use the clamp() API from the previous commit to:

1. Clamp values into range
2. Emit an error if values were out of range

Unlike CSS, which just clamps and doesn't emit an error, we do want to
emit one because we care about colors being correct in our node files.
2024-08-17 18:12:23 +02:00
Matthias Clasen
4e9ebb5299 gdk: Add gdk_color_state_clamp()
Allows clamping values into the correct range to construct valid colors.
2024-08-17 18:12:23 +02:00
Benjamin Otte
585f31fa2e rendernodeparser: Rename function
There's no need to name a function parse_color2() when parse_color()
doesn't exist.
2024-08-17 16:03:46 +02:00
Benjamin Otte
69e7838461 rendernodeparser: Don't have unnecessary forward declarations
Reorders functions to not have them.

No functional changes.
2024-08-17 16:03:46 +02:00
Matthias Clasen
3fe3800b7c Merge branch 'small-scale' into 'main'
monitor: Don't forbid scales < 1

Closes #6928

See merge request GNOME/gtk!7623
2024-08-17 13:22:15 +00:00
Matthias Clasen
491275b444 Merge branch 'radiobutton-focus' into 'main'
checkbutton: Add a 'grouped' style class

Closes #6936

See merge request GNOME/gtk!7622
2024-08-17 12:44:35 +00:00
Matthias Clasen
1cd107d5ab monitor: Don't forbid scales < 1
With fractional scaling, people try out things like 0.75 scaling,
and there's no reason for us to prohibit that from working.

Fixes: #6928
2024-08-17 08:26:55 -04:00
Matthias Clasen
5af2d95bff checkbutton: Add a 'grouped' style class
This will make it easier for themes to style radio buttons
differently from check buttons, since out CSS does not have
:has().

The concrete desire here is to use a different outline for
the focus rectangle.

Update affected tests.

Fixes: #6936
2024-08-17 08:22:54 -04:00
Benjamin Otte
62f5db06a1 Merge branch 'fix-opaque-surface-crash' into 'main'
Avoid a crash in gdk_surface_is_opaque

Closes #6938

See merge request GNOME/gtk!7621
2024-08-17 11:26:27 +00:00
Matthias Clasen
e32a12f877 Avoid a crash in gdk_surface_is_opaque
Nothing in gtk calls gdk_surface_set_opaque_region anymore, so
the opaque region will normally be NULL.

Fixes: #6938
2024-08-17 07:03:57 -04:00
Ekaterine Papava
584733f034 Update Georgian translation 2024-08-17 03:49:13 +00:00
Matthias Clasen
c3c1819e12 Merge branch 'css-variables-fixes2' into 'main'
css: Set the parent of the variable set earlier

Closes #6881

See merge request GNOME/gtk!7618
2024-08-16 16:52:34 +00:00
Matthias Clasen
3f36ebc6e7 Merge branch 'matthiasc/for-main' into 'main'
textview: Fix a regression in selection drawing

Closes #6931

See merge request GNOME/gtk!7620
2024-08-16 16:06:14 +00:00
Matthias Clasen
4aea2d2e09 css: Don't pass style variables redundantly
The context->variables field is expected by the resolve code to be
the keyframe variables. That code takes the style variables from
context->style anyway, so no need to pass them as context->variables
too. And crucially, the lookup code treats the keyframes variables
differently to the style variables, since it doesn't expect the
hierarchical structure that comes from parent styles. This change
fixes infinite recursion in variable lookup with css like

:root {
  --a: var(--b);
}

.foo {
  --b: var(--a);
  color: var(--a);
}

Test included.

Fixes: #6881
2024-08-16 11:38:56 -04:00
Matthias Clasen
4e9107d4b1 widget: Fail properly in compute_transform
We don't currently support computing transforms across native
boundaries. This could be added by using gdk_popup_get_position_x/y.
For now, just fail in this case.

Related: #6355
2024-08-16 10:07:53 -04:00
Matthias Clasen
7d895720be textview: Fix a regression in selection drawing
We were no longer respecting the text color or the selection being
clear.

Fixes: #6931
2024-08-16 08:44:35 -04:00
Benjamin Otte
323dde2b10 Merge branch 'wip/otte/for-main' into 'main'
wayland: Implement GdkToplevel::decorated

See merge request GNOME/gtk!7617
2024-08-16 00:01:54 +00:00
Benjamin Otte
ac16e375c7 wayland: Implement GdkToplevel::decorated
... and use that instead of custom announce_csd/announce_ssd APIs.
2024-08-16 01:38:55 +02:00
Matthias Clasen
31143f9611 Merge branch 'kjellahl/docs-window' into 'main'
docs: Improve gtk_window_set_interactive_debugging() docs

See merge request GNOME/gtk!7614
2024-08-15 16:57:00 +00:00
Matthias Clasen
7da4844dcc Merge branch 'css-variables-crash' into 'main'
css: Fix a crash in variables

Closes #6935

See merge request GNOME/gtk!7615
2024-08-15 15:15:48 +00:00
Matthias Clasen
c9e4abcd3a css: Fix a crash in variables
We were not careful enough when checking for reference cycles.

Fixes: #6935

Test included.
2024-08-15 10:16:47 -04:00
Matthias Clasen
6e80fde45f Merge branch 'accessibility-docs-fix' into 'main'
docs: Fix a typo in a code example on the accessibility page

See merge request GNOME/gtk!7616
2024-08-15 13:49:29 +00:00
Philip Withnall
d182b133a9
docs: Fix a typo in a code example on the accessibility page
Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2024-08-15 14:18:31 +01:00
Matthias Clasen
5e3240a32f Merge branch 'matthiasc/for-main' into 'main'
colorstate: Don't leak names

See merge request GNOME/gtk!7611
2024-08-14 18:06:36 +00:00
Matthias Clasen
436989d745 gsk: Apply the same transfer fixes
These are copied from gdkcolordefs.h.
2024-08-14 13:21:28 -04:00
Matthias Clasen
f62606105e Fix up transfer function symmetry
The easiest things trigger the silliest mistakes. Add tests
for various properties we want our transfer functions to have,
such as:
- be inverse of each other
- stay within the defined ranges
- by symmetric around 0
2024-08-14 11:45:25 -04:00
Matthias Clasen
0f85a40a25 colorstate: Plug a leak and allocate less
We don't need to allocate the matrices, but we do neet to free
the name of cicp color states.
2024-08-14 11:00:10 -04:00
Matthias Clasen
16ad1e428f colorstate: Don't leak names
The cicp colorstates allocate their names, so they should free
them too.
2024-08-14 11:00:10 -04:00
Matthias Clasen
a6e0028899 Merge branch 'wip/otte/for-kwin' into 'main'
Fix various issues with Kwin git

See merge request GNOME/gtk!7612
2024-08-14 14:58:08 +00:00
Kjell Ahlstedt
dc3def1afd docs: Improve gtk_window_set_interactive_debugging() docs
This function is recommended only if you override the default
key shortcuts for the Inspector.
2024-08-14 16:57:55 +02:00
Kjell Ahlstedt
a14e426fb5 docs: Improve gtk_window_set_interactive_debugging() docs
This function is recommended only if you override the default
key shortcuts for the inspector.
2024-08-14 15:51:56 +02:00
Bruce Cowan
a1a4026867 Update British English translation 2024-08-14 10:27:24 +00:00
Benjamin Otte
aff1b88c92 wayland: Work where the primaries have no name
Set primaries without name if supported, when named primaries are not.
But prefer named primaries if available.

This is just an attempt at defensive coding.
2024-08-14 08:30:55 +02:00
Benjamin Otte
dc072f881c wayland: Accept primaries/primaries_named interchangably
If we get sent primaries with the values as named primaries, treat them
like named primaries.

Fixes colorstate support on Kwin, which never sends named primaries.
2024-08-14 08:30:55 +02:00
Benjamin Otte
824ccfc562 gpu: Add an assertion
If the wrong color states get passed, we need to figure that out, before
we run shaders with junk values doing god knows what.
2024-08-14 08:30:55 +02:00