Commit graph

2197 commits

Author SHA1 Message Date
szecket
fface7c5f7 figma-inspector: Initial version of Figma variable collection export (#8087) 2025-04-28 13:29:38 -04:00
Olivier Goffart
88d37019c8
Remove duplicated outdated copies of slint.tmLanguage.json
There should be only one copy of our textmate grammar.
Our grammar evolve and we shouldn't keep copies around which will be
forgotten to be updated.
2025-04-28 15:14:21 +02:00
dependabot[bot]
bcfc40c2b0
build(deps-dev): bump shiki from 3.2.2 to 3.3.0 (#8287)
Bumps [shiki](https://github.com/shikijs/shiki/tree/HEAD/packages/shiki) from 3.2.2 to 3.3.0.
- [Release notes](https://github.com/shikijs/shiki/releases)
- [Commits](https://github.com/shikijs/shiki/commits/v3.3.0/packages/shiki)

---
updated-dependencies:
- dependency-name: shiki
  dependency-version: 3.3.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-04-28 12:30:12 +03:00
Nigel Breslaw
22143a04ff
Tidy the brush pickers (#8277)
This refactor is to help make future maintenance easier.

Items are now consistently named as brush instead of color.
Instead of one huge brush picker file, various elements such as gradients live in their own file.
The brush picker is also made a bit less 'smart' and doesn't have to fully understand how the current color or brush needs to be updated or if the data tab live preview needs to be updated. In turn the PickerData has been made smarter and looks after these updates.

This has fixed a few bug regarding gradient stops.
2025-04-28 12:29:43 +03:00
dependabot[bot]
e357222e59
build(deps-dev): bump vitest from 3.1.1 to 3.1.2 (#8288)
Bumps [vitest](https://github.com/vitest-dev/vitest/tree/HEAD/packages/vitest) from 3.1.1 to 3.1.2.
- [Release notes](https://github.com/vitest-dev/vitest/releases)
- [Commits](https://github.com/vitest-dev/vitest/commits/v3.1.2/packages/vitest)

---
updated-dependencies:
- dependency-name: vitest
  dependency-version: 3.1.2
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-04-28 10:16:36 +03:00
Simon Hausmann
a50b8f8793
FemtoVG: Add support for WGPU based rendering (#8268)
Enable via the `renderer-femtovg-wgpu` feature flag.

cc #171
2025-04-25 14:37:32 +02:00
dependabot[bot]
3f77a2afe2
build(deps-dev): bump @types/react in the react group (#8218)
Bumps the react group with 1 update: [@types/react](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/react).


Updates `@types/react` from 19.1.1 to 19.1.2
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/react)

---
updated-dependencies:
- dependency-name: "@types/react"
  dependency-version: 19.1.2
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: react
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-04-24 12:38:55 +03:00
dependabot[bot]
704b6a44fe
build(deps-dev): bump vite from 6.2.6 to 6.3.2 (#8216)
Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) from 6.2.6 to 6.3.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/v6.3.2/packages/vite)

---
updated-dependencies:
- dependency-name: vite
  dependency-version: 6.3.2
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-04-24 12:38:37 +03:00
dependabot[bot]
a8dc6bef43
build(deps-dev): bump @playwright/test in the playwright group (#8213)
Bumps the playwright group with 1 update: [@playwright/test](https://github.com/microsoft/playwright).


Updates `@playwright/test` from 1.51.1 to 1.52.0
- [Release notes](https://github.com/microsoft/playwright/releases)
- [Commits](https://github.com/microsoft/playwright/compare/v1.51.1...v1.52.0)

---
updated-dependencies:
- dependency-name: "@playwright/test"
  dependency-version: 1.52.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: playwright
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-04-24 11:39:48 +03:00
dependabot[bot]
2a4fe206b5
build(deps-dev): bump @vitejs/plugin-react from 4.3.4 to 4.4.1 (#8220) 2025-04-24 10:37:27 +03:00
dependabot[bot]
04d9ac0b81
build(deps-dev): bump @figma/plugin-typings from 1.109.0 to 1.110.0 (#8221) 2025-04-24 10:36:09 +03:00
Nigel Breslaw
c3ebe58359
Fix for missing gradient stop sliders (#8249) 2025-04-23 11:41:05 +03:00
Nigel Breslaw
e7fb9a324c
Fix for preview gradient suddenly becoming a solid color (#8245) 2025-04-23 01:18:39 +03:00
Nigel Breslaw
721de2a357
Get the table editor working with color/brush (#8243) 2025-04-22 23:55:35 +03:00
Nigel Breslaw
1800ed3018
Allow editing linear-gradient angle in floating picker (#8242) 2025-04-22 21:58:02 +03:00
Nigel Breslaw
6364f2ecc3
Fix brush editor contrast when using light mode (#8232) 2025-04-22 13:17:35 +03:00
Nigel Breslaw
413554268e
Clip FF from hex colors (#8225)
Although technically Slint hex colors are #RGBA values, it's common to not see the alpha when its 100% i.e. FF. So a color in code would look like #d1d1d1 and not #d1d1d1ff. However any hex color created by the live-preview components always shows the alpha even if it's 100%.

This change clips the FF from the values create via Slint code. However brush stops are created via Rust and need a separate fix.
2025-04-21 21:55:43 +03:00
Nigel Breslaw
5621c70373
Better handling of unset colors and brush properties (#8224)
Brush and color property widgets no longer show the default value of 'transparent' when a value has not been set. Instead the common symbol for no set color from other tools (a red diagonal line on a white background) is used.

When clicked the color picker is then shown and is populated with a default color that is 100% opaque.
2025-04-21 21:55:28 +03:00
Nigel Breslaw
7f352ed764
Fixes for gradient stop re-ordering (#8211)
Potential fix for a set of complex gradient stop re-ordering interactions.

Previously when dragging a gradient stop past other stops the items did not re-order as expcected. The current focused stop did not update. Stops could stick to the dragging stop. Stop sliders could disapear from view. These should be fixed but need more manual testing.
2025-04-20 17:02:49 +03:00
Nigel Breslaw
36bc0d1922
Teach new brush pickers to handle radial gradients (#8208)
This also includes some minor bug fixes:

Floating panels block scroll wheel events to stop the underlying canvas being scrolled.
Hex color value should be applied when defocusing the TextEdit,
2025-04-19 23:27:08 +03:00
Simon Hausmann
8761eaadeb
Move Palette.style-name to internal protected StyleMetrics.style-name (#8200)
This is only exposed when internal types are exposed (such as in the lsp).

The plan is to make this public under a new name/global after the release.

Co-authored-by: Olivier Goffart <olivier.goffart@slint.dev>
2025-04-19 10:20:52 +02:00
Simon Hausmann
b674103551 figma-inspector: Generalize rgbToHex helper function
Re-use the color types that figma provides and accept both of them.
2025-04-18 14:40:02 +02:00
Tobias Hunger
93fe0174fc live-preview: Do not send TextEdits that do not change anything
They get ignored by the editor (rightfully so), while the live
preview will wait for the new source code, blocking all further edits.
2025-04-17 21:58:09 +02:00
Tobias Hunger
88dc12c9c1 slintpad: Remove some dead code
This code used to be responsible for switching between editors.

There is no way to trigger this code anymore, so remove it.
2025-04-17 21:57:53 +02:00
Tobias Hunger
ffd80ad89c slintpad: Make editor follow the selection
In slintpad the editor should follow the selection in the live preview
closely. So always ask to get focus and make sure to switch to the
editor that asks to get focused.
2025-04-17 21:57:38 +02:00
Olivier Goffart
9058456fbf
live-preview: don't replace the native menu bar with the previewed one
Always use the non-native one for the previewed component
2025-04-17 17:12:23 +02:00
Nigel Breslaw
ec1e125e80
Fix for unexpected gradient changes (#8188) 2025-04-17 00:14:31 +03:00
Tobias Hunger
ba19105238 live-preview: Allow to add gradient stops
* Using the `+` button, which will insert a new stop
  after the current stop
* By clicking on the gradinet Preview
2025-04-16 17:43:08 +02:00
Nigel Breslaw
076e933515
Fix out of sync propeties with new pickers (#8183) 2025-04-16 17:59:55 +03:00
Nigel Breslaw
efafb9d8b6
Datatab support for brush properties (#8181) 2025-04-16 17:34:51 +03:00
Nigel Breslaw
77baa2c93e
Gradient fixes (#8179)
Better align color and gradient indicators.
Fix pixel jump in hue slider.
Allow deleting of gradient stops.
Stop json error showing all the time.
2025-04-16 16:14:18 +03:00
Tobias Hunger
29eb832d06 live-preview: Add a method to clone [GradientStop] 2025-04-16 14:44:00 +02:00
Tobias Hunger
cd48bbd251 live-preview: Do not stop the first gradient stop from moving 2025-04-16 14:43:46 +02:00
Nigel Breslaw
7ae6212b0b
Visual color stop picker for gradient stops (#8173)
* Right align % text

* Show and hide visual color stop editor

* Working color stop picker
2025-04-16 12:59:09 +02:00
Tobias Hunger
1008e3e406 live-preview: "Fix" boolean not changing in table 2025-04-16 11:33:26 +02:00
Nigel Breslaw
ee0f4f65ab
Show which gradient stop has focus (#8167)
Also fixes that the gradient preview with the drag sliders should always show with a 90deg linear gradient.
2025-04-16 11:20:03 +03:00
Nigel Breslaw
74fb172ef3
Allow editing of a brush that is hex color value or linear gradient (#8164) 2025-04-16 09:59:11 +03:00
Olivier Goffart
691039b7ea typeloader: Cache parse error for loaded document
We will need these if loading from cache

Fixes #8064
2025-04-15 19:22:57 +02:00
Olivier Goffart
25b2829052 LSP: do not clear error in dependency when reloading a dependent file
In the test, `reexport.slint` depends on `bar.slint`
When parsing `reexport.slint` we shouldn't clear previously reported
error from previously parsed `bar.slint`. The errors are still there.
2025-04-15 19:22:57 +02:00
Tobias Hunger
647b4650a3 live-preview: Fix widgets in the edit window of the table sticking out on the side
The classic: Layouts distribute 100% of the pixels to their elements
and only then apply padding and spacing... when you use `width: 100%;`.
2025-04-15 18:56:27 +02:00
Tobias Hunger
de75b706e7 live-preview: Remove stray debug output 2025-04-15 18:56:27 +02:00
Tobias Hunger
3cdf786dba live-preview: Do not show "<MAIN>" in table edit window 2025-04-15 18:56:27 +02:00
Tobias Hunger
e2fdf735b8 live-preview: Go deeper when evaluating gradients
... otherwise gradients without positions will fail to evaluate
all their GradientStops, leading to the wrong gradients being
previewed.
2025-04-15 17:56:09 +02:00
Simon Hausmann
827b0b1d5c Improve diagnostics and error handling when encountering unknown url schemes
When asked to drop a document, don't make it a fatal error. Also, when the conversion fails for loading or closing, print the path to stderr. Maybe we can learn something there.

cc #8089
cc #7333
cc #4926
2025-04-15 17:24:42 +02:00
Tobias Hunger
2512713a31 live-preview: Move more code out of ui.rs
... add unit tests and fix the bugs those discovered.
2025-04-15 16:34:44 +02:00
Nigel Breslaw
8f6f06f53d
live-preview inline color widget (#8156) 2025-04-15 17:19:38 +03:00
Tobias Hunger
30b5ed026b
live-preview: Keep gradient stops sorted (#8142)
live-preview: Keep gradient stops sorted

... when reading them from code and when inserting
new stops.

* live-preview: Add a API to move gradient stops

Gradient stops need to be sorted now, so we need to
have a new API for moving gradient stops -- so the
model can stay sorted as we drag stops around.
2025-04-15 10:03:35 +02:00
Simon Hausmann
44a1bec608
Disable jemalloc for slint-lsp/slint-viewer/slint-compiler on aarch64… (#8136)
With jemalloc the page size is a compile time constant that results in
the process aborting on memory allocation if the compile time determined
page size does not match the kernel reported page size at run-time.

When we, or our users, compile the above programs for aarch64-linux,
there is a fair expectation that the resulting binary works on any
aarch64-linux system. As we can't determine the target page size
reliably, disable jemalloc.

Fixes #8134
2025-04-14 15:03:36 +02:00
Nigel Breslaw
a7128a4d2d
Brush Picker limit hex input length (#8133)
If the # hex value gets longer than 8 characters it will reset to the previous valid value
2025-04-14 14:20:18 +03:00
Nigel Breslaw
5c6c8b74d7
TableEditor should not show add row on a struct (#8139) 2025-04-14 14:19:45 +03:00