Commit graph

76 commits

Author SHA1 Message Date
Olivier Goffart
7390df1b47
ContextMenuArea: Intercept long press on Android 2025-02-24 18:27:25 +01:00
Olivier Goffart
c98d234b9e Janitor: Always use `#![no_std] for runtime lib
And call `extern crate std` when the feature is enabled.
I've read this is the good practice on how to do it.
So that the std prelude is no longer included automatically.
There is then less difference between std and and no-std build which
should avoid surprises in the CI when we use things from the prelude.

The downside is that there is a bit of churn in the tests
2025-01-27 19:22:00 +01:00
Olivier Goffart
cfbcf0b1d7
Introduce Window::try_dispatch_event (#7313)
That is the same as Window::dispatch_event, but it reports an error
instead of panicking
2025-01-09 19:39:38 +01:00
Olivier Goffart
cbc28b1f1b Android: handle properly the Destroy event
Destroy means we need to exit the event loop.
And android_main will be called again from another thread, so we need to
support reseting the proxy

There is also a bug in the timer when exiting the app that this worked
around

Fix #6626
2024-10-23 14:30:55 +02:00
Olivier Goffart
43c7f57b0f spawn_local: initialize the platform if not initialized before the call
Take the opportunity to refactor a bit the way the global platform or
context is accessed

Fixes: #5871
2024-08-21 13:26:04 +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
Olivier Goffart
f25a7c721a
Implement the Error trait for our errors 2024-05-31 13:13:12 +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
cadcd4caf4 Change callback: rust code generation 2024-05-02 22:25:53 +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
fa24283cd4 Add a few funciton to make SlintContext usefull
Make it possible to spawn future and run event loop with a SlintContext
handle
2024-01-29 15:34:48 +01:00
Olivier Goffart
18022b16b0 Move the SlintContext to a different module 2024-01-29 15:34:48 +01:00
Simon Hausmann
6ce394b90a Fix initial animation tick before the event loop runs
As soon as we have a backend, we might as well initialize the timer tick. This fixes animations not starting when run from user init callbacks.

Fixes #2809
2024-01-24 09:33:59 +01:00
Olivier Goffart
9111946a82
Introduce slint::run_event_loop_until_quit
Closes #1499
2024-01-11 13:52:02 +01:00
Olivier Goffart
9ff13faee8 Implement the quitting on windows close in i-slint-core and not in the platform
Step towards #1499
2024-01-08 21:17:52 +01:00
Olivier Goffart
503baf2898 internal: Move the backend global instance in a SlintContext
The SlintContext will hold all the thread_local state.
A small step in the direction of #4294
2024-01-08 21:17:52 +01:00
Olivier Goffart
458302d431 Additional tests for double-clicking
Relates to #4235
2024-01-04 14:38:43 +01:00
Jocelyn Turcotte
82916bc2ec Implement KeyEvent.repeat
Now that winit was upgraded do 0.29 we can use its KeyEvent::repeat field.
Also feed Qt's QKeyEvent::isAutoRepeat() in the Qt backend.
2023-11-29 09:31:31 +01:00
Simon Hausmann
7b61e455eb Initial implementation of a Slint event loop sitting on top of Node.js
At the moment this is implemented using polling.

cc #2477
2023-11-06 11:37:45 +01:00
Olivier Goffart
58e5d62a02 Winit port: Fix wasm build
Port everything from instant to web-time
2023-10-23 14:22:48 +02:00
Tobias Hunger
b12575a4c4 janitor: Go over our spell checking setup
* Extend the cspell word list
* Remove those extensions from individual source files
* white-list licenses and such as we should not meddle with those
* Fix spelling
2023-10-16 09:01:51 +02:00
Simon Hausmann
65f9e6f1eb Move the OpenGLInterface back to the FemtoVG renderer
At the moment it's only needed there, so let's
have it there and move it to core later if the need arises.
2023-08-28 13:33:15 +02:00
Ian McFarlane
1de7b1512c
Expose clipboard_text accessors to C++ (#3265) 2023-08-28 12:26:40 +02:00
Olivier Goffart
7904493e1c C++: dispatch close request and activation change 2023-08-24 17:27:04 +02:00
Olivier Goffart
c33e5a0f12
Rust platform API: add ways to send CloseRequested and WindowActiveChanged events 2023-08-24 14:39:20 +02:00
Olivier Goffart
44a8147201
Rust platform API to query window properties 2023-08-22 18:32:50 +02:00
Olivier Goffart
3a807e46c1
Renderer feature refactor 2023-07-27 19:11:24 +02:00
Simon Hausmann
f60b2ebde9 Add slint::platform::OpenGLInterface
This allows for the use of the FemtoVG renderer but delegate the GL implementation to the user.
2023-07-27 16:48:57 +02:00
Olivier Goffart
d43d24ec7e Un-hide the renderer() function from the WindowAdapter
Now that the SoftwareRenderer can be constructed, it is
finally possible to have your own WindowAdapter

Revert "Hide the `renderer()` function from the public API"

This reverts commit ff6653c77e.
2023-07-27 14:44:28 +02:00
Aurindam Jana
5a4a7fee63
Update royalty free license to 1.1 (#2994) 2023-07-10 10:12:11 +02:00
Tobias Hunger
e02c360000 Clippy polish 2023-06-28 14:22:30 +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
Olivier Goffart
ff6653c77e Hide the renderer() function from the public API 2023-06-13 17:44:04 +02:00
Olivier Goffart
f4dba7bcfd Seal the Renderer trait
Because we need to make the Render trait public so one can re-implement
the WindowAdapter trait
2023-06-13 17:44:04 +02:00
Olivier Goffart
dd5ef9993f
Platform: Add a Resized event and use that to convey the changes in size (#2759) 2023-05-21 12:12:30 +02:00
Simon Hausmann
846c48b81d Add public API to allow platforms to report the window scale factor
Add WindowEvent::ScaleFactorChanged and made set_scale_factor on
WindowInner private.

This achieves what #2486 tried to do, but using the clean platform
window event interface.
2023-05-19 17:06:38 +02:00
Olivier Goffart
aa2d5fa324 We must update animations before the timers
In case a timer start an animation, the starting time need to be correct
2023-02-17 15:27:43 +01:00
Olivier Goffart
6889dfa5f5 Rust: Make new(), run() and show() report errors from the backend
Fixes #2198
2023-02-10 05:00:03 +01:00
Olivier Goffart
f34b1bda2e Add primary keyboard support on unix (selection copy, middle click paste)
Closes #2146
2023-01-31 16:39:22 +01:00
Simon Hausmann
32d2ba70ca
Change WindowEvent::KeyPressed/Released to use a SharedString instead of a char (#2148)
Also, `WindowEvent` is not `Copy` anymore.

Closes #1749
2023-01-31 15:44:54 +01:00
Florian Blasius
d84de623b4
TextEdit select text with double and dribble click (#2088)
* Select word in `TextEdit` by double click
* Select paragraph in `TextEdit` by dribble click
2023-01-31 15:04:19 +01:00
Olivier Goffart
a3ec320bfb Remove some deprecated stuff
CC #2024
2023-01-26 11:19:21 +01:00
Olivier Goffart
30a81d856a documentation: fix formatting of the backend selection 2022-12-08 08:05:27 +01:00
Simon Hausmann
247772104a Move WindowEvent, PointerEventButton and Key to the platform module
For `Key` this is a move, as it is a new type. For `WindowEvent` and `PointerEventButton` deprecated aliases
are provided.
2022-11-24 11:34:28 +01:00
Simon Hausmann
a875c532ba Improve internal default logging behavior with std
Previously, any use of our internal debug_log!() macro would require a
platform backend to be initialized. This was confusing when debugging
something in the (headless) wasm lsp implementation and nothing showed
up on the console.

Now if we can, we will always log. If a platform backend exists, we
route through it, otherwise we can do the fallback ourselves.
2022-09-30 11:13:32 +02:00
Olivier Goffart
adb1b24c28 Fix the slint_mock_elapsed_time when not using the testing backend
The nodejs tests don't use the testing backend, as a result, calling
`platform::update_timers_and_animations` would use the real time instead
of the fake time.
So call `maybe_activate_timers` with the fake time instead
2022-09-16 19:14:15 +02:00
Simon Hausmann
6875e35ec9
Polish the platform module level-docs (#1616)
Various edits and tweaks.
2022-09-09 09:24:59 +02:00
Simon Hausmann
8ee88a53c1
MCU Doc fixes (#1615)
Various edits to the introduction of how to use Slint on MCUs.
2022-09-09 08:35:01 +02:00