Commit graph

38 commits

Author SHA1 Message Date
Olivier Goffart
d2fb69c182 winit backend: remove the GLOBAL_PROXY
We have a proxy in the backend, use it
2025-04-09 08:50:39 +02:00
Simon Hausmann
072bff8c42
wasm: Fix some shortcuts on macOS (such as cmd+a) (#7908)
The core library expects command to be mapped to control, and control to meta, for the shortcut detection. This needs to be done separately for the wasm input handling.

This helps with #7477 by fixing cmd+a. Unfortunately, the "copy" and "paste" events, while intercepted by Safari, aren't somehow delivered to our canvas element.
2025-03-22 11:53:49 +01:00
Tasuku Suzuki
346d1c2df3 Fix typos
Ran `typos .` and fixed all typos that do make sense.
https://crates.io/crates/typos
2025-01-13 08:35:20 +01:00
Simon Hausmann
7e7a3f72f0 Fix wasm build 2024-06-18 17:48:17 +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
Simon Hausmann
99d87934c0 Fix build with --cfg=web_sys_unstable_apis
Amends fadcbdf726
2024-02-05 11:50:09 +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
ed570053a9 Fix copy & paste in wasm builds
Commit f24014a2dd made the insert function
private. Let's solve this differently by creating a private WASM
clipboard and invoking copy() and paste() on the Text item instead.

The first attempt was implementing a ClipboardProvider just for the wasm
build, just like with SilentClipboard, but unfortunately that doesn't
work because in the backend's set_clipboard_text()/clipboard_text()
functions, there's no currently running winit event loop that we could
access, becaused the call stack starts directly at the DOM event
handler, not in our winit event handler.
2023-11-03 17:36:58 +01:00
Olivier Goffart
de86c6049c Adapt wasm to the latest changes 2023-11-02 12:16:40 +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
Olivier Goffart
c33e5a0f12
Rust platform API: add ways to send CloseRequested and WindowActiveChanged events 2023-08-24 14:39:20 +02:00
Olivier Goffart
ad389aa4eb linuxkms: Implement keyboard input and clamp mouse
Unfortunately, this is currently not mapped to the right keyboard layout

Also keep the mouse clamped in the visible area.
And make it start in the middle of the screen.
2023-07-31 17:27:53 +02:00
Simon Hausmann
7ff7c2f875 Fix let-else formatting
Nightly now supports it and thus `cargo +nightly fmt` yields a
difference.
2023-07-28 13:43:21 +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
Olivier Goffart
6db08553a1 Wasm: Fixup Copy/paste
The PR #2703 wasn't complete and didn't work in practice because the
clipboard is always None.

Using the clipboard event data works
2023-05-16 22:41:38 +02:00
Olivier Goffart
eb0ba51252 Fixup copy/paste support
cc #2703
2023-05-09 20:59:37 +02:00
Amirhossein Akhlaghpour
2e8708be87
Feature: Add copy/paste listener on Wasm (#2703) 2023-05-09 15:55:35 +02:00
Simon Hausmann
93dcd90c74 winit: Add API to provide access to the event loop and the winit Window
To avoid exposing the internal custom event, this also wraps the enum in
a public SlintUserEvent enum.
2023-04-24 12:59:06 +02:00
Olivier Goffart
82e23a114b Wasm: don't print fake keys in input box
We should only forward keys that are a single character. Other ones are
just virtual keys that should't be processed.

This regressed in commit 32d2ba7

Fix #2327
2023-03-09 10:46:03 +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
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
0f25000610 internal: Replace calls to the internal process_key_input with the public dispatch_event API
This can be done for key press and release events, for composition we
need to extend the API first.
2022-11-16 09:47:54 +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
Simon Hausmann
54934d1f0b Fix the cursor position when receiving composition update events
Since the DOM API doesn't provide the values, we can just place the
cursor ourselves.
2022-10-20 12:37:28 +02:00
Olivier Goffart
f3f34c3a02 wasm: Use the composition API
Pros: the composition shows up as selected
Cons: te cursor is shown at the begining of the preselection, and
clicking on the field commit the selection at the wrong place
2022-10-20 12:37:28 +02:00
Simon Hausmann
6d1497d7a2 Fix wasm build 2022-10-07 11:16:36 +02:00
Olivier Goffart
b3605cb4ec Fix errors and warnings in the wasm build 2022-09-07 10:13:58 +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
Tobias Hunger
107e3ed2e2 janitor: Fix some typos 2022-08-29 16:53:47 +02:00
Tobias Hunger
1e6ffeaa0f API cleanup: Rename PlatformWindow to WindowAdapter 2022-08-29 16:53:47 +02:00
Simon Hausmann
74289deb25 Remove the PlatformWindowWeak alias
... and use Weak<dyn PlatformWindow> directly.
2022-08-19 15:07:27 +02:00
Simon Hausmann
af86f36157 Invert slint:🪟:WindowInner and PlatformWindow ownership
Previously: Window is an Rc<WindowInner>, which has an Rc<dyn
PLatformWindow> - and weak references the other way around.

Now: Rc<dyn PlatformWindow> is the root of window ownership. The impl
PlatformWindow has a slint::api::Window, which just holds a WindowInner.

This change is incomplete on a few levels, mainly that neither of the
code generators nor the interpreter is ported.
2022-08-19 15:07:27 +02:00
Simon Hausmann
262c96af8c Simplify receiver for WindowInner
Use &self consistently, instead of Rc<Self>, so that in the future we can
replace Window(Rc<WindowInner>) with Window(WindowInner).
2022-08-19 15:07:27 +02:00
Simon Hausmann
27bf9348e6 Rename the backend-gl crate into backend-winit 2022-07-26 17:43:51 +02:00
Renamed from internal/backends/gl/wasm_input_helper.rs (Browse further)