Commit graph

513 commits

Author SHA1 Message Date
Olivier Goffart
a0fb8bc771 Remove support of old SIXTYFPS_ env variable, and sixtyfps_widgets.60 2023-01-26 13:36:38 +01:00
Olivier Goffart
a3ec320bfb Remove some deprecated stuff
CC #2024
2023-01-26 11:19:21 +01:00
Olivier Goffart
a0fdf94fb1 StandardTableView: Remove the editable feature for now
This commit can be reverted when we want to introduce it again.
There is a few bugs with the editable property:
 - The text is not in sync with the model if the model changes after an
   edit. (can be seen by making an edit and then sort)
 - The highlight of the current row doesn't work properly
 - We should probably only edit on double click or some shortcut instead
   of just clicking
 - The editable field exist but does nothing for the StandardListView
2023-01-24 07:31:29 +01:00
Olivier Goffart
66b848227b StandardTableView resizable columns 2023-01-23 16:26:49 +01:00
Simon Hausmann
24dcef5fed
First stage of cleaning up the export handling of the slint root component (#2095)
We implicitly export the last component of a .slint file to the generator.
Issue a warning when that happens and suggest to export it explicitly.
2023-01-23 15:19:49 +01:00
Simon Hausmann
629c7ed80e Remove undocumented and dysfunctional PathLayout
This type is poorly implemented and not documented. Let's remove it for now.
It shall remain available in the git history in the event of a resurrection.
2023-01-21 13:10:19 +01:00
Simon Hausmann
96c80a2dd1
Fix crash when using an int model in a repeater with a negative value (#2063)
Make sure that we return an unsigned for row_count() in C++ and Rust by ensuring an unsigned int model at creation time.

For the interpreter this "worked" by chance as casting a negative floating
number to usize automatically caps at zero, and all values are stored as f64. For safety this patch
applies the same fix though, to be on the safe side.
2023-01-14 21:20:14 +01:00
Florian Blasius
f2aab576f4
Add StandardTableView widget (#2032)
* Text only StandardTableView with column and rows
* Text editing of cells
* Sort by column ascending and descending
* Variants of the TableView for native, fluent and material
2023-01-12 19:41:12 +01:00
Simon Hausmann
830c5eb1fd Fix 32-bit C++ build
Adjust sizes of opaque value and component compiler wrapper structs.

These have been out of sync for many releases (I stopped at v0.2.0, but it goes further AFAICS).
2023-01-03 10:22:07 +01:00
Olivier Goffart
c5496186a9 interpreter: properly normalize when invoking function 2023-01-02 23:55:47 +01:00
Olivier Goffart
629a64ba89 C++ interpreter: do the renaming invoke_callback -> invoke 2023-01-02 23:55:47 +01:00
Olivier Goffart
16fdd0595b interpreter: Rename invoke_callback to invoke
Since it can be used to invoke both functions and callbacks
2023-01-02 23:55:47 +01:00
Olivier Goffart
128988a3f5 interpreter: allow to invoke functions 2023-01-02 23:55:47 +01:00
Olivier Goffart
1cbd61145e WIP: pure qualifier for callback and functions 2022-12-22 00:26:27 -08:00
ogoffart
ce07d078ce Bump version number to 0.3.4 2022-12-16 09:36:15 +00:00
Olivier Goffart
dfdbc942f6 Split Expression::CallbackReference and Expresison::FunctionReference 2022-12-06 14:56:25 +01:00
Olivier Goffart
4672e54f5e Compiler: make calling functions work 2022-12-06 14:56:25 +01:00
Olivier Goffart
851a910e41 Parser: Parse functions 2022-12-06 14:56:25 +01:00
Olivier Goffart
8cf05ddd04 Fix panic in the interpreter when evaluating init in a layout
The repeater code already call the init code, so we shouldn't call it
twice.
2022-12-06 13:35:03 +01:00
Simon Hausmann
11f46906a2 Centralize rust-version in Cargo.toml
Require 1.64 in the workspace and inherit the setting in package
Cargo.toml files.
2022-12-05 12:39:14 +01:00
Simon Hausmann
7122d22c88 janitor: use the new default attribute for enums 2022-12-05 10:20:39 +01:00
Olivier Goffart
20bc567b6d Don't match builtin type purely on it's base type name
Make sure this is the actual builtin type we are looking at and not a
re-defined component

Doesn't work for ListView unfortunately because ListView is not a
builtin type

CC #861
2022-12-01 12:56:59 +01:00
ogoffart
fb02b4118b Bump version number to 0.3.3 2022-11-28 13:11:11 +00:00
Simon Hausmann
4308ed921d
Add documentation about the available widget styles and how to select them (#1910) 2022-11-25 14:53:20 +01:00
Simon Hausmann
d8a1f2cf01 Introduce a rem unit in the type system
This allows specifying font sizes relative to the Window's
default-font-size, similar to CSS rem.
2022-11-24 11:33:38 +01:00
Olivier Goffart
39aebc1f4e Use the std::ops::Range as range in the repeater
And fix the preview highlight to use that
2022-11-17 12:23:23 +01:00
Olivier Goffart
0d39e6f721 Make use of ItemRc::map_to_window 2022-11-17 12:23:23 +01:00
Olivier Goffart
baf1e6ef0f Polish the highlight of the preview in the LSP 2022-11-17 12:23:23 +01:00
Olivier Goffart
1884750960 WIP: LSP: highlight selected element in the preview 2022-11-17 12:23:23 +01:00
Simon Hausmann
907b58161c Add support for invoking an init callback on component and element construction
This enables imperative code to be run. To be used sparingly :-)
2022-11-17 10:12:08 +01:00
Florian Blasius
61c39b5fa1 Add support for dispatching key events through the public platform API
This change adds `KeyPress` and `KeyRelease` variants to the
`WindowEvent` enum, along with the new `slint::Key` enum, that allows
encoding keys.
2022-11-15 10:34:17 +01:00
Olivier Goffart
a78ca89063 Interpreter: disallow setting output properties 2022-11-09 18:48:19 +01:00
Simon Hausmann
7259b2e18b
doc: hide the testing module from slint::interpreter (#1828)
This is not meant to be public API.
2022-11-09 09:36:26 +01:00
Simon Hausmann
01d666083f doc: Remove the experimental tag from the Skia renderer
Should've done that for 0.3.1, but better late than never :)
2022-10-31 10:50:28 +01:00
ogoffart
2171773a3e Bump version number to 0.3.2 2022-10-28 09:30:14 +00:00
Olivier Goffart
f055afd2de New syntax: allow to create component without base 2022-10-26 18:09:57 +02:00
Olivier Goffart
28ae8f7bc4 Refactoring: split ElementType away from the types used as property type
These are two different concept, and it is confusing to keep them in the
same enum

We want to support component without any base element, and Void is
already used for global component, so do this refactoring before
2022-10-26 14:50:44 +02:00
Simon Hausmann
c16253d29f Use Property<LogicalLength> instead of Property<Coord>
This removes the special code for the generated property getters and
ensures type safety in the run-time library for property value setting.

In the Rust generated code we continue to do arithmetic on the scalar
values, that means we immediately extract the scalar, do arithmetic and
rely on the compiler to only allow compatible units.

Danger zone alert: In the interpreter Value::Number can now be converted
to LogicalLength as-is.
2022-10-24 12:49:37 +02:00
Olivier Goffart
70e8dedb75 Remove leftover dbg! 2022-10-21 12:15:48 +02:00
Olivier Goffart
76151a835d Implement BuiltinFunction::DarkColorScheme in the interpreter
- move all the builtin function to handling to its own function with an
   exhaustive match, so we get a compile error when we forgot to
   implement one

 - Let Globals know about the window because we need it to get the color
   scheme
2022-10-19 15:23:41 +02:00
ogoffart
261614b914 Bump version number to 0.3.1 2022-09-15 14:39:51 +02:00
Olivier Goffart
419016a356 Rename the compat feature again
crates.io won't let us upload a feature with dots in it:

```
Uploading slint-interpreter v0.3.0 (/home/olivier/slint/internal/interpreter)
error: failed to publish to registry at https://crates.io

Caused by:
  the remote server responded with an error: invalid upload request: invalid value: string "compat-0.3.0", expected a valid feature name at line 1 column 2254
```
2022-09-14 15:55:57 +02:00
Olivier Goffart
115c3f98f7 interpreter: Fix unregister_component called with the wrong pointer
We need the pointer that's in the VRc used when registering the items in
the cache.
2022-09-14 14:30:46 +02:00
Olivier Goffart
d0a1e42894 Intepreter: fix the window icon and title not being updated
Window::show calls apply_window_property, and that's not called if one
dirrectly call the WindowAdapter::show
2022-09-13 13:38:59 +02:00
Simon Hausmann
012dc34975 Remove the Rust and C++ migration guides from the documentation 2022-09-09 16:53:49 +02:00
Olivier Goffart
1ba4450115 Apply suggestions from code review
Co-authored-by: Simon Hausmann <simon.hausmann@slint-ui.com>
2022-09-07 17:11:57 +02:00
Olivier Goffart
8850959a2c Rename the backend feature flags 2022-09-07 17:11:57 +02:00
Olivier Goffart
15fa69ef55 Rename the compat-0-2-0 feature to compat-0.3.0
But keep a compat-0-2-0 fome compatibility anyway
2022-09-07 14:09:07 +02:00
Simon Hausmann
7967bf1ab0 Replace the internal WindowHandleAccess trait with a helper function on WindowInner
The reversal of ownership removes the need for the glue trait in the
publicly visible API.
2022-09-06 16:17:06 +02:00
ogoffart
05a49da906 Bump version number to 0.3.0 2022-09-06 13:00:22 +02:00