Commit graph

74 commits

Author SHA1 Message Date
Olivier Goffart
a9f526491a Timer Element
Closes #5724
2024-08-16 16:36:38 +02:00
Olivier Goffart
bd18d8dc0a Fix compiler crash when const propagating a property of component-factory with its default value
We couldn't represent an empty component factory in the exrpession tree,
so add Expression::EmptyComponentFactory for that
2024-06-25 20:25:01 +02:00
Olivier Goffart
445802c46d date_time: simplification and cleanups 2024-06-06 09:03:50 +02:00
Olivier Goffart
3da0ee5bb9 DatePicker: Logic in C++
Had to simplify a bit the rust logic to make it work
2024-06-06 09:03:50 +02:00
Florian Blasius
973ecac989 DatePicker: finished features 2024-06-06 09:03:50 +02:00
Florian Blasius
3ccee816be
Added TimePicker widget (#5251) 2024-06-05 15:23:06 +02:00
Olivier Goffart
94af4d2832 Don't optimize array
They are model and if the model is copied, the changes in model need to
apply to all copies.

Fixes #5249
2024-06-04 15:24:36 +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
Olivier Goffart
0929e3dfc1 Slint: make the abs work with unit types 2024-05-08 19:04:22 +02:00
Tobias Hunger
2e3b00e38e janitor: Fix some clippy warnings pre-release
Nothing that should be controversial, but the
`internal/compiler/builtin_macros.rs` could point to a thinko in the original
commit.
2024-05-06 16:47:14 +02:00
Simon Hausmann
31767eb6ab Add a clear-focus()function on all elements that have a focus() function
This is the counter-part, which removes focus from the element if it's currently focused. The window - if focused - may still be focused towards the windowing system.
2024-04-26 11:09:11 +02:00
Luke D. Jones
0b1ec5e4c9 Convert to struct field access and make HsvColor public 2024-04-15 18:18:00 +02:00
Luke D. Jones
4312ce8fc6 feat: color: apply HSV formatting suggestions 2024-04-15 18:18:00 +02:00
Luke D. Jones
d4a3f77877 feat: color: add HSV methods to slint 2024-04-15 18:18:00 +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
Simon Hausmann
68083243b2
Add an in-out boolean color-scheme property to Palette (#4701)
This allows applications to force dark/light mode, as well as determine
which mode is active.
2024-03-26 15:44:22 +01:00
Tobias Hunger
28b96ca6f6 janitor: manual cargo clippy fixes
Semi-random selection of clippy topics that were
uncontroversial before:-).

Leaves about 84 deduplicated issues in the code base
according to clippy from nightly.
2024-03-14 13:42:38 +01:00
Luke D. Jones
8c60cc74be feat: color: add channel properties to color
Add extra properties to the `color` type.
- `red`
- `green`
- `blue`
- `alpha`
2024-03-12 09:42:30 +01:00
Olivier Goffart
22d9fc9cf9 @image-url: Semantic analysis of the 9slice 2024-02-13 14:46:27 +01:00
Brandon Fowler
3e8940660b
Add set-selection-offsets function to TextInput, TextEdit, and LineEdit (#4197)
The function accepts two arguments that specify the start and the end of the text to select.

Fixes #4164
2024-01-06 11:12:53 +01:00
Olivier Goffart
5d4c390b0f
Compiler: Error when assigning to compile time properties
Some property need to be known at compile time. We already had checks
that the binding is a compile time constant, but there was no check to
prevent, say

    self.row = 42;

which wouldn't work or could even cause panic or miscompilation of
generated code

Closes #4037
2023-12-12 21:51:56 +01:00
Tobias Hunger
2ad8774a61 Add clamp function to slint language 2023-11-22 12:27:54 +01:00
Ken Carpenter
b20536131f
Add more easing formulas (#3812)
Closes #2655
2023-11-03 09:20:44 +01:00
Olivier Goffart
f73c1cf80d Compiler: fix conversion from unnamed to named struct
Fixes #2765
2023-09-07 14:57:05 +02:00
Olivier Goffart
cf19749943
Make a pass to remove the Expression::Return instruction
So it doesn't appear in the LLR and the C++ codegen can be simplified.
In particular, this removes the need to throw/catch exception to handle return
across generated lambdas
2023-09-06 14:10:26 +02:00
Tobias Hunger
2840886d28 Add component-factory type to Slint language
Add a type "component-factory" to the Slint language.
2023-07-27 12:04:16 +02:00
Guiguiprim
ef8ddaaa1d
Add native support for min/max 2023-07-21 16:26:41 +02:00
Aurindam Jana
5a4a7fee63
Update royalty free license to 1.1 (#2994) 2023-07-10 10:12:11 +02:00
Guilhem Vallat
555e191ab4 remove clippy::needless_borrow warnings 2023-06-30 12:28:13 +02:00
Tobias Hunger
e02c360000 Clippy polish 2023-06-28 14:22:30 +02:00
Olivier Goffart
f0a1ef7194 Fix getting type of more complex expressions in model
Fixes #2977

The problem is that expressions such as "foo * foo" can be optimized by
optimization pass to only query the property once, and this is
transformed in a Expression::CodeBlock and is no longer a
Expression::Cast(Model)
So we need to introspect the expression more.
2023-06-27 10:06:20 +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
1bf05eae7c
Add support for absolute-x and absolute-y properties on any element (#2823)
Fixes #1691
2023-06-06 14:37:53 +02:00
Olivier Goffart
cf746ddf8d WIP: formatting implementation of translate in rust and C++ 2023-06-05 16:34:59 +02:00
Olivier Goffart
a3855f1bcb WIP: add a formatting function that works in the interpreter 2023-06-05 16:34:59 +02:00
Olivier Goffart
dcd8450dfa WIP: start working on translations: @tr()
This commit just do the parsing of the @tr macro.
2023-06-05 16:34:59 +02:00
Amirhossein Akhlaghpour
3a4f3c61d5
Add @rust-attr on scturct (#2785)
Fixes: #2660
2023-06-05 16:29:55 +02:00
Olivier Goffart
7a062d23cf Fixup previous commit 2023-06-05 14:14:22 +02:00
don bright
a255aaf8d4 add list of Valid Units to the Invalid Unit error message (#2701) 2023-06-05 14:14:22 +02:00
Simon Hausmann
0f54b9599b Add support for manually closing PopupWindows
This patch adds a `close()` function that can be called to close a popup
window, and a `close-to-click` boolean that can be set to false to
disable the default behavior.
2023-06-02 18:07:49 +02:00
Olivier Goffart
5599bd44e0 Remove Color::opaque
It is not a right name and i don't think it is a so common operation
2023-06-02 17:02:08 +02:00
Olivier Goffart
4845241ebf Rename translucent to transparentize and mixed to mix 2023-06-02 17:02:08 +02:00
Arthur Araruna
64ad1ce357 Add some color and brush manipulation funcs (#2565)
The added functions enable mixing colors and manipulating the opacity
of colors and brushes.

They enable the behavior of some of the available functions from SASS and are
added for future use for adding the Adwaita style (future PR).
2023-06-02 17:02:08 +02:00
Simon Hausmann
c428601370
Add support for select-all(), cut(), copy() and paste() functions on text input elements (#2804)
In the compiler this is still very primitive, but an attempt to start a
generic interface. The basic assumption is that all item functions will
eventually need access to the window adapter and itemrc. Support for
additional arguments is still missing.

Also missing is support for the function access via rtti in the
interpreter, hence the hardcoding at the moment.
2023-06-01 16:04:53 +02:00
Olivier Goffart
a57c7eb6bc Added TextInputInterface.text-input-focused 2023-04-12 14:49:08 +02:00
Tobias Hunger
de0dc20e5b
slintpad: Move into tools/slintpad (#2435)
* Add "slintpad" to cspell white list for all languages
* Mention online_editor to slintpad rename in CHANGELOG
* Move tools/online_editor into tools/slintpad
* Update github actions accordingly

Co-authored-by: Olivier Goffart <olivier@woboq.com>
2023-03-29 16:32:30 +02:00
Tobias Hunger
3ac01c3f07 clippy: Fix clippy warnings 2023-03-09 09:35:29 +01:00
Olivier Goffart
8d7b8df922 Fix conversions of array literal containing struct with array literal
Fixes #2023
2023-01-02 23:53:22 +01:00