Commit graph

346 commits

Author SHA1 Message Date
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
c3b2654fed live-preview: Do not show "Code" button in Data preview
There is no information on code we might jump to,
so do not show that button.
2025-02-20 11:01:19 +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
szecket
28f83c64e2 live-preview: fixed indicator and made it show up when control is focused also
The indicator used to collapse secondary parts of the
property edit widgets did not work. Fix that.
2025-02-19 17:40:23 +01:00
Tobias Hunger
c71e2f3c96 live-preview: Do not offer plural forms in UI
@ogoffart relorts those do not fully work yet, so
let's just disable those for the time being.
2025-02-18 23:39:11 +01:00
autofix-ci[bot]
37d5d6d9fc [autofix.ci] apply automated fixes 2025-02-18 16:41:17 +01:00
Tobias Hunger
11886bafd6 lsp: Make code handling @tr() as porerty values more reusable 2025-02-18 16:41:17 +01:00
Tobias Hunger
70f994975e live-preview: Make translations reflect actual data
... instead of using the mock up data we used while
designing the UI and then passing back whatever the
business logic gave us for the translations.
2025-02-13 16:15:41 +01:00
Tobias Hunger
4b8287bd0f live-preview: Make property widgets use less information
Make the property widgets work with less information avaiable to
them. I hope I can reuse them for runtime widget state as well that
way.

Unexport the individual widgets and wrap them into a `PropertyValueWidget`
that switches between them as needed -- and fills in the extra information
needed to keep the existing functionality in place.

This makes the PropertyView so much cleaner ;-)
2025-02-06 16:59:05 +01:00
szecket
4af1cd3003 regression of clip corrected 2025-02-06 11:54:21 +01:00
autofix-ci[bot]
b040e9450a [autofix.ci] apply automated fixes 2025-02-05 14:26:29 +01:00
Tobias Hunger
595b571f99 live-preview: Make ExpandableGroup more re-usable
I want to use this for runtime properties later.
2025-02-05 14:26:29 +01:00
Tobias Hunger
25f3bfd95c live-preview: Move widgets out of property-view
Move the widgets used for showing property values out
of the property-view itself, so we can reuse them later.
2025-02-05 14:26:29 +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
Olivier Goffart
3e94bd2167 Janitor: Remove trailing whitespaces from all files
`git grep -I -l -O'sed -i "s/[[:space:]]*$//"' -e ''`
2025-01-10 13:23:22 +01:00
szecket
275483b39e
the instructions for interaction at bottom were sometimes inconsistent (#7184) 2024-12-20 10:19:37 -05:00
Tobias Hunger
48c1909fb0
live-preview: Remember filter settings in selection popup (#7178) 2024-12-20 08:03:45 +13:00
Tobias Hunger
93edeebe2c
live-preview: Fix filter in selection popup being init to empty (#7177)
... till the filter button is pressed for the first time.
2024-12-20 06:58:52 +13:00
Tobias Hunger
cd4bab3f5b live-preview: Make filter in selection popup behave better
... more like a ContextMenu.
2024-12-19 18:14:47 +01:00
szecket
bf66b9756f
hack to keep focus as hover steals it (#7093) 2024-12-13 16:59:15 -05:00
szecket
5f8c88e0ec just moved the filterlist touch area so it catches hover from the button 2024-12-13 15:12:35 -05: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
szecket
767bb234ff
pixel peeped some padding (#7056) 2024-12-10 15:28:46 -05:00
szecket
ba4b3cf5b4
change the icon, recolor and reposition it (#7053)
* change the icon, recolor and reposition it

* added filter and removed search duplicate
2024-12-11 08:58:57 +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
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
326758b8d0 live-preview: Elide text in the selection popup 2024-11-25 22:52: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
szecket
ba14285332
Szecket/cupertino colours (#6801)
* creating a lookup table of colors based on the set on apple docs
then selecting from these colors rather than always typing hex
also added an in property for setting selected color (future)

* splitting out method of changing selection colour for later

* forgot to pull CupertinoColors from import

* Squashed commit of the following:

commit 4924aa908d6e039a7bf1f79ede3dc7c26f71007f
Author: szecket <szecket@magrittescow.com>
Date:   Fri Nov 15 17:31:45 2024 -0500

    use  defined Palette for states

commit 80711ee7188f37b1b29ce11855b6a636d7a39306
Author: szecket <szecket@magrittescow.com>
Date:   Fri Nov 15 17:29:51 2024 -0500

    make control colour consistent with style and other controls

commit 1cfd39e6da6643600e8b553dfab2418c8552cdc4
Author: szecket <szecket@magrittescow.com>
Date:   Fri Nov 15 13:58:07 2024 -0500

    selection of controls when focused is not current cupertino style and too strong

commit 4bf4ae6ad385e118687f752362b34e079c03fe22
Author: szecket <szecket@magrittescow.com>
Date:   Fri Nov 15 13:42:58 2024 -0500

    make foreground color contrast when selected

* removing property that is only in cupertino
2024-11-22 08:18:27 +13:00
szecket
db83921f1d hover change and position of window 2024-11-19 20:20:14 +01:00
szecket
0aed233f55 live-preview: move filename and lock height 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
828385b918 live-preview: Sort some properties 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
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
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
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
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