Commit graph

15524 commits

Author SHA1 Message Date
Simon Hausmann
45e1289c02 Speed up test-driver-rust 2025-11-11 17:52:16 +01:00
Simon Hausmann
90a799ec0a WIP: work around what looks like a cargo bug 2025-11-11 17:27:23 +01:00
Simon Hausmann
5cee5779d3 WIP: comment out unrelated jobs 2025-11-11 09:35:14 +01:00
Simon Hausmann
60a5e14331 CI: Build with --all-features only in the nightly
While important to build with all features, it's also a waste of time to rebuild skia from sources every time for every PR.
2025-11-11 09:33:57 +01:00
dependabot[bot]
b432ea416f
build(deps): bump the npm-minor-updates group across 1 directory with 3 updates (#10018)
Some checks are pending
autofix.ci / ci (push) Blocked by required conditions
autofix.ci / format_fix (push) Waiting to run
autofix.ci / lint_typecheck (push) Waiting to run
Bumps the npm-minor-updates group with 3 updates in the / directory: [esbuild](https://github.com/evanw/esbuild), [unpic](https://github.com/ascorbic/unpic) and [tailwind-merge](https://github.com/dcastil/tailwind-merge).


Updates `esbuild` from 0.25.12 to 0.27.0
- [Release notes](https://github.com/evanw/esbuild/releases)
- [Changelog](https://github.com/evanw/esbuild/blob/main/CHANGELOG.md)
- [Commits](https://github.com/evanw/esbuild/compare/v0.25.12...v0.27.0)

Updates `unpic` from 4.1.3 to 4.2.2
- [Release notes](https://github.com/ascorbic/unpic/releases)
- [Changelog](https://github.com/ascorbic/unpic/blob/main/CHANGELOG.md)
- [Commits](https://github.com/ascorbic/unpic/commits)

Updates `tailwind-merge` from 3.3.1 to 3.4.0
- [Release notes](https://github.com/dcastil/tailwind-merge/releases)
- [Commits](https://github.com/dcastil/tailwind-merge/compare/v3.3.1...v3.4.0)

---
updated-dependencies:
- dependency-name: esbuild
  dependency-version: 0.27.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: npm-minor-updates
- dependency-name: unpic
  dependency-version: 4.2.2
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: npm-minor-updates
- dependency-name: tailwind-merge
  dependency-version: 3.4.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: npm-minor-updates
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-11-10 16:49:23 +02:00
Nigel Breslaw
2c5b402909
Tweak to reduce total number of rust-cache (#10017)
50GB of caches in branches is still being created. This doesn't 
eliminate them all but makes a decent dent. This stops the more useful 
master branch cache being evicted.
2025-11-10 14:46:27 +02:00
Ashley
dfbcbdaed2
Richtext: color handling (#9996)
* Use htmlparser

* Parse color values

* Cargo fmt

* Use imported Color

* Actually handle colors via overrides

* Check that the tags match

* Use color parsing feature

* Make htmlparser optional

* Error handling

* [autofix.ci] apply automated fixes

* debug_log!

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-11-11 01:05:44 +13:00
dependabot[bot]
23993ed5ce
build(deps): bump streetsidesoftware/cspell-action (#10013)
Bumps the github-actions group with 1 update: [streetsidesoftware/cspell-action](https://github.com/streetsidesoftware/cspell-action).


Updates `streetsidesoftware/cspell-action` from 7 to 8
- [Release notes](https://github.com/streetsidesoftware/cspell-action/releases)
- [Changelog](https://github.com/streetsidesoftware/cspell-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/streetsidesoftware/cspell-action/compare/v7...v8)

---
updated-dependencies:
- dependency-name: streetsidesoftware/cspell-action
  dependency-version: '8'
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-11-10 14:01:53 +02:00
Simon Hausmann
e8096774cf CI: Don't build the material gallery for every CI build
It's just built in the nightly. On macOS in the CI it's built twice, once as bin and once as lib, with a total of 600seconds according to cargo-timings.
2025-11-10 11:55:54 +01:00
Simon Hausmann
5923fe4cd4 skia: Fix build after read-fonts release
Pin read-fonts to 0.35.0 until https://github.com/googlefonts/fontations/issues/1693 is resolved.
2025-11-10 10:26:42 +01:00
Ashley
5c6f07da64
Move named color & color literal parsing to slint common (#9981)
* Move color_parsing to common

* [autofix.ci] apply automated fixes

* Fixes

* Change how feature flags work

* Use std feature for common in compiler

* Add color-parsing feature instead

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-11-10 08:39:28 +00:00
David Faure
dcacddcae5
Fix typos in comments while reading the code (#10005)
Some checks are pending
autofix.ci / format_fix (push) Waiting to run
autofix.ci / lint_typecheck (push) Waiting to run
autofix.ci / ci (push) Blocked by required conditions
2025-11-10 08:12:07 +00:00
David Faure
5ad1d99a1c
Fix slint_debug_property build: missing '!' and debug_name var needed (#10004)
* must be format!() instead of format()

* line 1192 uses a debug_name local variable, which got removed

Amends commit e11015e7b3
("Two way binding with struct for the interpreter")
2025-11-10 08:11:37 +00:00
dependabot[bot]
57b0f12e0f
build(deps): bump the npm-minor-updates group with 3 updates (#9993)
Some checks failed
autofix.ci / format_fix (push) Has been cancelled
autofix.ci / lint_typecheck (push) Has been cancelled
autofix.ci / ci (push) Has been cancelled
Bumps the npm-minor-updates group with 3 updates: [shiki](https://github.com/shikijs/shiki/tree/HEAD/packages/shiki), [cspell](https://github.com/streetsidesoftware/cspell/tree/HEAD/packages/cspell) and [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite).


Updates `shiki` from 3.14.0 to 3.15.0
- [Release notes](https://github.com/shikijs/shiki/releases)
- [Commits](https://github.com/shikijs/shiki/commits/v3.15.0/packages/shiki)

Updates `cspell` from 9.2.2 to 9.3.0
- [Release notes](https://github.com/streetsidesoftware/cspell/releases)
- [Changelog](https://github.com/streetsidesoftware/cspell/blob/main/packages/cspell/CHANGELOG.md)
- [Commits](https://github.com/streetsidesoftware/cspell/commits/v9.3.0/packages/cspell)

Updates `vite` from 7.1.12 to 7.2.2
- [Release notes](https://github.com/vitejs/vite/releases)
- [Changelog](https://github.com/vitejs/vite/blob/main/packages/vite/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite/commits/v7.2.2/packages/vite)

---
updated-dependencies:
- dependency-name: shiki
  dependency-version: 3.15.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: npm-minor-updates
- dependency-name: cspell
  dependency-version: 9.3.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: npm-minor-updates
- dependency-name: vite
  dependency-version: 7.2.2
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: npm-minor-updates
...


Dedupe

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-11-07 17:50:33 +00:00
Olivier Goffart
289b595447
properties: a bit more type safety in the BindingCallable trait (#9997) 2025-11-07 16:34:46 +00:00
Simon Hausmann
156930fff4
servo: Fix clean build (#9998)
Servo's script crate uses

    js = { package = "mozjs", git = "https://github.com/servo/mozjs" }

which means it would pick mozjs from master. Inside servo this works
because of the present `Cargo.lock` file that pins it. But the version
of servo we're using doesn't compile with the master branch of mozjs.

Unfortunately the `[patch]` section in `Cargo.toml` can't just change
the revision, only if also the URL changes. So point mozjs to a fork of
ours and then we can pin the correct version that servo also uses.
2025-11-07 15:12:20 +00:00
dependabot[bot]
6e465911e5
build(deps): bump the npm-patch-updates group with 7 updates (#9994)
Some checks are pending
autofix.ci / format_fix (push) Waiting to run
autofix.ci / lint_typecheck (push) Waiting to run
autofix.ci / ci (push) Blocked by required conditions
* build(deps): bump the npm-patch-updates group with 7 updates

Bumps the npm-patch-updates group with 7 updates:

| Package | From | To |
| --- | --- | --- |
| [html-react-parser](https://github.com/remarkablemark/html-react-parser) | `5.2.7` | `5.2.8` |
| [vitest](https://github.com/vitest-dev/vitest/tree/HEAD/packages/vitest) | `4.0.6` | `4.0.8` |
| [@astrojs/mdx](https://github.com/withastro/astro/tree/HEAD/packages/integrations/mdx) | `4.3.9` | `4.3.10` |
| [@biomejs/biome](https://github.com/biomejs/biome/tree/HEAD/packages/@biomejs/biome) | `2.3.2` | `2.3.4` |
| [astro](https://github.com/withastro/astro/tree/HEAD/packages/astro) | `5.15.3` | `5.15.4` |
| [sharp](https://github.com/lovell/sharp) | `0.34.4` | `0.34.5` |
| [starlight-links-validator](https://github.com/HiDeoo/starlight-links-validator/tree/HEAD/packages/starlight-links-validator) | `0.19.0` | `0.19.1` |


Updates `html-react-parser` from 5.2.7 to 5.2.8
- [Release notes](https://github.com/remarkablemark/html-react-parser/releases)
- [Changelog](https://github.com/remarkablemark/html-react-parser/blob/master/CHANGELOG.md)
- [Commits](https://github.com/remarkablemark/html-react-parser/compare/v5.2.7...v5.2.8)

Updates `vitest` from 4.0.6 to 4.0.8
- [Release notes](https://github.com/vitest-dev/vitest/releases)
- [Commits](https://github.com/vitest-dev/vitest/commits/v4.0.8/packages/vitest)

Updates `@astrojs/mdx` from 4.3.9 to 4.3.10
- [Release notes](https://github.com/withastro/astro/releases)
- [Changelog](https://github.com/withastro/astro/blob/main/packages/integrations/mdx/CHANGELOG.md)
- [Commits](https://github.com/withastro/astro/commits/@astrojs/mdx@4.3.10/packages/integrations/mdx)

Updates `@biomejs/biome` from 2.3.2 to 2.3.4
- [Release notes](https://github.com/biomejs/biome/releases)
- [Changelog](https://github.com/biomejs/biome/blob/main/packages/@biomejs/biome/CHANGELOG.md)
- [Commits](https://github.com/biomejs/biome/commits/@biomejs/biome@2.3.4/packages/@biomejs/biome)

Updates `astro` from 5.15.3 to 5.15.4
- [Release notes](https://github.com/withastro/astro/releases)
- [Changelog](https://github.com/withastro/astro/blob/main/packages/astro/CHANGELOG.md)
- [Commits](https://github.com/withastro/astro/commits/astro@5.15.4/packages/astro)

Updates `sharp` from 0.34.4 to 0.34.5
- [Release notes](https://github.com/lovell/sharp/releases)
- [Commits](https://github.com/lovell/sharp/compare/v0.34.4...v0.34.5)

Updates `starlight-links-validator` from 0.19.0 to 0.19.1
- [Release notes](https://github.com/HiDeoo/starlight-links-validator/releases)
- [Changelog](https://github.com/HiDeoo/starlight-links-validator/blob/main/packages/starlight-links-validator/CHANGELOG.md)
- [Commits](https://github.com/HiDeoo/starlight-links-validator/commits/starlight-links-validator@0.19.1/packages/starlight-links-validator)

---
updated-dependencies:
- dependency-name: html-react-parser
  dependency-version: 5.2.8
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: npm-patch-updates
- dependency-name: vitest
  dependency-version: 4.0.8
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: npm-patch-updates
- dependency-name: "@astrojs/mdx"
  dependency-version: 4.3.10
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: npm-patch-updates
- dependency-name: "@biomejs/biome"
  dependency-version: 2.3.4
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: npm-patch-updates
- dependency-name: astro
  dependency-version: 5.15.4
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: npm-patch-updates
- dependency-name: sharp
  dependency-version: 0.34.5
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: npm-patch-updates
- dependency-name: starlight-links-validator
  dependency-version: 0.19.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: npm-patch-updates
...

Signed-off-by: dependabot[bot] <support@github.com>

* [autofix.ci] apply automated fixes

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-11-07 14:45:02 +00:00
Simon Hausmann
e97361204c
Parley: cleanups (#9995)
* parley: Move the code for creating the ranged builders into a separate struct

This makes it easier to see what's needed for create the builders and reduces the lines of code for the layout function.

* parley: Move the parley::Layout building into LayoutWithoutLineBreaksBuilder

That way we can make sure that the text applied to the ranged_builder and the final layout is the same.

* parley: Separate creation of parley layouts from applying the line breaks and positioning

In the future, once fully separated, we can cache the layout without the line breaks.

* parley: Simplify LayoutWithoutLineBreaksBuilder::build

We only need the contexts within, so remove the argument.

* parley: Move pixel size computation into LayoutWithoutLineBreaksBuilder constructor

That's the only place where we need to compute it.

* parley: Reduce fields in LayoutOptions

Remove font_request and stroke, as that's only needed in LayoutWithoutLineBreaksBuilder, which is now passed into layout().

This is, again, in preparation of further separating the creation of the layouts (mainly shaping) and the line breaking and positioning.

* parley: Separate text layout steps further

With this PR, text layout is now split into three phrases:

1. Set up parley
2. Create paragraphs of text with formatting applied - stored in essentially a vec of parley layouts. This step includes shaping.
3. Apply line breaking to the layouts. This step includes glyph positioning.

* parley: Move selection handling into LayoutWithoutLineBreaksBuilder

It's only needed there, and only set from draw_text_input.

* parley: Move text wrap into LayoutWithoutLineBreaksBuilder

* parley: Move LayoutOptions creations right to the call where needed

* parley: In draw_text() initialize variables closes to their use-site

* parley: In draw_text_input() initialize variables closer to their use-site

This is done with the exceptions of opportunities for early returns, as those can then also avoid unnecessary property dependencies.

* parley: In text_size(), improve localty if variable declaration and use-site slightly

* parley: Improve variable locality in link_under_cursor

* parley: Improve variable locality in text_input_cursor_rect_for_byte_offset

* parley: Improve variable locality in text_input_byte_offset_for_position

* parley: Avoid unnecessary pixel_size computation in text_input_cursor_rect_for_byte_offset

* parley: Simplify cursor drawing code
2025-11-07 14:20:09 +00:00
Simon Hausmann
19975846f5 renderer: Remove the str slice from text_size()
Instead, hide access to the string behind a RenderString trait.

The objective in the future is to cache the layout, which means that we need to query the text and other properties only if the cache is dirty.
2025-11-07 12:41:52 +00:00
Simon Hausmann
e6f74960d4 text: Introduce char_size() in the renderer to simplify size computation for text input and text elements
To compute the logical size of a character we need less parameters and
properties than for an entire string.
2025-11-07 12:41:52 +00:00
Simon Hausmann
1b5713f25f parley: Create the font request for link_under_cursor inside the function 2025-11-07 12:41:52 +00:00
Simon Hausmann
fc54b48fdf parley: Create the font request for text_size inside shared parley code 2025-11-07 12:41:52 +00:00
Simon Hausmann
3a6d873c43 parley: Create the font request for draw_text_input inside shared parley code 2025-11-07 12:41:52 +00:00
Simon Hausmann
098af0843e parley: Create the font request for draw_text inside shared parley code 2025-11-07 12:41:52 +00:00
Simon Hausmann
ec6659a79a text: Separate FontRequest creation into a trait of its own
This is in preparation of moving the overall font request creation out
of the text items and renderers, mostly into the shared parley code.
2025-11-07 12:41:52 +00:00
Simon Hausmann
1c93acc701 renderer: Simplify text_input_cursor_rect_for_byte_offset 2025-11-07 12:41:52 +00:00
Simon Hausmann
c7b23077e3 renderer: Simplify text_input_byte_offset_for_position
Instead of letting each caller create the FontRequest in the same way, do it once in sharedparley.
2025-11-07 12:41:52 +00:00
autofix-ci[bot]
8b6d928a6b [autofix.ci] apply automated fixes 2025-11-07 12:32:25 +00:00
burhankhanzada
1d6ed559b6 Improve load url api 2025-11-07 12:32:25 +00:00
burhankhanzada
46bd8ac70e Initial theme bug fixed by servo 2025-11-07 12:32:25 +00:00
burhankhanzada
c9c8cc36cd update Readme 2025-11-07 12:32:25 +00:00
burhankhanzada
e1962756d4 Updated servo revision and fix api changes 2025-11-07 12:32:25 +00:00
burhankhanzada
9ad155e69a Get app theme 2025-11-07 12:32:25 +00:00
burhankhanzada
2d9d73f3e2 Added some docs 2025-11-07 12:32:25 +00:00
burhankhanzada
3789b6e017 Refactor a little bit 2025-11-07 12:32:25 +00:00
burhankhanzada
b5b83121ba Cleanup 2025-11-07 12:32:25 +00:00
burhankhanzada
0c3f10f80d Added theme change 2025-11-07 12:32:25 +00:00
burhankhanzada
f678aeb634 Removed application handler as it not required now that scroll issue solved on slint.dev/docs without it 2025-11-07 12:32:25 +00:00
burhankhanzada
b5593bbcf8 Add disclaimer and improve README 2025-11-07 12:32:25 +00:00
Nigel Breslaw
1f95d84977 Group dependabot updates by semver 2025-11-07 12:25:08 +00:00
Nigel Breslaw
aced732a2f Combine rust and warnings check jobs
Means ones less job.
Warnings does not need to do a full compile.
Still comes in under 20 mins.
Enable the cache too.
2025-11-07 10:32:42 +00:00
Simon Hausmann
e3406994f4 CI: Attempt to run Node.js tests only on Linux when doing Slint internal changes 2025-11-07 10:29:03 +00:00
Simon Hausmann
9795a8ce4d CI: Attempt to run python tests only on Linux when doing Slint internal changes 2025-11-07 10:29:03 +00:00
Simon Hausmann
2adb86de14 Python: Be conservative about attaching to the Python interpreter
We call Python::attach in a few places. When invoked from the Slint event loop, those should be fine. But there are some that may fail, for example during gc. Fall back to using try_attach and return default values instead of causing a panic.

Fixes #9984
2025-11-07 10:28:47 +00:00
Nigel Breslaw
202381294b Run check warnings in parallel 2025-11-07 10:11:08 +00:00
Simon Hausmann
3ededec824
CI: Fix docs output path in nightly
Some checks are pending
autofix.ci / format_fix (push) Waiting to run
autofix.ci / lint_typecheck (push) Waiting to run
autofix.ci / ci (push) Blocked by required conditions
2025-11-07 06:06:17 +01:00
Simon Hausmann
a58b5e5581
CI: Test PRs in the merge queue before the merge into the master branch 2025-11-07 05:45:34 +01:00
Tasuku Suzuki
fc39491d24 Remove incorrect cross-demo import from home-automation
Removes import of Page component from printerdemo in home-automation demo,
as this creates an inappropriate dependency between separate demo projects.
2025-11-07 04:40:43 +00:00
Tasuku Suzuki
0db86509a8 Skia: Skip wgpu surface configuration when size is zero
During window initialization, Slint window properties (width/height)
are set incrementally, which can result in Surface::configure being
called with zero dimensions. This causes wgpu to panic with the error:
"Both Surface width and height must be non-zero."

This fix skips surface configuration when either dimension is zero,
following wgpu's recommendation to "wait to recreate the Surface
until the window has non-zero area."
2025-11-07 04:40:31 +00:00
Simon Hausmann
fcc6364bd1 CI: Fix docs publishing
Some checks are pending
autofix.ci / format_fix (push) Waiting to run
autofix.ci / lint_typecheck (push) Waiting to run
autofix.ci / ci (push) Blocked by required conditions
There's no more a need to fix up the docs structure, when build_docs already produces the correct directory structure.
2025-11-06 21:56:55 +01:00