Commit graph

84 commits

Author SHA1 Message Date
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
szecket
7c0b9b31a3
live-preview: added a component-name (#9364)
Some checks are pending
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
0ef33a097f Outline: do a compile-check before allowing drag
Closes #9196 (replaces it)
2025-08-21 15:37:38 +02:00
Simon Hausmann
470f76bd2c Re-add a Help -> About menu for SlintPad 2025-08-14 17:18:38 +02:00
Simon Hausmann
23d5b3705a SlintPad: Replace web menubar with Slint menubar
This swaps the text editor to the right and thus makes room for the Slint built-in menu bar. In Slintpad, the menu bar shows two additional entries in the File menu:

- The "Open Demo" sub-menu originates from the earlier web menubar and forwards to the editor.
- The share menu item is also quite useful from the web menu, but is now implemented by means of directly copying to the clipboard.
2025-08-14 17:18:38 +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
Some checks are pending
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
1c9aba2d3b Outline: split the type and the id in the datastructure 2025-08-01 18:28:36 +02:00
Olivier Goffart
9fceeb4dcc preview: replace a int with an enum 2025-08-01 18:25:40 +02:00
Olivier Goffart
831969409b Fix typo 2025-08-01 18:25:40 +02:00
Olivier Goffart
489e0b8729 Live-preview: Outline 2025-08-01 18:25:40 +02:00
Olivier Goffart
d34e54e872 live-preview: auto-clear log message after parsing
... instead of after the view was updated.

So that we don't see the errors prom a previous parse,
and we don't miss the debug from init callback
2025-06-11 10:33:17 +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
Nigel Breslaw
05c2b38a52
Polish picker for release (#8591)
Rename svg color to css.
Ensure 'Apply' is at the bottom in all modes.
Give empty recent colors a frame so there isn't a huge empty space when there are no recents.
Tweak the layout based on these changes.
2025-06-02 17:22:26 +03:00
Tobias Hunger
ce8b42b3a1 live-preview: Get better basic values for the property editor 2025-06-02 13:28:25 +02:00
Nigel Breslaw
ab7f884106
Show svg color or global name (#8560)
Tapping the widget will then open the picker to the svg-color tab or the globals tab.
2025-05-28 10:49:38 +03:00
Nigel Breslaw
a04b55b08b
Simpler preview tab telemetry (#8545) 2025-05-27 00:03:10 +03: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
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
Tobias Hunger
447ee5de44 live-preview: Handle colors/brushes using palette names
Find color names/values defined in palettes in property bindings.

Make sure to not report those as code.

Do a lot more complex evaluation of color values "behind" the palette name
to get a useful value out for the palete name. This will e.g. follow the
true branch of conditions, handle Structs, struct field access and references to
globals when looking for the color value.
2025-05-21 16:28:03 +02: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
e1b85bbb93 component-container: Accept focus
So that we can pass the focus into the container when it first
shows.

I thought this would be super complex to do property! What a
nice surprise:-)

Fixes: #4055
2025-04-09 09:37:28 +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
szecket
0c3a095d76 live-preview: fixing lipstick, margin, inconsistent heights, adding the dial back in 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
a90bb8d41b live-preview: Export live preview table data from BL 2025-03-06 09:02:33 +01:00
Tobias Hunger
5fcf6da7d2 live-preview: Spreadsheet UI files
... bring back the spreadsheet UI files.
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
cb08935be0 live-preview: Spread purity around... 2025-02-24 19:08:08 +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
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
Simon Hausmann
b8ffca01b4 live-preview(macOs): Add a Window menu with keep on top item
Fixes #7371
2025-01-15 17:14:02 +01:00
Tasuku Suzuki
346d1c2df3 Fix typos
Ran `typos .` and fixed all typos that do make sense.
https://crates.io/crates/typos
2025-01-13 08:35:20 +01:00
Tobias Hunger
da7ba2f99c
live-preview: More filter options in Selection Popup (#7070)
* live-preview: More filter options in Selection Popup

* Hide layouts,
* Hide interactive elements
* Hide others

@szecket did a lot of UI polish that I just merged here
so that I do not need to show what I made!

* live-preview: Remove TouchArea suffix
2024-12-13 10:51:28 +13:00
Tobias Hunger
4d309f69ba live-preview: Filter in Selection Popup
Add a filter into the Selection popup to filter out
anything not matching.

If all letters are lowercase, then it will do a case-insensitive
match, if there are non-lowercase characters it will do
case-sensitive matching instead.
2024-12-10 18:21:41 +01:00
Tobias Hunger
c44a0f0a1d live-preview: Show popup when preview is outdated
... but keep the old preview visible otherwise.
2024-12-09 13:26:41 +01:00
szecket
613b2982f1
experiment for highlighting UX (#6837)
* experiment for highlighting UX

this works really well but ideally goes back to what was selected before right click OR the selection actually moves rather than the hover color

* live-preview: Unselect in SelectionPopup again

When un-hovering some item to preview it's selection,
switch selection back to the original selection.

---------

Co-authored-by: Tobias Hunger <tobias.hunger@slint.dev>
2024-11-23 02:57:08 +13:00
Tobias Hunger
9d5b9fb46a live-preview: Implement a selection stack
... that provides a model containing all the elements
at a position sorted from "front" to "back" with extra
information so that we can present the data in a nice UI
in the next step.

The selection code now filters out builtins and ignore nodes
when collecting nodes. So the following filter step does not
need to take those into account anymore.

Whether a selection candidate is actually a part of the root
component or not is now handled by looking at whether the
elements text range is inside the root component's text
range. This is closer to what users expect to happen I think.
2024-11-19 20:20:14 +01:00
szecket
418f279abd
Sub attributes2 (#6749)
* spacing correction

* converted all property value blocks to widgets

* added secondary controls for color and string

* added secondary visuals to make hierarchy more visible

* live-preview: Wire up color widget with the backend

It lets you select colors based on the sliders, but it will
*only* apply the color when you hit enter on the text field
with the color string...

Not nice, but at least it does not keep losing state as it
round-trips the change through the code and compiler and
gets the state reset all the time.

* more dummy data

* cleanup of property sheet based on new controls

* added secondary visuals to make hierarchy more visible

correct extraneous changes

---------

Co-authored-by: Tobias Hunger <tobias.hunger@slint.dev>
2024-11-19 02:55:30 +13:00
Tobias Hunger
b86a8e41ce live-preview: Remove dead code related to design mode
That mode can no longer get enabled, so get rid of
the entire thing.
2024-11-15 14:18:56 +01:00