Nigel Breslaw
9c20beadba
Tools: Remove the unnecessary 'FF' from generated colors ( #9594 )
...
* Tools: Remove the unecessary 'FF' from generated colors
When colors in most UI tools are 100% alpha the extra 'FF' is auto cut
off for readability. e.g. #000000FF becomes #000000 . Since introducing
the new color pickers this has been the case on the UI side. However the
code generator for gradients was inconsistent and would still add in the
unnecessary 'FF'. This fixes that and makes generated gradient code
tidier.
* Fix correct tests
* Fix
* [autofix.ci] apply automated fixes
* Fix
* Fix
* Fix
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-10-02 16:53:22 +03:00
Olivier Goffart
cb13a0bd2c
live-preview: Understand conic gradient
...
The slint part is missing
2025-10-02 10:38:59 +02:00
Olivier Goffart
dfbd2bda6c
live-preview: search line edit in property list
2025-09-12 17:25:40 +02:00
Olivier Goffart
b26e0b2ece
live-preview: Preserve the library search text upon compilation
2025-09-09 20:09:06 +02:00
szecket
7c0b9b31a3
live-preview: added a component-name ( #9364 )
CI / build_and_test (ubuntu-22.04, nightly) (push) Blocked by required conditions
CI / node_test (macos-14) (push) Blocked by required conditions
CI / node_test (ubuntu-22.04) (push) Blocked by required conditions
CI / node_test (windows-2022) (push) Blocked by required conditions
CI / python_test (macos-14) (push) Blocked by required conditions
CI / python_test (ubuntu-22.04) (push) Blocked by required conditions
CI / python_test (windows-2022) (push) Blocked by required conditions
CI / cpp_test_driver (macos-13) (push) Blocked by required conditions
CI / cpp_test_driver (ubuntu-22.04) (push) Blocked by required conditions
CI / cpp_test_driver (windows-2022) (push) Blocked by required conditions
CI / cpp_cmake (macos-14, 1.85) (push) Blocked by required conditions
CI / cpp_cmake (ubuntu-22.04, stable) (push) Blocked by required conditions
CI / cpp_cmake (windows-2022, nightly) (push) Blocked by required conditions
CI / cpp_package_test (push) Blocked by required conditions
CI / vsce_build_test (push) Blocked by required conditions
CI / mcu (pico-st7789, thumbv6m-none-eabi) (push) Blocked by required conditions
CI / mcu (pico2-st7789, thumbv8m.main-none-eabihf) (push) Blocked by required conditions
CI / mcu (stm32h735g, thumbv7em-none-eabihf) (push) Blocked by required conditions
CI / mcu-embassy (push) Blocked by required conditions
CI / ffi_32bit_build (push) Blocked by required conditions
CI / docs (push) Blocked by required conditions
CI / wasm (push) Blocked by required conditions
CI / wasm_demo (push) Blocked by required conditions
CI / tree-sitter (push) Blocked by required conditions
CI / updater_test (0.3.0) (push) Blocked by required conditions
CI / fmt_test (push) Blocked by required conditions
CI / esp-idf-quick (push) Blocked by required conditions
CI / android (push) Blocked by required conditions
CI / miri (push) Blocked by required conditions
CI / test-figma-inspector (push) Blocked by required conditions
2025-09-08 20:02:29 +02:00
Olivier Goffart
8ba3dde08f
live-preview: WIP: search within the library
2025-09-08 17:46:55 +02:00
Olivier Goffart
1b9d65f749
live-preview: add a callback to rename an element
2025-09-03 22:16:34 +02:00
Olivier Goffart
d9a0fa8964
live-preview: implement undo-redo
2025-08-06 09:42:56 +02:00
Olivier Goffart
c673a74f9f
preview: Fix highlighted elements not following items
...
CI / build_and_test (--exclude ffmpeg --exclude gstreamer-player, macos-14, stable) (push) Blocked by required conditions
CI / build_and_test (--exclude ffmpeg --exclude gstreamer-player, windows-2022, beta) (push) Blocked by required conditions
CI / build_and_test (--exclude ffmpeg --exclude gstreamer-player, windows-2022, stable) (push) Blocked by required conditions
CI / build_and_test (ubuntu-22.04, nightly) (push) Blocked by required conditions
CI / node_test (macos-14) (push) Blocked by required conditions
CI / node_test (ubuntu-22.04) (push) Blocked by required conditions
CI / node_test (windows-2022) (push) Blocked by required conditions
CI / python_test (macos-14) (push) Blocked by required conditions
CI / python_test (ubuntu-22.04) (push) Blocked by required conditions
CI / cpp_test_driver (macos-13) (push) Blocked by required conditions
CI / cpp_test_driver (ubuntu-22.04) (push) Blocked by required conditions
CI / cpp_test_driver (windows-2022) (push) Blocked by required conditions
CI / cpp_cmake (macos-14, 1.85) (push) Blocked by required conditions
CI / cpp_cmake (windows-2022, nightly) (push) Blocked by required conditions
CI / cpp_package_test (push) Blocked by required conditions
CI / vsce_build_test (push) Blocked by required conditions
CI / mcu (pico-st7789, thumbv6m-none-eabi) (push) Blocked by required conditions
CI / mcu (stm32h735g, thumbv7em-none-eabihf) (push) Blocked by required conditions
CI / mcu-embassy (push) Blocked by required conditions
CI / ffi_32bit_build (push) Blocked by required conditions
CI / docs (push) Blocked by required conditions
CI / wasm (push) Blocked by required conditions
CI / wasm_demo (push) Blocked by required conditions
CI / tree-sitter (push) Blocked by required conditions
CI / updater_test (0.3.0) (push) Blocked by required conditions
CI / fmt_test (push) Blocked by required conditions
CI / esp-idf-quick (push) Blocked by required conditions
CI / android (push) Blocked by required conditions
CI / miri (push) Blocked by required conditions
CI / test-figma-inspector (push) Blocked by required conditions
Rely on the fact that `component_instance.component_positions` read
properties and do the property tracking for us. By accessing it from a
callback we get free dirty notification.
2025-08-01 18:56:37 +02:00
Olivier Goffart
489e0b8729
Live-preview: Outline
2025-08-01 18:25:40 +02:00
Tobias Hunger
652fab4cbc
live-preview: Update the code handling the menu on apple
...
CI / build_and_test (--exclude ffmpeg --exclude gstreamer-player, macos-14, stable) (push) Blocked by required conditions
CI / build_and_test (--exclude ffmpeg --exclude gstreamer-player, windows-2022, beta) (push) Blocked by required conditions
CI / build_and_test (--exclude ffmpeg --exclude gstreamer-player, windows-2022, stable) (push) Blocked by required conditions
CI / node_test (windows-2022) (push) Blocked by required conditions
CI / docs (push) Blocked by required conditions
CI / build_and_test (--exclude ffmpeg --exclude gstreamer-player, --exclude bevy-example, windows-2022, 1.85) (push) Blocked by required conditions
CI / build_and_test (ubuntu-22.04, nightly) (push) Blocked by required conditions
CI / node_test (macos-14) (push) Blocked by required conditions
CI / node_test (ubuntu-22.04) (push) Blocked by required conditions
CI / vsce_build_test (push) Blocked by required conditions
CI / mcu (pico-st7789, thumbv6m-none-eabi) (push) Blocked by required conditions
CI / mcu (pico2-st7789, thumbv8m.main-none-eabihf) (push) Blocked by required conditions
CI / mcu (stm32h735g, thumbv7em-none-eabihf) (push) Blocked by required conditions
CI / updater_test (0.3.0) (push) Blocked by required conditions
CI / fmt_test (push) Blocked by required conditions
CI / esp-idf-quick (push) Blocked by required conditions
CI / android (push) Blocked by required conditions
CI / miri (push) Blocked by required conditions
CI / test-figma-inspector (push) Blocked by required conditions
CI / python_test (macos-14) (push) Blocked by required conditions
CI / python_test (ubuntu-22.04) (push) Blocked by required conditions
CI / python_test (windows-2022) (push) Blocked by required conditions
CI / cpp_test_driver (macos-13) (push) Blocked by required conditions
CI / cpp_test_driver (ubuntu-22.04) (push) Blocked by required conditions
CI / cpp_test_driver (windows-2022) (push) Blocked by required conditions
CI / cpp_cmake (macos-14, 1.85) (push) Blocked by required conditions
CI / cpp_cmake (ubuntu-22.04, stable) (push) Blocked by required conditions
CI / cpp_cmake (windows-2022, nightly) (push) Blocked by required conditions
CI / wasm (push) Blocked by required conditions
CI / cpp_package_test (push) Blocked by required conditions
Done-with: @tronical
2025-07-28 17:13:15 +02:00
Tobias Hunger
5dc9ce5204
LSP: Start external process for live preview
...
Start the live preview in a separate process. This simplifies
a couple of things:
* Starting the UI
* UI state handling
* Threading setup
* "Quitting" the preview on Mac
... and many more :-)
2025-07-28 17:13:15 +02:00
Tobias Hunger
f6a4d5c0a7
live-preview: Move the LSP/live preview communitation out or preview
...
... and into preview/connector.
This is just a intermediary step to separate them even more strongly from
each other.
2025-07-28 17:13:15 +02:00
Olivier Goffart
5874e6afe0
live-preview: Respect the global color scheme when computing the Palette
...
CI / build_and_test (--exclude ffmpeg --exclude gstreamer-player, windows-2022, stable) (push) Blocked by required conditions
CI / build_and_test (ubuntu-22.04, nightly) (push) Blocked by required conditions
CI / node_test (macos-14) (push) Blocked by required conditions
CI / cpp_package_test (push) Blocked by required conditions
CI / node_test (ubuntu-22.04) (push) Blocked by required conditions
CI / node_test (windows-2022) (push) Blocked by required conditions
CI / python_test (macos-14) (push) Blocked by required conditions
CI / python_test (ubuntu-22.04) (push) Blocked by required conditions
CI / cpp_test_driver (macos-13) (push) Blocked by required conditions
CI / cpp_test_driver (ubuntu-22.04) (push) Blocked by required conditions
CI / cpp_test_driver (windows-2022) (push) Blocked by required conditions
CI / cpp_cmake (macos-14, 1.82) (push) Blocked by required conditions
CI / tree-sitter (push) Blocked by required conditions
CI / cpp_cmake (ubuntu-22.04, stable) (push) Blocked by required conditions
CI / cpp_cmake (windows-2022, nightly) (push) Blocked by required conditions
CI / vsce_build_test (push) Blocked by required conditions
CI / mcu (pico-st7789, thumbv6m-none-eabi) (push) Blocked by required conditions
CI / mcu (pico2-st7789, thumbv8m.main-none-eabihf) (push) Blocked by required conditions
CI / mcu (stm32h735g, thumbv7em-none-eabihf) (push) Blocked by required conditions
CI / mcu-embassy (push) Blocked by required conditions
CI / ffi_32bit_build (push) Blocked by required conditions
CI / docs (push) Blocked by required conditions
CI / wasm (push) Blocked by required conditions
CI / wasm_demo (push) Blocked by required conditions
CI / updater_test (0.3.0) (push) Blocked by required conditions
CI / fmt_test (push) Blocked by required conditions
CI / esp-idf-quick (push) Blocked by required conditions
CI / android (push) Blocked by required conditions
CI / miri (push) Blocked by required conditions
CI / test-figma-inspector (push) Blocked by required conditions
Pass the window_adapter over, this could also be usefull to do the
conversion from phx to px and so on.
2025-06-11 18:49:47 +02:00
Nigel Breslaw
b763bf65ef
Tooling: Debug console for live-preview ( #8630 )
...
Previously to see errors or debug info using debug(...) required the output panel of a speperate IDE or for Slintpad to open the browser developer tools.
This PR adds a dedicated panel to the live-preview. Log messages include a link back to the source file and line number for fast finding where the message was generated. Syntax errors also now show in the logs.
By default the panel is minimised and logs will clear themselves on UI recompile. The last log message does show as a preview on the minimised bar meaning in many cases you never need to open the panel.
---------
Co-authored-by: Tobias Hunger <tobias.hunger@slint.dev>
2025-06-06 15:40:56 +03:00
Tobias Hunger
ce8b42b3a1
live-preview: Get better basic values for the property editor
2025-06-02 13:28:25 +02:00
Tobias Hunger
c1ee38d5cd
live-preview: More tests for brushes in globals
2025-05-28 14:54:19 +02:00
Nigel Breslaw
a04b55b08b
Simpler preview tab telemetry ( #8545 )
2025-05-27 00:03:10 +03:00
Tobias Hunger
1722b9ab69
live-preview: Separate the UI related code a bit better
CI / wasm_demo (push) Has been cancelled
CI / tree-sitter (push) Has been cancelled
CI / node_test (windows-2022) (push) Has been cancelled
CI / python_test (macos-14) (push) Has been cancelled
CI / python_test (ubuntu-22.04) (push) Has been cancelled
CI / python_test (windows-2022) (push) Has been cancelled
CI / cpp_cmake (ubuntu-22.04, stable) (push) Has been cancelled
CI / build_and_test (--exclude bevy-example, ubuntu-22.04, 1.82) (push) Has been cancelled
CI / build_and_test (--exclude ffmpeg --exclude gstreamer-player, --exclude bevy-example, windows-2022, 1.82) (push) Has been cancelled
CI / build_and_test (--exclude ffmpeg --exclude gstreamer-player, macos-14, stable) (push) Has been cancelled
CI / build_and_test (--exclude ffmpeg --exclude gstreamer-player, windows-2022, beta) (push) Has been cancelled
CI / build_and_test (--exclude ffmpeg --exclude gstreamer-player, windows-2022, stable) (push) Has been cancelled
CI / build_and_test (ubuntu-22.04, nightly) (push) Has been cancelled
CI / node_test (macos-14) (push) Has been cancelled
CI / node_test (ubuntu-22.04) (push) Has been cancelled
CI / cpp_test_driver (macos-13) (push) Has been cancelled
CI / cpp_test_driver (ubuntu-22.04) (push) Has been cancelled
CI / cpp_test_driver (windows-2022) (push) Has been cancelled
CI / cpp_cmake (macos-14, 1.82) (push) Has been cancelled
CI / cpp_cmake (windows-2022, nightly) (push) Has been cancelled
CI / cpp_package_test (push) Has been cancelled
CI / vsce_build_test (push) Has been cancelled
CI / mcu (pico-st7789, thumbv6m-none-eabi) (push) Has been cancelled
CI / mcu (pico2-st7789, thumbv8m.main-none-eabihf) (push) Has been cancelled
CI / updater_test (0.3.0) (push) Has been cancelled
CI / fmt_test (push) Has been cancelled
CI / esp-idf-quick (push) Has been cancelled
CI / android (push) Has been cancelled
CI / miri (push) Has been cancelled
CI / test-figma-inspector (push) Has been cancelled
2025-05-22 16:58:58 +02:00
Tobias Hunger
c25d15c3d2
live-preview: Remember recent colors
...
... for the duration of the session. How can we save those
colors?
Recent colors change a lot, we probably do not want that stored
inside the git repository hosting the slint files... and this is
probably "personal data" and nor "project data" in the first place.
2025-05-22 15:30:30 +02:00
Tobias Hunger
a90a986263
live_preview: Fuzzy-match palette entries
2025-05-22 09:46:30 +02:00
Tobias Hunger
0e0b85cda7
live-preview: Extract data from Palettes
...
... and rpesent that data to the UI. No UI has been
implemented for this yet.
2025-05-21 16:28:03 +02:00
Tobias Hunger
dbe7598480
live-preview: Add a palettes
property to Api
...
... so that the UI side can know about all the palette entries.
Populate this property with the `Colors` namespace.
2025-05-21 16:28:03 +02:00
Nigel Breslaw
f40ce5fb1b
Basic live-preview telemetry ( #8488 )
2025-05-21 11:35:25 +03:00
Tobias Hunger
29eb832d06
live-preview: Add a method to clone [GradientStop]
2025-04-16 14:44:00 +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
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
Tobias Hunger
d06671f587
live-preview: Extract the property_view related code from ui.rs
...
The file is just too big!
This patch does not contain any intended code changes.
2025-04-10 13:00:32 +02:00
Tobias Hunger
081452bee9
live-preview: Explicitly set live-data values on reload
...
Set all values that are changed compared to the initial
set of values right after loading a new component.
This also includes a small change to the printerdemo,
so that it exposes more data to the business logic,
so that we have something to demonstrate;-)
2025-04-09 09:39:04 +02:00
Tobias Hunger
1822f95be8
live-preview: Implement backend code to handle tables of live data
...
This is just the backend side, no UI changes were done.
2025-04-01 17:36:50 +02:00
Nigel Breslaw
03c74383dc
nigel/picker-polish ( #8015 )
2025-04-01 17:38:36 +03:00
Tobias Hunger
b1200a1833
live-preview: Polish BrushWidget
...
It now works, provided the first thing you do is
to drag one of the color sliders ;-)
2025-03-21 18:11:45 +01:00
Tobias Hunger
4cc7297188
live-preview: Make the "preview" part of the gradient edit work
...
... including adding/removing values and such. Whoho.
2025-03-21 18:11:45 +01:00
Tobias Hunger
9020f6e537
live-preview: Add rudimentary BrushWidget
...
... and add helper code to enable the backend to set/show
Brush information.
2025-03-21 18:11:45 +01:00
Tobias Hunger
9f91a60ca7
live-preview: Show name of component instead of <MAIN>
...
... when that data is available ... which should be basically
all the time ;-)
2025-03-06 17:39:01 +01:00
Tobias Hunger
7da7e10435
live-preview: Fix get_property_value_table
...
... to actually use the code that is also used by
the tests :-)
2025-03-06 12:01:41 +01:00
Tobias Hunger
a90bb8d41b
live-preview: Export live preview table data from BL
2025-03-06 09:02:33 +01:00
Tobias Hunger
590a021957
live-preview: Report errors when setting preview data
...
... into the StatusLine.
2025-03-04 10:41:23 +01:00
Tobias Hunger
3703005557
live-preview: Show why no live data is present ( #7783 )
...
* live-preview: Show why no live data is present
Always list all elements that *could* have live
data, add a Text about "no properties" into empty
ones.
Co-authored-by: Simon Hausmann <hausmann@gmail.com>
2025-03-04 10:41:05 +01:00
Tobias Hunger
9c5dfd4587
live-preview: Fix panic when adding properties
2025-03-04 10:40:42 +01:00
Tobias Hunger
77f676d69d
live-preview: Update the live-preview data model ( #7741 )
...
... on reloads. That is needed to make the UI aware
of the new data.
I tried to be clever and not update widgets on model
changes, but that is not a problem anymore as all
the property values are no longer passed through
the model. So the only reason to update the model now
is because the code was loaded fresh and we *need*
to refresh the entire UI in that case.
2025-02-26 11:00:06 +13:00
Tobias Hunger
9679657bc6
live-preview: "Fix" types with units
...
We have several types that all support a range of units.
Internally all those units match back to one "base unit"
that the type is measured in.
In the spirit of simplicity: Support only that base unit
for now.
We need a more elaborate JSON scheme to pass units around
with those numbers :-/
2025-02-25 22:33:43 +01:00
Tobias Hunger
34b115bc9f
live-preview: Enums in preview data mode
...
... were shown as JSON, fix this!
2025-02-21 16:30:47 +01:00
Tobias Hunger
f96ce07287
live-preview: Refactor Api between backend and UI
...
Only push basic information over the boundary in a model.
The values themselves now need to be queried via `Api`.
Pros:
* Slint tracks the properties automatically, no more
Property change tracker!
Cons:
* Live preview is less useful now as we can not yet provide
function call results via ourr data API.
2025-02-21 10:50:53 +01:00
Tobias Hunger
0909397b7a
live-preview: Polish: A container should not contain components
...
A PropertyContainer should not contain component_name and component_id.
Rename those to container_name and container_id.
2025-02-20 18:12:54 +01:00
Tobias Hunger
17c8ab002f
live-preview: Small cleanup
...
Remove the set_*preview_data() functions from preview.rs
They did not spark joy.
2025-02-20 18:12:54 +01:00
Tobias Hunger
2b59df1355
live-preview: Simple Data edit mode
...
We can now set all the properties exposed to the
business logic of a UI we are previewing.
Simple properties only so far, everything else falls
back to JSON data.
Next step is to add more sophisticated UI to actually
edit more complex data like arrays more graphically.
2025-02-20 09:43:24 +01:00
Tobias Hunger
11886bafd6
lsp: Make code handling @tr()
as porerty values more reusable
2025-02-18 16:41:17 +01:00
Yuri Astrakhan
5356fdcf89
Fix clippy issues, plus a few manual cleanups
...
* Run `cargo clippy --fix`
* `BackendSelector` is easier to instantiate with auto `Default`
2025-02-06 17:28:51 +01:00
Tobias Hunger
e8a17e1c31
live-preview: Move library closer to the 1.9 Reference docs
...
I can not exactly mirror the Reference manual as the library
is hard-coded to one level of depth, while the docs use two
levels.
This patch takes the "lower" level of the docs ("Basic Layouts", ...),
but groups all widgets below "Std Widgets" (the "upper" level of the docs
layout). This is because we see many projects that avoid our widgets,
so I wanted those users to be able to collapse all widgets with one click.
One additional refinement in this patch is that all widgets will always be
sorted after all builtin categories and that none of the builtin Windows
will get shown in the library as those are not really editable in the live
preview anyway.
2024-12-17 13:49:59 +01:00