Commit graph

42 commits

Author SHA1 Message Date
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
szecket
43a3b9a6b3
live-preview: split out the data tab and used menus for widgets (#9148) 2025-08-21 16:11:22 +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
Tasuku Suzuki
9bdcc2a3dc
Live-Preview: Show "<click> unselect" only when selection exists (#8942)
Some checks are pending
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 / python_test (macos-14) (push) Blocked by required conditions
CI / build_and_test (--exclude bevy-example, ubuntu-22.04, 1.85) (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 (--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 / 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 / python_test (ubuntu-22.04) (push) Blocked by required conditions
CI / files-changed (push) Waiting to run
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 / 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-07-20 10:48:44 +02:00
Olivier Goffart
a74e5484b0 Live-Preview: use DragArea and DropArea 2025-06-26 15:39:18 +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
Nigel Breslaw
063678b29c
Stop live-preview checkerboard shifting as window resizes (#7932) 2025-03-24 15:08:50 +02:00
Nigel Breslaw
fd330b655e
live-preview: Don't let unselect work when clicking on live content (#7897) 2025-03-20 17:05:18 +02:00
szecket
275483b39e
the instructions for interaction at bottom were sometimes inconsistent (#7184) 2024-12-20 10:19:37 -05:00
Tobias Hunger
d154cde14c live-preview: Disable property editor when preview is not current 2024-12-09 13:26:41 +01:00
Tobias Hunger
498ef2a53c live-preview: Do not allow to drop anything onto an outdated preview 2024-12-09 13:26: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
db83921f1d hover change and position of window 2024-11-19 20:20:14 +01:00
Tobias Hunger
defe76649b live-preview: Show hint for right click 2024-11-19 20:20:14 +01:00
Tobias Hunger
f5682ea2e8 live-preview: Fix height calculation 2024-11-19 20:20:14 +01:00
Tobias Hunger
004ade9d44 live-preview: Implement a UI for the selection stack 2024-11-19 20:20:14 +01:00
Tobias Hunger
a1d6ce3814 live-preview: Stay in select-mode after selecting something 2024-11-15 14:19:12 +01: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
Tobias Hunger
cfb29c51ae live-preview: Move drop mark colors into styling.slint 2024-11-14 14:07:37 +01:00
Tobias Hunger
51d8205e08 live-preview: Use another seelction color for interactive building blocks
... like TouchArea and such. This might help a bit with what
you are actually selecting.
2024-11-14 14:07:37 +01:00
Tobias Hunger
88f705a777 live-preview: Move selection colors into styling.slint 2024-11-14 13:24:38 +01:00
Tobias Hunger
40cd2cc8fe live-preview: Enforce minimum size consistently
Stop resizing to a size that is too small to interact with anymore.

This was enforced in most places, but I apparently missed one ;-)

Fixes: #6286
2024-10-07 19:38:07 +02:00
Tobias Hunger
197ed638f6 live-preview: Reselect element after preview area changed size
This covers one case where the selection rectangles are wrong.

Fixes: #6438
2024-10-07 19:12:35 +02:00
Tobias Hunger
ae4ba159a5 live-preview: Always consider min/max size of the preview
Consider changes to min/max size of the preview whenever they change
and extract some common lines into a function.

Fixes: #6377
2024-10-07 15:21:43 +02:00
Olivier Goffart
d6706494a5
Binding between a read only property to input-output is deprecated (#6419)
ChangeLog: deprecated two way binding between `in` and `in-out` property

Fixes #6400
2024-10-01 16:00:06 +02:00
Olivier Goffart
e842a25c81 live-preview: Allow resizing if only one of the dimention is contrained
If the height is contreained but not the width, we should still be able
to resize
2024-09-19 15:55:29 +02:00
Tobias Hunger
6b07d525ad live-preview: Add a Del key handler into the selection
Make sure the handler gets activated whenever the selection
gets clicked.
2024-09-19 15:51:56 +02:00
Tobias Hunger
1ca3726e4e live-preview: Fix size being displayed wrongly
Stop abusing the init callback, abuse the changed callback instead ;-)

Also merge the initial size calculation into one place. This fixes the
preview showing the wrong sizes. It does introduce a bit of flicker though
as the UI is rendered in the wrong state once and then immediently corrects
itself.

That is annoying, but strictly better than staying in the wrong state till
the user does something.

Closes: #5954
2024-09-16 15:54:40 +02:00
Olivier Goffart
ca6d9af2ba live-preview: Use a checkerboard as the background
Also have a slightly bigger preferred size by default when the previewed
component is very small
2024-09-16 10:13:01 +02:00
Tobias Hunger
1697226fc1 live-preview: Use the entire screen when preferred-size of a UI is 0
Use the entire screen-space (minus borders) when the preferred size
of a UI is 0 and we are asking to reset to the preferred size.

I was reluctant to implement this before as I think it is surprising
to start with a huge size when the size info is most likely wrong...
People typically render outside the component's area in that case.

Now that we clip away anything that is not inside the UI area, I think
this is discoverable enough now: When resizing you will see the UI
getting clipped after all.

The big size also avoids confusion when nothing shows up :-)
2024-09-13 15:06:51 +02:00
Tobias Hunger
0ae32b5a33 live-preview: Clip drawing outside of ComponentContainer
Clip anything the previewed UI wants to draw outside
of the area the previewed component claims to be using.

There are several reasons to do this:

 * A window will clip the contained component
 * Selection outside of the area taken up by the
   root component can not be selected or interacted
   with
 * It is more obvious that you are doing something
   wrong when your UI is clipped. Before we happily
   showed the right thing in the preview and then
   failed hard when using that component.
2024-09-13 12:11:49 +02:00
Tobias Hunger
b95f0e62c8 live-preview: Always unselect when clicking onto background
Always unseelct the currently selected item when clicking onto
the background around the previewed UI.
2024-09-12 13:53:39 +02:00
Simon Hausmann
5825cb4f46 Use command instead of control for the status text when running on macOS 2024-09-12 12:48:34 +02:00
Tobias Hunger
b01f0f926b live-preview: Add statusline with help text 2024-09-11 16:08:27 +02:00
Tobias Hunger
8d5670f93b live-preview: Add an "selection mode" to the edit mode 2024-09-11 13:03:04 +02:00
Tobias Hunger
8859be7695 live-preview: Hide resize elements in interactive mode
... by rendering the elements as transparent. They are still
there and work, so you can still resize, but you still get a
better view of your UI.

We still draw a border around the UI, just to show where
it ends and the background begins, but that is purely
decorative :-)

I am not totally happy wioth this: It still sets mouse cursors
in the area that should actually be controlled by the UI and
overlays its own touchareas around the border of the UI, stealing
a few pixels from the interactive area of the UI.
2024-09-11 09:55:18 +02:00
Olivier Goffart
3a59950751 Experimental support for named callback parameters
And use that in the lsp/ui implementation instead of comments.

This is only a parser support for now, the name is otherwise unused.
Hence I rather keep that experimental.
2024-08-19 14:10:01 +02:00
Tobias Hunger
0b99a3d023 live-preview: Use preferred size when requesting preview
Force the preview to preferred size when explicitly asking to
preview something.
2024-08-15 13:47:25 +02:00
Tobias Hunger
3f41b6f69d live-preview: Make component selection more robust
... by not relying on the component name, which could be used in several
files.
2024-07-17 17:52:12 +02:00
Tobias Hunger
a384d957b4 live-preview: Disable the Component Label
It is too ugly and since we can no longer add components, it is not absolutely
necessary to rename comoponents either.
2024-07-16 14:20:13 +02:00
Florian Blasius
ed8b05548d
lsp-ui: apply ux feedback for headers (#5628) 2024-07-16 11:57:13 +02:00
Florian Blasius
f32bec395b
Editor: Design Review fixes for library, properties and preview (#5604) 2024-07-11 16:36:57 +02:00