Commit Graph

77928 Commits

Author SHA1 Message Date
Benjamin Otte
5152c13081 vulkan: Change rounded_rect_shrink()
Same fix as with the GL renderer
2023-09-15 16:34:00 +02:00
Benjamin Otte
e9089f65e3 gl: Change rounded_rect_shrink()
The code now follows gsk_rounded_rect_shrink() and with it the behavior
of the Cairo renderer and Webkit.

The old code did what the GL renderer and Cairo do, but I consider that
wrong.

I did not test Chrome.

Test attached
2023-09-15 16:34:00 +02:00
Benjamin Otte
9aaec91f95 css: Snapshot opacity filter as opacity node
We were using color-matrix because it was easier, but opacity can often
be optimized when color-matrix needs offscreens.
2023-09-15 03:46:27 +02:00
Benjamin Otte
1c971c595f glrenderer: Shadows without offset do exist
Not for opaque contents, but stuff can be semi-transparent.

Testcase included.
2023-09-15 03:46:27 +02:00
Benjamin Otte
f8627755b5 rendernode: Shadow nodes need offscreen for opacity
Otherwise the shadow will not be properly computed as opaque regions
become translucent after applying opacity.

Testcase included.
2023-09-15 03:46:27 +02:00
Benjamin Otte
55ae8dc39e gsk: Move GskRoundedRect typedef
typedef should go into *types.h headers so that other headers only need
to include those.
2023-09-15 03:46:27 +02:00
Matthias Clasen
dd7d145249 Merge branch 'matthiasc/for-main' into 'main'
gtk-demo: Add sound to the path maze

See merge request GNOME/gtk!6395
2023-09-14 18:24:09 +00:00
Sergey Bugaev
0b2c249de3 switch: Fix CSS nodes documentation
A switch contains two GtkImage's whose nodes are named 'image',
not 'label'.

Signed-off-by: Sergey Bugaev <bugaevc@gmail.com>
2023-09-14 19:35:00 +03:00
Sergey Bugaev
ea6b95f60d switch: Respect text direction
In RTL, we want the active state to mean the handle is on the left.

Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/1489

Signed-off-by: Sergey Bugaev <bugaevc@gmail.com>
2023-09-14 19:35:00 +03:00
Matthias Clasen
ed44f37de4 gtk-demo: Add sound to the path maze
Its a game, after all.
2023-09-14 11:32:22 -04:00
Matthias Clasen
3780a5ed6a Merge branch 'fix_visit_file' into 'main'
gtkfilechooserwidget: fix "Visit file" not scrolling to file

Closes #5799

See merge request GNOME/gtk!6392
2023-09-14 03:01:11 +00:00
Nelson Benítez León
fec3f0191a gtkfilechooserwidget: fix "Visit file" not scrolling to file
In the "Recent" view of GtkFileChooser widget, when right
clicking and selecting "Visit file" action, the action was
failing to scroll to target file.

Fix that by using gtk_column_view_scroll_to() which can
select, focus and scroll to the file.

Fixes #5799
2023-09-13 23:47:47 +01:00
Matthias Clasen
359fa99945 Merge branch 'fun-renderer-bug' into 'main'
gl renderer: Keep track of source

Closes #6094

See merge request GNOME/gtk!6391
2023-09-13 21:31:30 +00:00
Matthias Clasen
5441ed2227 Merge branch 'mcatanzaro/put-event' into 'main'
Fix documentation of gdk_display_put_event()

See merge request GNOME/gtk!6383
2023-09-13 21:27:22 +00:00
Matthias Clasen
ec1a1d0e34 gl renderer: Don't assume an atlas
The source uniform may or may not point
to a glyph atlas. The optimization we do
for color nodes is only possible if it does,
so check this.

Fixes: #6094
2023-09-13 16:56:47 -04:00
Matthias Clasen
8f4fb45715 gl renderer: Keep track of source
We have an optimization that depends on having
the source be a glyph atlas, so keep track of
that information in the render job.
2023-09-13 16:55:01 -04:00
Matthias Clasen
9db2288064 Merge branch 'matthiasc/for-main' into 'main'
rendernode: Fix handling of color glyphs

See merge request GNOME/gtk!6390
2023-09-13 20:14:41 +00:00
Matthias Clasen
1502c21e97 rendernode: Fix handling of color glyphs
The rendernode parser was mixing up its flags.

Test included.

Related: #6075
2023-09-13 15:37:57 -04:00
Matthias Clasen
408dd4b34d Merge branch 'macos' into 'main'
macOS: Clamp damage region to surface size

Closes #5812 and #6038

See merge request GNOME/gtk!6388
2023-09-13 15:33:01 +00:00
Luca Bacci
609e1f54ef macOS: Clamp damage region to surface size
...in _gdk_macos_cairo_context_begin_frame ()

GdkMacosCairoContext needs regions that are clamped to the
actual surface size.

Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/5812
2023-09-13 17:13:33 +02:00
Luca Bacci
f49d0fbbf6 macOS: Fix typos 2023-09-13 16:53:27 +02:00
Michael Catanzaro
dde47b7966 Fix documentation of gdk_display_put_event()
This function is deprecated, but we should still document it properly.
It appends, not prepends. This is clear enough from its implementation,
but also we have practical experience with WebKit in:

https://github.com/WebKit/WebKit/pull/8663

Matthias prefers to avoid the prepend, append, start, and end
terminology altogether.
2023-09-13 08:19:11 -05:00
Matthias Clasen
f84da62740 Merge branch 'wip/corey/gridcell' into 'main'
gtkfilechoosercell: Don't use ColumnViewCell

See merge request GNOME/gtk!6378
2023-09-12 19:47:09 +00:00
Matthias Clasen
cbfbe6dc23 Merge branch 'baseline-fixes' into 'main'
Baseline & measuring fixes

See merge request GNOME/gtk!6373
2023-09-12 19:46:12 +00:00
Corey Berla
2c63a34791 Apply 1 suggestion(s) to 1 file(s) 2023-09-12 17:05:33 +00:00
Matthias Clasen
9ab07553a3 Merge branch 'wip/fix-suspend-state' into 'main'
wayland: Bind correct xdg_wm_base version

See merge request GNOME/gtk!6385
2023-09-12 16:51:50 +00:00
Rafael Fontenelle
c29fb838e9 Update Brazilian Portuguese translation
(cherry picked from commit 066b101c57)
2023-09-12 16:42:31 +00:00
Jonas Ådahl
aecc76d916 wayland: Bind correct xdg_wm_base version
Otherwise we won't get the suspend state.
2023-09-12 21:51:59 +08:00
Michael Catanzaro
713a5188cf Fix typo 2023-09-08 11:46:26 -05:00
Changwoo Ryu
911f3bf555 Update Korean translation
(cherry picked from commit 1abfeff0d1)
2023-09-07 16:59:49 +00:00
Benjamin Otte
c752598a3d Merge branch 'wip/otte/for-main' into 'main'
Various fixes

Closes #6083

See merge request GNOME/gtk!6380
2023-09-07 16:10:46 +00:00
Benjamin Otte
9dfdb1b65b rendernode-tool: Fix array size
Also add an assertion, so things explode properly if we forget to
update the array size when adding new nodes, instead of writing random
memory.
2023-09-07 16:19:20 +02:00
Benjamin Otte
a05a021fd1 rendernode: Fix Cairo rendering of repeating gradients
Cairo and the GL renderer have a different idea of how to handle
transitioning of colors outside the defined range.

Consider these stops:
  black 50%, white 50%

What color is at 0%?

Cairo would transition between the last and first stop, ie it'd do a
white-to-black transition and end up at rgb(0.5,0.5,0.5) at 0%.
GL would behave as it would for non-repeating gradients and use black
for the range [0%..50%] and white for [50%..100%].
The web would rescale the range so the first stop would be at 0% and
the last stop would be at 100%, so this gradient would be illegal.

Considering that it's possible for code to transition between the
different behaviors by adding explicit stops at 0%/100%, I could choose
any method.
So I chose the simplest one, which is what the GL renderer does and
which treats repeating and non-repeating gradients the same.

Tests attached.
2023-09-07 16:19:20 +02:00
Benjamin Otte
9ffd7840ba pathpoint: Add G_GNUC_EXTENSION to struct definition
This allows compilation with gcc -pedantic.

GTKmm uses this as part of their recommended compiler flags.

Fixes #6083
2023-09-07 16:19:20 +02:00
Daniel Rusek
dd64084b44 Update Czech translation 2023-09-07 13:42:13 +00:00
Bruce Cowan
21277a37d6 Update British English translation
(cherry picked from commit c71f8d0838)
2023-09-06 11:39:24 +00:00
Corey Berla
ddc7e36543 gtkfilechoosercell: Don't use ColumnViewCell
This partially reverts ccae75022b.
Since FileChooserCell is used for ColumnView and GridView we should
treat the list item as a GtkListItem, not a ColumnViewCell otherwise
the menu fails to generate properly.
2023-09-05 12:45:34 -07:00
Corey Berla
f429dff03e gtkfilechooserwidget: Move column menu items to the column header menu
The main menu is too long and the column options belong in the column
header menu to begin with.  Since this is only available in column
view, we should always show the menu items.
2023-09-05 12:24:27 -07:00
Corey Berla
6f07c6a3f1 gtkfilechooserwidget: Use property actions for column visibility
It's a lot less code
2023-09-05 12:24:27 -07:00
Corey Berla
4cb4aa1029 gtkfilechooserwidget: Bind column visibility to settings
It's less hacky and lets us drop even more code in the next commit.
2023-09-05 12:24:27 -07:00
Matthias Clasen
cecab7801e Merge branch 'point-color' into 'main'
Point color

See merge request GNOME/gtk!6374
2023-09-04 06:03:22 +00:00
Matthias Clasen
ea7fd1ff5a contour: Fixup for 1-point contours
If we return a path point for a 1-point contour,
make it { n, 0, 1 }.
2023-09-04 00:55:21 +02:00
Matthias Clasen
ad474a60c0 path-tool: Update docs 2023-09-03 23:47:10 +02:00
Matthias Clasen
1e8e7e0c00 path-tool: Make render match show 2023-09-03 23:47:10 +02:00
Matthias Clasen
1e9e8d24c3 path-tool: Add a --point-color option 2023-09-03 23:47:10 +02:00
Matthias Clasen
9bd9b6f2ca contour: Make sure stroke bounds are sufficient 2023-09-03 23:04:47 +02:00
Aurimas Černius
913a6ddcc9 Update Lithuanian translation
(cherry picked from commit 5d54bb1359)
2023-09-03 18:20:17 +00:00
Sergey Bugaev
31da6f60d0 entry, searchentry: Fix measuring baseline
If the entry has icons, we may end up increasing our minimum and natural
height compared to the values the text child returned. In that case, we
should also adjust the baseline values to account for the text being
shifted down.

Signed-off-by: Sergey Bugaev <bugaevc@gmail.com>
2023-09-03 21:07:52 +03:00
Sergey Bugaev
c4c118e425 centerlayout: Fix measuring in presence of baselines
The measure logic (unlike the allocation logic) was enforcing strict
baseline alignment of child widgets even if no child widget had valign
set to baseline. This was causing GtkCenterLayout to request more size
than it actually needed.

Instead, bring the logic closer to that of GtkBoxLayout by introducing
explicit have_baseline and align_baseline variables. We track and report
baseline if have_baseline gets set, but it only affects our reported
minimum and natural sizes if align_baseline ends up set, which happens
if there's a child widget that has valign set to either one of the two
baseline values, and itself reports a valid baseline.

Signed-off-by: Sergey Bugaev <bugaevc@gmail.com>
2023-09-03 21:07:52 +03:00
Ask Hjorth Larsen
02599acf4d Update Danish translation
(cherry picked from commit cc4d94d197)
2023-09-03 14:34:00 +00:00