Commit graph

31 commits

Author SHA1 Message Date
Simon Hausmann
eb825f2e95 Support default-font-* properties in Live-Preview
... by changing the resolution for the `WindowItem` to traverse the
item tree from the current item, instead of going to the window.

This doesn't quite fix #4298 because `rem` resolution is still missing.
That requires the built-in default font size function to be fixed as
well, which is non-trivial.

cc #4298
2025-04-24 09:18:45 +02:00
Tobias Hunger
50520f124f interpreter: Simplify EvalLocalContext
Replace the enum with the only variant that is actually
used: The one taking an `InstanceRef`.
2025-04-11 18:36:15 +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
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
a8f912900b janitor: Fix warnings in nightly about redandant use 2024-02-19 17:05:21 +01:00
Olivier Goffart
43dbf5709b Interpreter: fix segfault when trying to access destroyed parent
We were having a reference to the parent item tree, assuming the parent
was living longer than the item tree. But this is not the case if
there existed a ItemRc to one item in the inner part.

So use a Weak for the parent instead.
2024-01-23 14:02:26 +01:00
Olivier Goffart
091dd0a7b9 Rename dynamic_component to dynamic_item_tree 2023-10-09 11:01:56 +02:00
Olivier Goffart
a5488d6285 Rename RepeatedComponent -> RepeatedItemTree
And some more cleanups
2023-10-09 11:01:56 +02:00
Guiguiprim
05cdf88871
Add spacing-horizontal and spacing-vertical to layout (#3532) 2023-09-28 13:49:28 +02:00
Aurindam Jana
5a4a7fee63
Update royalty free license to 1.1 (#2994) 2023-07-10 10:12:11 +02:00
Olivier Goffart
11dea135f7 Domain: slint-ui.com -> slint.dev 2023-06-16 10:55:08 +02:00
Aurindam Jana
039e54a5de
Add royalty free license to files except examples and docs (#2888) 2023-06-15 11:20:50 +02:00
Simon Hausmann
d98c6773e1 Make window adapter creation lazy in the interpreter
The main change is that the window adapter is not copied into
sub-components anymore - instead it is accessed through the root.  This
is especially important for globals.

In order to add the root, a little extra dance had to be performance on
instantiation: The self_rc/self_weak is created first and the
ComponentExtraData's fields are populated via once_cells.
2023-06-10 11:41:04 +02:00
Simon Hausmann
5665df2cb8 interpreter: Clean up Rc<&dyn WindowAdapter> vs. &Rc<dyn WindowAdapter>
Consume the Rc in the function signature where the implementation would clone it anyway.

This is also needed in preparation for InstanceRef::window_adapter()
walking up the tree of components,
by which it's not possible to return a reference anymore as
parent_instance() returns a new lifetime that's shorter than &self
inside window_adapter().
2023-06-10 11:41:04 +02:00
Simon Hausmann
3604bdbf69 Prepare interpreter for lazy window adapter creation
Replace all call sites that call unwrap() on window_adapter_ref() with a call
that returns a &Rc<dyn WindowAdapter> and use an Option variant for register/unregister component.

For the former, in the future, we want to create the adapter if it doesn't exist.
For the latter we don't want to do that.
2023-06-10 11:41:04 +02: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
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
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
Tobias Hunger
1e6ffeaa0f API cleanup: Rename PlatformWindow to WindowAdapter 2022-08-29 16:53:47 +02:00
Simon Hausmann
1d436778c1 Remove the use of the PlatformWindowRc alias again
and use Rc<dyn PlatformWindow> instead. The alias has to stay with the ffi
functions though and the item vtable definitions,
because we don't have an Rc<> template in C++.
2022-08-19 15:07:27 +02:00
Simon Hausmann
fd026a3991 Change itemtable to use &PlatformWindowRc instead of &WindowInner
The former is cbindgen friendly, the latter is entirely Rust internal.
2022-08-19 15:07:27 +02:00
Simon Hausmann
e37aab7bf4 Port the interpreter to the new window ownership model 2022-08-19 15:07:27 +02:00
Simon Hausmann
427cac772b Begin moving the interpreter from WindowRc to &WindowInner 2022-08-19 15:07:27 +02:00
Olivier Goffart
e85e69fda0
Declare .slint enum in one place in i-slint-common
This avoid repeating the enums both in the compiler and in
the runtime library, and register them in a bunch of other places.

So it should be easier to add enums and enum values

Since cbindgen doesn't see through the macro, generate the enum
manually
2022-04-14 19:17:48 +02:00
Olivier Goffart
0dc188f328 Support for referring to other globals from globals
- We need to make sure that the initialization of global is in the right order.
 - In C++ and rust, we need to add accessor to the global component
 - There can be `PropertyReference::Global` in binding of globals
 - The interpreter globals need to hold references to the global they may depend on

Fixes #175
2022-02-28 10:14:34 +01:00
Tobias Hunger
4230ac2572
Update copyright information to reflect name change
Also run resue over the codebase and fix complaints from that tool.
2022-02-09 10:27:47 +01:00
Tobias Hunger
de4e195280
Rename internal crates and add a README.md to them
The README.md contains the warning that used to be in lib.rs.

Add README.md files to all internal crates

... pointing to the official public crate to use instead.

Rename internal crates

fixup: README files

fixup rename
2022-02-07 13:12:48 +01:00
Simon Hausmann
cab22f8355 Rename the sixtyfps-compilerlib crate 2022-02-01 18:08:18 +01:00
Simon Hausmann
ad0c020aa4 Rename the sixtyfps-corelib crate 2022-02-01 18:04:30 +01:00
Tobias Hunger
e6b24bceec [reorg]: Set up and populate the internal directory
Move "internal" crates into the `internal` directory. This first batch
includes most of sixtyfps_runtime but leaves the rendering backends
alone for now.

pre-commit applied some cleanups to the moved files:
 - Consistent newline at end of file policy
 - trimming trailing whitespace
 - Formatting Cargo.toml files.
2022-01-31 16:00:50 +01:00
Renamed from sixtyfps_runtime/interpreter/eval_layout.rs (Browse further)