Commit graph

17 commits

Author SHA1 Message Date
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
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
Olivier Goffart
10e7c83020 live-preview: don't set x and y When dropping an element
This means that, when the parent is not a layout, the widgets are
always dropped in the middle of the parent, and then one can place
place it to the right position.

In particular, for widget that expaneds to the size of their parent by
default, this does the right thing

Fixes #6098
2024-09-13 10:06:40 +02:00
Olivier Goffart
524360d306 live-preview: Hide "Timer" from the lcomponent library
Timer is not really a visual element and it doesn't really make sense
to put it on the library at this point
2024-09-12 13:29:36 +02:00
Tobias Hunger
0f0b76e952 lsp: Clippy fixes 2024-08-23 18:58:44 +02:00
Olivier Goffart
cf88676a18 LSP: fix renning the tests without the preview feature 2024-07-25 22:40:30 +02:00
Tobias Hunger
ce1ff534ba live-preview: Improve how libraries are shown in the component list 2024-07-19 12:25:10 +02:00
Tobias Hunger
2c4d4e89b7 lsp: Remove Popups, Dialogs and PopupWindow from list of components
I do not expect those to be dragged onto the canvas with meaningful results.
2024-07-19 10:23:58 +02:00
Tobias Hunger
34c9351c31 live-preview: List more components in the components list
* Show all file-local componanets (check is-exported)
* Parse all known files before generating the file list

Keep the document_cache with all the extra documents loaded around,
2024-07-11 18:54:40 +02:00
Tobias Hunger
489d6c6a5b live-preview: Update categories displayed in the library
* Show all builtin elements under "Builtin Elements"
 * Show all std-widgets under "Widgets"
 * Show everything else under its file name.
2024-07-10 17:17:17 +02:00
Tobias Hunger
9e8e0ce307 lsp: Allow for local globals when collecting all components 2024-06-19 17:52:16 +02:00
Tobias Hunger
1f0262c7a7 Update tools/lsp/preview/drop_location.rs
Co-authored-by: Olivier Goffart <olivier.goffart@slint.dev>
2024-06-19 11:45:37 +02:00
Tobias Hunger
15ac565737 live_preview: Show file local components in Library 2024-06-19 11:45:37 +02:00
Tobias Hunger
c55f0a9b0e compiler: Add a snapshotter to help create snapshots of compiler state
Use this snapshot to keep a unoptimized typeloader around, so that the preview
does not need to do another parsing run.

Move the document cache in the preview over to use the snapshot.
2024-06-12 10:15:29 +02:00
Tobias Hunger
d657ee65af live-preview: Handle known components using our local DocumentCache 2024-06-12 10:15:29 +02:00
Tobias Hunger
6c034372a1 lsp: Encapsulate DocumentCache better
The Document cache is a specialized typeloader now, make it provide the
necessary APIs directly, so that we can be sure nobody will do anything
that breaks the data:-)
2024-06-12 10:15:29 +02:00
Renamed from tools/lsp/language/component_catalog.rs (Browse further)