Commit graph

15531 commits

Author SHA1 Message Date
Nigel Breslaw
7ff03755e9 Qt fix 2025-11-12 11:46:42 +02:00
Nigel Breslaw
a32d63a664 act 2025-11-12 11:46:42 +02:00
Simon Hausmann
ea0d0be032 slint-compiler: Fix fallback family handling for glyph embedding on Linux
Some checks are pending
autofix.ci / ci (push) Blocked by required conditions
autofix.ci / lint_typecheck (push) Waiting to run
autofix.ci / format_fix (push) Waiting to run
For macOS and Windows we've had hard-coded fallbacks, but none for Linux
after the fontconfig removal. So go through the same fallback families
as when using fontique regularly, and add emoji as parley tries that
within.

This fixes picking up glyphs such as "←→↵⌫".
2025-11-11 18:49:59 +01:00
Olivier Goffart
6b3ea3d7cc Fix font familly of component that inherit from PopupWindow with the material style
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
Fixes #9866

The material style defines a `StyleMetrics.default-font-family` which is
meant to be applied to `Window` element if not set by the user.
But it was mistakely sometimes applied to PopupWindow

Consider this code:
```slint
component MyPopup inherits PopupWindow {
    Text { text: "Hello"; }
}

export component MainWindow inherits Window {
    my_popup := MyPopup { }
}
```

First, we would process MyPopup: `apply_default_property_from_style`
wouldn't do anything, but the `lower_popups` pass would replace its
root with a Window builtin.
Second, we would process MainWindow: `apply_default_property_from_style`
would see that my_popup is using the Window as a builtin and would apply
default window properties from style, which it shouldn't.

In fact, `apply_default_property_from_style` should only apply default
for elements that are directly using the builtin, not a component that
inherits from that builtin, as these property should have been already
set.
2025-11-11 17:17:54 +01:00
Simon Hausmann
ce4283e802 winit: Fix explicit renderer-femtovg-wgpu selection
When no graphics API is requested by the app, permit the selection to continue.
2025-11-11 16:50:58 +01:00
Tobias Hunger
499a8a75e9 vscode: Fix biome linter error in VSCode ectension
Biome was raising this error:

> A "floating" Promise was found, meaning it is not properly handled and
> could lead to ignored errors or unexpected behavior.

Biome is of course right, so handle errors by logging them.
2025-11-11 14:21:18 +01:00
Murmele
db6f436f48
ModalNavigationDrawer: add possibility to react on selection changes of group and item simultaneously (#10008)
* ModalNavigationDrawer: add possibility to react on selection changes of group and item simultaneously like in NavigationDrawer

* Add arguments and their description to the documentation

* align style
2025-11-11 11:20:48 +02:00
Simon Hausmann
e7313dd239 Skia: Update to the latest version of the Rust bindings
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
For details, see https://github.com/rust-skia/rust-skia/releases/tag/0.90.0
2025-11-11 09:22:17 +01:00
Olivier Goffart
2de069cd44 Revert "skia: Fix build after read-fonts release"
This reverts commit 5923fe4cd4.

The bug was fixed upstream
2025-11-11 08:46:01 +01:00
Simon Hausmann
a4ca03b616 Revert "CI: Fix node build"
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
This reverts commit de904ea4c3.

The bug is fixed in a newer napi-build version.
2025-11-10 23:30:00 +01:00
Olivier Goffart
14ff32942c Fix unsoundess in ChangeTracker
Make sure to annotate the function with `'static` or it is possible that
the handler runs closure that reference dead objects
2025-11-10 17:51:23 +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