Commit graph

49 commits

Author SHA1 Message Date
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
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
489e0b8729 Live-preview: Outline 2025-08-01 18:25:40 +02:00
Nigel Breslaw
a04b55b08b
Simpler preview tab telemetry (#8545) 2025-05-27 00:03:10 +03: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
721de2a357
Get the table editor working with color/brush (#8243) 2025-04-22 23:55:35 +03:00
Nigel Breslaw
076e933515
Fix out of sync propeties with new pickers (#8183) 2025-04-16 17:59:55 +03:00
Nigel Breslaw
efafb9d8b6
Datatab support for brush properties (#8181) 2025-04-16 17:34:51 +03:00
Nigel Breslaw
74fb172ef3
Allow editing of a brush that is hex color value or linear gradient (#8164) 2025-04-16 09:59:11 +03:00
Nigel Breslaw
8f6f06f53d
live-preview inline color widget (#8156) 2025-04-15 17:19:38 +03:00
Nigel Breslaw
2da6bf4add
live-preview data tab floating table editor (#8123)
Adds a table editor based on the color picker floating draggable panel.

This includes behaviours that keep the panel inside the bounds of the live preview window and light / dark mode.
2025-04-13 14:57:50 +03:00
Nigel Breslaw
36c7dcaf81
New Brush widget (#8082) 2025-04-10 22:58:01 +03:00
Nigel Breslaw
d607651fb1
Make the new color picker work in the data tab mode (#8030) 2025-04-02 21:55:49 +03:00
Nigel Breslaw
047377e94a
Simplify the live-preview widget layouts (#8011) 2025-04-01 15:50:05 +03:00
Nigel Breslaw
79382187ef
live-preview: Visual color picker (#7971) 2025-04-01 14:50:19 +03:00
Tobias Hunger
14b55e54b4 live-preview: Do not pass on signals from "invisible" widgets
This stops e.g. the color widget filling in default values for
empty strings.
2025-03-26 12:54:40 +01:00
Tobias Hunger
b1200a1833 live-preview: Polish BrushWidget
It now works, provided the first thing you do is
to drag one of the color sliders ;-)
2025-03-21 18:11:45 +01:00
Tobias Hunger
ee61df3d7e live-preview: janitor work: Split up the property-widgets.slint file
It got *WAY* to big.
2025-03-21 18:11:45 +01:00
Tobias Hunger
4cc7297188 live-preview: Make the "preview" part of the gradient edit work
... including adding/removing values and such. Whoho.
2025-03-21 18:11:45 +01:00
Tobias Hunger
9020f6e537 live-preview: Add rudimentary BrushWidget
... and add helper code to enable the backend to set/show
Brush information.
2025-03-21 18:11:45 +01:00
autofix-ci[bot]
9fdb122ecb [autofix.ci] apply automated fixes 2025-03-12 16:31:10 +01:00
Tobias Hunger
5e5ac0d1b4 live-preview: Polish the property widgets a bit
Use a GridLayout, that seems simpler and add a bit of extra padding.
2025-03-12 16:31:10 +01:00
Tobias Hunger
f6f8d92cec live-preview: Bring back the JSON editor till the table works!
I accidentally disabled the JSON editor for "table-like" elements.
Bring it back for now.
2025-03-07 14:58:42 +01:00
Tobias Hunger
bd20cb5a19 live-preview: Polish: Do not expand empty Property Groups
Those contain only one element informing about there not being any
properties to show. While I think it is important to show
that information so users have a chance to figure out how to
actually use the live data tab, it is not that important that
we need to always show it.
2025-03-06 16:51:54 +01:00
Tobias Hunger
a90bb8d41b live-preview: Export live preview table data from BL 2025-03-06 09:02:33 +01:00
Tobias Hunger
b706e7a019 live-preview: Add EditMultiValueWidget
back in. It should open a spreadsheet view for
table-like data in the live data preview.
2025-03-06 09:02:33 +01:00
Tobias Hunger
590a021957 live-preview: Report errors when setting preview data
... into the StatusLine.
2025-03-04 10:41:23 +01:00
Tobias Hunger
5eef8517e5 live-preview: No translation for strings in Preview Data mode
We can not transfer translation data over JSOn at this time,
so setting the trnaslation related flags breaks the UI.

It also makes little sense to set translatable strings at the level
of live data: That is the data in the application after the
translations were already applied.
2025-02-27 22:56:18 +01:00
Tobias Hunger
c65fa456ce live-preview: Try to improve the Color Widget further
At least it does set values again in Property Editor mode
and seems to work fine in general for me. But then I
think I said the same about 10 times today...
2025-02-26 08:57:19 +01:00
Tobias Hunger
9679657bc6 live-preview: "Fix" types with units
We have several types that all support a range of units.
Internally all those units match back to one "base unit"
that the type is measured in.

In the spirit of simplicity: Support only that base unit
for now.

We need a more elaborate JSON scheme to pass units around
with those numbers :-/
2025-02-25 22:33:43 +01:00
Tobias Hunger
8fd18b66fd
live-preview: Remove bottons and then fix the fallout caused by all the layouts around us f-ing up all of a sudden (#7734)
* live-preview: Disable Code and Reset buttons in live data mode

They make no sense there.

* live-preview: Fix up breakage due to hiding the buttons

* live-preview: Improve input handling for preview data

* Ignore changes while editing
* Apply chanegs once editing is done

* live-preview: Bring back the CodeWidget in PropertyEditor

* live-preview: Fix Code and Reset button in ColorWidget

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-02-25 18:32:14 +01:00
autofix-ci[bot]
27f2d1418c [autofix.ci] apply automated fixes 2025-02-24 19:08:08 +01:00
Tobias Hunger
15955cca75 Avoid if in PropertyValueWidget
This prevents the widgets from being re-generated all the
time, which in turn makes them loose their state.
2025-02-24 19:08:08 +01:00
Tobias Hunger
cb08935be0 live-preview: Spread purity around... 2025-02-24 19:08:08 +01:00
Tobias Hunger
8b4e45f7be live-preview: Polish Json edit widget
* Add red overlay in case of invalid input
* Ignore value changes while focused
* Apply value changes when losing focus
2025-02-21 16:25:05 +01:00
szecket
d9fb96b18e fixed the component display
some strange focus issue remains
2025-02-21 16:25:05 +01:00
Tobias Hunger
f96ce07287 live-preview: Refactor Api between backend and UI
Only push basic information over the boundary in a model.
The values themselves now need to be queried via `Api`.

Pros:
 * Slint tracks the properties automatically, no more
   Property change tracker!

Cons:
 * Live preview is less useful now as we can not yet provide
   function call results via ourr data API.
2025-02-21 10:50:53 +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
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