Commit graph

86 commits

Author SHA1 Message Date
Simon Hausmann
1888e58735 Add API to set the XDG app id
ChangeLog: Added function to set the XDG app id on Wayland/X11. This needs to be added with respective function names in the language sections.

Fixes #1332
2024-11-22 11:24:06 +01:00
Milian Wolff
69c68b22b2 Also wrap langtype::Type::Struct in an Rc
This makes copying such types much cheaper and will allow us to
intern common struct types in the future too. This further
drops the sample cost for langtype.rs from ~6.6% down to 4.0%.

We are now also able to share/intern common struct types.

Before:
```
  Time (mean ± σ):      1.073 s ±  0.021 s    [User: 0.759 s, System: 0.215 s]
  Range (min … max):    1.034 s …  1.105 s    10 runs

        allocations:            3074261
```

After:
```
  Time (mean ± σ):      1.034 s ±  0.026 s    [User: 0.733 s, System: 0.201 s]
  Range (min … max):    1.000 s …  1.078 s    10 runs

        allocations:            2917476
```
2024-10-28 09:39:54 +01:00
Simon Hausmann
a98d4709be Move printer demo and energy-monitor into new top-level demos/ folder
These are showing off use-cases for Slint, but they're not examples showing individual Slint features.

Also removed the old printerdemo while at it.
2024-10-25 12:09:32 +02:00
ogoffart
eb273a63ee Bump version number to 1.9.0 2024-09-25 11:49:15 +00:00
Enyium
9894eca229 Fixed kebab casing of previous appwindow.slint. 2024-09-20 10:26:49 +02:00
Simon Hausmann
844590cac8
Python: Add support for snake case imports (#6229)
When using slint.loader.app_window.XXX look for "app_window.slint" followed by "app-window.slint".

Fixes #6216
2024-09-20 10:25:14 +02:00
ogoffart
4dd7d96a28 Bump version number to 1.8.0 2024-08-15 12:44:46 +00:00
Simon Hausmann
636de6fc7c Python: Fix support for named exports 2024-08-13 12:04:04 +02:00
Simon Hausmann
1e3f05c983 Python: Expose Slint structs
Structs declared and exported in Slint are now available in the module namespace
with a constructor.

Fixes #5708
2024-08-13 12:04:04 +02:00
Simon Hausmann
833883b028 Python: Fix Slint file loading in callback examples
The foo_slint import has been replaced with the auto-loader.
2024-08-11 10:27:18 +02:00
ogoffart
bbf7edc5a3 Bump version number to 1.7.2 2024-08-09 09:52:17 +00:00
Simon Hausmann
ef92c1a161 Python: reset alpha version tag 2024-07-23 15:16:30 +02:00
ogoffart
aa25e3cd44 Bump version number to 1.7.1 2024-07-23 12:05:34 +00:00
Simon Hausmann
e36eb6aba6 Document behaviour of globals when exporting multiple components
Fixes #5467
2024-07-18 13:43:13 +02:00
Simon Hausmann
6ddd4d0e04 Bump Python Alpha version 2024-07-17 11:32:19 +02:00
Simon Hausmann
e3aab79fdb Python: Improve Struct mapping
When reading, create the local equivalent of a dataclass, so that access
doesn't require ["foo"] key syntax.

Also implement the copy protocol, so that we can safely make clones of
the references returned by the ListModel.
2024-07-11 22:08:10 +02:00
Simon Hausmann
0b6381d012 Python: Fix access to globals when there's more than one
The getter for the global didn't capture the correct global_class,
just the last iteration.

This fixes the broken printer demo.
2024-07-11 22:00:39 +02:00
Simon Hausmann
0c7d2062a5 Python: Add support for exporting multiple components 2024-07-02 10:52:22 +02:00
Simon Hausmann
624796d53e Python: Make the timer test more robust
It seems that with the latest winit, quit_event_loop() might take a little longer and the timer fires once more. We don't really care how long quit_event_loop() takes in this test, merely that the timer firest and that we can terminate the loop.

Fixes #5484
2024-06-27 09:58:14 +02:00
Simon Hausmann
f3ed569592
Bump Python package alpha version 2024-06-21 20:17:18 +02:00
Simon Hausmann
3be6e641c6 Python: Attempt to build python packages with the same features as the nodejs/tool/etc. binaries 2024-06-18 09:43:37 -07:00
Simon Hausmann
b98035526b Python: Add the ability to invoke functions declared in Slint from Python 2024-06-05 14:06:10 -07:00
Simon Hausmann
b9052ecf8a
Bump Python alpha tag 2024-06-05 11:00:25 -07:00
Simon Hausmann
e0c0e8d09c
Python: reset alpha version suffix 2024-06-04 13:59:49 -07:00
ogoffart
3a6e34ba45 Bump version number to 1.7.0 2024-06-04 20:34:29 +00:00
Tobias Hunger
d9224cd58f janitor: Use more workspace dependencies 2024-06-04 14:58:29 +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
Simon Hausmann
9b00b31618
Python: bump version after alpha upload for seeking-feedback post 2024-05-03 08:07:53 +02:00
Simon Hausmann
f7c2e3a4c0
Python: bump alpha version so that next release will upload 2024-05-02 18:57:27 +02:00
Simon Hausmann
5cfd8e8c03 Fix Python build 2024-04-24 10:00:52 +02:00
Simon Hausmann
3c3b2ecb5a doc: highlight the function of the auto-loader once more in the python README 2024-04-19 09:19:59 +02:00
Simon Hausmann
f86f4993fa Python: Replace import magic with an auto-loader
As discussed on Reddit, the magic import logic is not very tool friendly and a little too magic perhaps. Instead, this patch introduces an automatic loader (`slint.loader`), which can traverse `sys.path` and lazily load `.slint` files by attribute lookup.

Closes #4856
2024-04-18 16:04:20 +02:00
Simon Hausmann
93307707cd doc: Replace the use of a git pip install with an installation from pypi 2024-04-18 15:55:46 +02:00
Simon Hausmann
97940ee7b8 Python: Mention installation via pip and sort prerequisites
cc #4138
2024-04-18 13:44:20 +02:00
Simon Hausmann
382967603f Python: Correct minimum Python version in published categories
Also removed console
2024-04-18 11:15:21 +02:00
Simon Hausmann
6408eaf0ad Python: build against abi3 to support multiple Python versions
- Upgrade to pyo3 0.21 to enable timedelta for chrono
- Enable abi3 for multi-python support
2024-04-18 09:34:43 +02:00
Simon Hausmann
1cb57a4505 Python: Try to use maturin-action to build wheels
... to allow cross-compilation and manylinux packaging
2024-04-17 14:15:21 +02:00
Simon Hausmann
b5cde20255 Python: bump version for pypi upload 2024-04-17 09:14:21 +02:00
Simon Hausmann
e4017a3e41 Python: Some pre for PyPI uploads
- Add classifiers and other meta-data
- Add alpha suffix for version (to be kept until removed manually)
2024-04-16 17:44:37 +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
Olivier Goffart
fd4dcfc128
Update MSRV to 1.73
A MSRV update is required to update the image crate to 0.25, otherwise
we get link error that are ficed in newer version.
Also other dependency update such as env_logger needs a newer MSRV.

Update to 1.73 because it has functions like `with_borrow` on thread
storage which we already actually use in some platform.

This is also the last release before the the drop of macOs < 10.12
in Rust 1.74
2024-03-27 09:04:31 +01:00
ogoffart
6bf40989d9 Bump version number to 1.6.0 2024-03-27 07:49:22 +00:00
ogoffart
20c570ab1d Bump version number to 1.5.1 2024-03-18 08:55:01 +00:00
Olivier Goffart
902de92229
Fix tests
The code snippet don't have a component and the test currently fails if there is no components.
2024-03-14 18:06:43 +01:00
Olivier Goffart
4dbdfa9e6a
Specify that code snippets uses the slint language 2024-03-14 17:41:30 +01:00
Simon Hausmann
b83ace4e6d
Python: Fix MSRV 2024-03-08 15:21:30 +01:00
Florian Blasius
2355234553 Fixed typo in python readme 2024-03-08 10:32:10 +01:00
Simon Hausmann
c1e8d7c07d Python: Add missing write-back support for Models
Ooops :-)
2024-03-07 19:48:48 +01:00
Simon Hausmann
cc83784de5 Python: Remove link to milestone 1
Instead refer to the remaining tickets for now.
2024-03-07 17:51:00 +01:00