Commit graph

72 commits

Author SHA1 Message Date
Tobias Hunger
5fcf6da7d2 live-preview: Spreadsheet UI files
... bring back the spreadsheet UI files.
2025-03-06 09:02:33 +01:00
Tobias Hunger
208723d8f7 live-preview: WindowGlobal object added
... so we can know the window size everywhere.
2025-03-06 09:02:33 +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
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
szecket
97809846ef added faded sidebars on out-of-date preview 2024-12-10 12:23:05 +01: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
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
szecket
c52fdd71bc
preview: attempting a header change to optimize usability (#6720)
changed the interaction for header view
both library and properties can be shown anytime
and selection is is a toggle button at any time
suggestions:
goes hand in hand with the selection mode
likely requires settings for toggle or single
select.

attempting a header change to optimize usability
TODO: make dragging from library automatically
into edit mode

the toggle that existed is the same as toggling a button - whcih can sit next to the closed library and properties.
properties should be editable while selection is active so those should be openable / visible whether in edit mode or not.

STILL TODO:
- make dragging from library automatically into edit mode
- add settings to either single select 'inspect' button or toggle on off
- change display of active icon OR add icon for toggled mode for clearer display than blue icon for inspect
2024-11-05 18:51:38 +01:00
Tobias Hunger
74f3663932 live-preview: Remove failed attempt to have global shortcuts
It does not work too well and it breaks switching between LineEdits
in the property editor. Downside: We have no more way to delete the
selected element anymore. We could have it in a tool button, but
IMHO we should have Undo before we make it that obvious.
2024-09-19 15:51:56 +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
szecket
f79043c70b
live-preview: Prettify the HeaderView (#6117)
* live-preview: Polish the header-view

* live-preview: Clean up the previous patch a bit

---------

Co-authored-by: Tobias Hunger <tobias.hunger@slint.dev>
2024-09-13 23:14:09 +12:00
Tobias Hunger
026e723029 live-preview: Add buttons to hide sidebars 2024-09-11 16:16:18 +02:00
Tobias Hunger
b01f0f926b live-preview: Add statusline with help text 2024-09-11 16:08:27 +02:00
Tobias Hunger
f5667b4d2b live-preview: Clean up icon handling 2024-09-11 13:22:04 +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
242ff57d5e live-preview: Add reload preview command to Api
... and make `Ctrl-Shift-R` trigger it in edit mode, in the same broken
way we handle the `Delete` key. It works -- till you hit `Tab` to move
the focus.

We really need #4063 or similar!
2024-09-10 14:19:54 +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
3733070c33 live-preview: Remove the functionality to add components 2024-07-16 14:20:46 +02:00
Florian Blasius
ed8b05548d
lsp-ui: apply ux feedback for headers (#5628) 2024-07-16 11:57:13 +02:00
Simon Hausmann
a4ce75de69 Remove extra vertical spacing between the header view and the library/preview/property. 2024-07-15 09:26:32 +02:00
Florian Blasius
f32bec395b
Editor: Design Review fixes for library, properties and preview (#5604) 2024-07-11 16:36:57 +02:00
Florian Blasius
dada059801 Fixed import in lsp ui 2024-07-10 21:09:57 +02:00
Florian Blasius
b573f1c7d8 Design Review: refactored lsp header 2024-07-10 21:09:57 +02:00
Tobias Hunger
74a8779e9c live-preview: Add a property editor 2024-06-28 10:58:45 +02:00
Tobias Hunger
bd32c2f143 live-preview: Use a global Api object in the UI
... to avoid going throught the root node with everything.
2024-06-26 15:14:14 +02:00
Tobias Hunger
a810fc1df3 live-preview: Move renaming of component fucntionality into the ComponentLabel
... remobving the functionality fronm the ComponentList again.
2024-06-24 14:10:16 +02:00
Tobias Hunger
d0d0327049 live-preview: Only pass information on the component previewed once 2024-06-24 14:10:16 +02:00
Tobias Hunger
127535b0e1 live-preview: Keep a stack of components previewed
... and add back/forward buttons to navigate between them.
2024-06-24 14:10:16 +02:00
Tobias Hunger
1b88f70086 live-preview: Add a "show preview" button into the component list
... It is *UGLY*, really *UGLY*. But it works ;-)
2024-06-24 14:10:16 +02:00
Tobias Hunger
35b61fa852 live-preview: Show a label of the component currently visible
* Make the location a click-target that asks the editor to navigate to that
  component
2024-06-24 14:10:16 +02:00
Tobias Hunger
37d6922983 live_preview: Wire up component renaming 2024-06-21 14:40:50 +02:00
Tobias Hunger
97daf41245 live-preview: Add a button to add a new component with
... and make it trigger a function in preview.rs.
2024-06-19 11:45:37 +02:00
Aurindam Jana
3523e86359
Simplify commercial license (#3063)
Base the commercial license on the Royalty-free license adding clauses pertaining to the fees.
2024-05-31 14:06:17 +02:00
Aurindam Jana
9a3aa265d5
Update Royalty-free license (#5257)
Add clarification that Application may not expose Slint APIs.
2024-05-31 10:53:19 +02:00
Tobias Hunger
3d34c3be6d live-preview: Move already placed elements
Allow to move already placed elements in Design Mode of the live preview.

Todo: GridLayout is not supported yet.
2024-04-29 22:50:29 +02:00
Aurindam Jana
0cfeec1a31
Update Slint Community License (#4994)
Updated the version from 1.1 to 1.2 
Renamed the header to "Slint Royalty-free Desktop, Mobile, and Web Applications License"
Added definition of "Mobile Application" and grant of right
Moved "Limitations" to 3rd section and "License Conditions - Attributions" to 2nd section
Added flexibility to choose between showing "MadeWithSlint" as a dialog/splash screen or on a public webpage
Moved the para on copyright notices to section under "Limitations"
2024-04-15 15:18:55 +02:00
Tobias Hunger
7053a21749 live preview: Add a drop marker
Add a drop mark into DropInformation to visualize where an item will get added.

This is the UI side of things and some more preparational work.
2024-04-01 16:27:35 +02:00
Tobias Hunger
21b73769a5 live preview: Provide the kind of layout to the UI
... so we can have a better idea what we need to visualize.

Move the decision on which color to use into the slint file as well:
A designer should make that call, not a developer ;-)
2024-03-22 00:32:55 +01:00
Tobias Hunger
b4120fe312 live preview Do not handle key events in error case
Only process key events while the preview is in design mode and does
not show an error. So far the only key that actually does something
is the delete key, which deletes elements. Unfortunately we do not
know which text range is covered by the element we want to delete,
so we delete random chunks of text.

So disable that when we ran into an error.

This partially addresses #4872.
2024-03-18 15:10:31 +01:00
Tobias Hunger
33d8832b5f live preview: We seem to have given up on i- prefix
... for element ids. So consistently remove them from
the live preview.
2024-03-18 15:10:31 +01:00
Tobias Hunger
1d7ca89fdc preview: Remove experimental flag from design mode 2024-03-06 17:31:26 +01:00
Tobias Hunger
feb96bb03b preview: Add more data to ComponentInformation
Add `fills_aprent` and `default_properties` to
`ComponentInformation`. The first is a bool showing
whether the Component will fill its parent or not.

The later is a set of properties that the UI will set
when the widget gets dropped.

Refactor the data passing a bit: Keep the data on known
components around. Pass only the component name into
the UI, but pass the entire `ComponentInformation` to
the `drop_location` methods.
2024-03-06 17:31:08 +01:00
Tobias Hunger
a0b862b096 live preview: Delete an element again
* Refactor the code a bit: Move element edit functions
  into the `element_edit` module below `language`
2024-02-28 15:53:49 +01:00
Olivier Goffart
a53c4c8a71 LSP preview: disable selection handle when not in experimental mode 2024-02-20 19:34:37 +01:00
Tobias Hunger
2c096aa885 live preview: Update selection when size of UI changes
Changing the size of a UI will most likely move elements
around. So reselect the current selection when that happens.

This is not a proper solution: It e.g. ignores animations
changing element sizes, etc. but it does handle one
annoying case.
2024-02-20 12:30:49 +01:00
Tobias Hunger
08372e5a07 live preview: Implement resizing and moving of selected eleement
Much polish needed, but it is a basis to build upon.
2024-02-19 22:27:32 +01:00
Tobias Hunger
e4a0a85e2f lsp: Pick one good instance when selecting/highlighting
We need to decorate an Element so we can interact with it. I want
to decorate only *one* instance of a repeated element to avoid
cluttering up the screen. So pick one good candidate for decoration:
Ideally the one the user clicked on, got for the first one
otherwise.

Store this information so we can get it back after re-rendering,
and so that we can actually mark newly added elements for selection
after they get rendered.
2024-02-19 22:27:32 +01:00
Tobias Hunger
17149505d8 live preview: Make the UI less ugly and only show it in design mode 2024-02-19 22:27:32 +01:00