Commit graph

170 commits

Author SHA1 Message Date
Nigel Breslaw
09dae48828 Color Picker: Support @conic-gradient (#9592)
Some checks failed
CI / node_test (macos-14) (push) Has been cancelled
CI / node_test (windows-2022) (push) Has been cancelled
CI / cpp_test_driver (ubuntu-22.04) (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 / mcu (stm32h735g, thumbv7em-none-eabihf) (push) Has been cancelled
CI / mcu-embassy (push) Has been cancelled
CI / wasm_demo (push) Has been cancelled
CI / tree-sitter (push) Has been cancelled
CI / updater_test (0.3.0) (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
CI / material-components (push) Has been cancelled
CI / node_test (ubuntu-22.04) (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_test_driver (macos-14) (push) Has been cancelled
CI / cpp_test_driver (windows-2022) (push) Has been cancelled
CI / cpp_cmake (macos-14, 1.85) (push) Has been cancelled
CI / cpp_cmake (ubuntu-22.04, stable) (push) Has been cancelled
CI / cpp_cmake (windows-2022, nightly) (push) Has been cancelled
CI / ffi_32bit_build (push) Has been cancelled
CI / docs (push) Has been cancelled
CI / wasm (push) Has been cancelled
CI / fmt_test (push) Has been cancelled
2025-10-02 10:38:59 +02:00
Nigel Breslaw
cef3328c02 live-preview: Auto highlight property on focus (#9588)
When clicking a property the value was not being highlighted. So as you 
would type the value or '0' would be left and you would end up seeing 
`x: 030`. This now adds the expected behaviour where the value is 
highlighted on focus and typing replaces the whole value.
2025-10-02 10:38:59 +02:00
Olivier Goffart
0796bb1db4 live-preview: Simplify the code of the property editor
Put the NameLabel outside of the typed property widget
2025-10-02 10:38:59 +02:00
Olivier Goffart
d8997a0a4e live-preview: WIP: code/value mode for property
This is a big WIP and incorporate some of @szecket's design
This is not yet fully functional and needs lots of cleanup of the value widgets
2025-10-02 10:38:59 +02:00
Olivier Goffart
cf2caaf223 live-preview: Fix resizing of elements
Not sure why commit 004ade9d44 removed
that code
2025-09-16 13:08:50 +02:00
Olivier Goffart
53c028cb29 live-preview: research the search when the panel gets hidden or shown 2025-09-12 17:25:40 +02:00
Olivier Goffart
b9a37f6396 live-preview: Add action to rename component in the library 2025-09-12 16:07:07 +02:00
Olivier Goffart
f493e52517 live-preview: Context menu to preview a component
This re-use the feature that was remove in a85a1cdca1
But uses a context menu instead of just a click.
2025-09-11 19:21:32 +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
27497dffbf live-preview: Remove the search on the properties panel for now 2025-09-08 17:46:55 +02:00
szecket
75c5ec7763 live-preview: update library search
- updating search
 - integrated search and ViewHeader into Library
 - fix up header to accomodate other views
2025-09-08 17:46:55 +02:00
szecket
fb1a2964fc
Live-preview: match library background to other widgets (#9339) 2025-09-08 13:07:12 +02:00
szecket
43a3b9a6b3
live-preview: split out the data tab and used menus for widgets (#9148) 2025-08-21 16:11:22 +02:00
szecket
d34931d510
live-preview: console scale control (#9199)
Some checks are pending
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-2025-08-15) (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 (pico2-st7789, thumbv8m.main-none-eabihf) (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 / esp-idf-quick (push) Blocked by required conditions
CI / android (push) Blocked by required conditions
CI / miri (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 / fmt_test (push) Blocked by required conditions
CI / test-figma-inspector (push) Blocked by required conditions
2025-08-20 13:55:42 +02:00
szecket
416c6d0f34
visual-editor: clean up property and data display (#9049) 2025-08-02 13:47:44 +02:00
Olivier Goffart
489e0b8729 Live-preview: Outline 2025-08-01 18:25:40 +02:00
Olivier Goffart
a74e5484b0 Live-Preview: use DragArea and DropArea 2025-06-26 15:39:18 +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
85f004b72f
live-preview: Mark strings as translatable (#8661) 2025-06-10 16:48:34 +03: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
ff5ac80aea
Ensure consistent margins in new Color/Brush items (#8608) 2025-06-03 17:51:54 +03:00
Tobias Hunger
8faa22292e live-preview: Filter non-colors/brushes in color/brush dialog
Some checks are pending
CI / wasm_demo (push) Blocked by required conditions
CI / tree-sitter (push) Blocked by required conditions
CI / files-changed (push) Waiting to run
CI / build_and_test (--exclude bevy-example, ubuntu-22.04, 1.82) (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 / cpp_test_driver (ubuntu-22.04) (push) Blocked by required conditions
CI / test-figma-inspector (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 (windows-2022) (push) Blocked by required conditions
CI / cpp_cmake (macos-14, 1.82) (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 / 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
2025-06-02 20:00:48 +02: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
Nigel Breslaw
16dedbec2f
Use gradients in globals palette (#8566)
Some checks failed
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 / 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 / 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 / tree-sitter (push) Has been cancelled
CI / cpp_cmake (ubuntu-22.04, stable) (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 / mcu (stm32h735g, thumbv7em-none-eabihf) (push) Has been cancelled
CI / mcu-embassy (push) Has been cancelled
CI / ffi_32bit_build (push) Has been cancelled
CI / docs (push) Has been cancelled
CI / wasm (push) Has been cancelled
CI / wasm_demo (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
* Use GradientIndicator in Globals palette
* GradientIndicator can have rounded corners
2025-05-28 16:17:26 +03: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
Nigel Breslaw
26b9ad2622
live-preview: Improve filter UX (#8542)
Filter out brush globals for <color> properties
Show search icon in filter UI
Recent colors were not showing on gradient color picker
2025-05-26 16:09:05 +03:00
Nigel Breslaw
7c1cefd806
Simplify the brush picker (#8528)
This makes the WindowManager simpler and know less about the Pickers internals.
This logic is now handled via the PickerData global.
2025-05-26 13:06:33 +03:00
Nigel Breslaw
f7d51ec5fe DRY with TabBar
Turn duplicate code into TabBar and simplify logic.
2025-05-23 18:48:30 +02:00
Nigel Breslaw
9d142ea4ec
live-preview: Pickers support palette filter (#8519) 2025-05-23 16:58:56 +03:00
Nigel Breslaw
2fbe091b93
live-preview: Add simple support for Globals and svg-colors (#8515) 2025-05-23 12:25:47 +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
Nigel Breslaw
2c71c8539d
Make palette apply clicked colors (#8498) 2025-05-22 12:47:23 +03:00
Tobias Hunger
a90a986263 live_preview: Fuzzy-match palette entries 2025-05-22 09:46:30 +02:00
Nigel Breslaw
f06c8f8a85 Show basic palettes
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.82) (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-05-21 16:28:03 +02:00
Simon Hausmann
904bc56e62 Introduce Platform.style-name
This replaces the previously hidden `StyleMetrics.style-name` that was only accessible for internal use.
2025-05-06 13:06:27 +02: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
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
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