Commit graph

1507 commits

Author SHA1 Message Date
Simon Hausmann
3a56bcd2a4 Fix build of linuxkms backend on Yocto
We enable libseat's custom_logger feature by default, which redirects
log output from libseat into the Rust log facade. That's nice, but as
part of the implementation of this feature unfortunately libseat's
build.rs unconditionally adds /usr/local/include to the list of the
search include paths when compiling the log_handler.c file. That breaks
the Yocto build, rightly so:

warning: cc1: error: include location "/usr/local/include" is unsafe for cross-compilation [-Werror=poison-system-directories]

We can do without this feature, so let's not enable it.
2023-10-04 22:17:02 +02:00
Simon Hausmann
afbe73414e
Fix winit backend crate description 2023-10-02 23:02:33 +02:00
Olivier Goffart
d688f37ee8 Change alias to the native style depending on the platform
Fixes #3431
2023-09-29 17:05:10 +02:00
Olivier Goffart
89c269e1b9 Unpin winit version
The new version of winit fixes an important bug for macOS Sonoma,
and the bugvix for the workaround won't happen before winit 0.29.
The branch that port to winit 0.29 already removed the workaround

Fixes #3559
2023-09-28 10:10:58 +02:00
Tobias Hunger
85e1c6020b janitor: Use workspace dependnecies for the slint crates
This moves most of the version information we need to update into one
place.

Note that the workplace dependency features are in *addition* to any
feature set when using the workspace dependency. So we have all
workspace dependencies defined with `no-default-features = true`.
2023-09-25 16:34:16 +02:00
Tobias Hunger
d6695c55cb Janitor: Use cargo workspace package data more 2023-09-25 16:34:16 +02:00
Olivier Goffart
0b4bfd3a40 Qt style: Fix GroupBox not being clipped
Fixes #3541
2023-09-25 12:35:41 +02:00
Olivier Goffart
9466819421 Qt style: fix enabled state in some widgets 2023-09-25 10:48:51 +02:00
Olivier Goffart
d3ed4dfad0 Qt Widgets: set the preferred-size to the minimum-size
Instead of setting it to 0 which cause `widget.preferred-width` ti be 0

Fixes #3527
2023-09-22 14:31:46 +02:00
Olivier Goffart
4446a17b24 Skia renderer: reset the surface when the app is resumed on android
Part of #3430
2023-09-21 17:23:08 +02:00
Simon Hausmann
fd123b27bd Default to vsync for OpenGL rendering
Fixes #3516
2023-09-20 12:00:04 +02:00
Olivier Goffart
86402483f8 qt style: Fix animation when the QStyle uses update() on the widget
Example Breeze do that.

Fixes #3482
2023-09-19 21:39:59 +02:00
Thorbjørn Lindeijer
7ee17d0914
Native style: Fixed scroll bar handle size for ScrollView (#3489)
This reverts commit 07f42afef3, but applies
the same change specifically to the Slider, without affecting the
ScrollView.

The scaling up by factor 1024.0 of the min, max and value caused problems
for the ScrollView, which needs these values to match the viewport size
in order to correctly calculate the size of the scrollbar handle.
2023-09-19 10:07:25 +02:00
Olivier Goffart
46ec7875ed Software renderer: partial rendering with winit and fix non-opaque background
Implement the partial rendering with winit and our software renderer.

When the background is not opaque, we must still initialize all the
pixel with 0 otherwise we blend over the previous frame.
(That wasn't visible before because the buffer was always empty)
2023-09-13 16:08:57 +02:00
Guilhem Vallat
5cf1a45e41 Remove duplicated geometry properties from items 2023-09-13 16:08:37 +02:00
Olivier Goffart
06fc251729 Remove the geometry on ItemVTable 2023-09-13 16:08:37 +02:00
Simon Hausmann
906430416f Update softbuffer dependency
This way we're sure to pull in the fix for rendering
on X11 wire protocol, used under WSL.
2023-09-12 09:32:22 +02:00
Simon Hausmann
3652f58a3f Change item indices from usize to u32
So that the compiler and run-time can never disagree on the
number of bytes the item index can use.
2023-09-12 08:53:58 +02:00
Olivier Goffart
6e1132726a winit-sw: Loop over the buffer instead of using indices
It is possible that softbuf allocate a larger buffer than in needs?

Prospective fix for #3406
2023-09-06 16:04:03 +02:00
tronical
b8b9db4e42 Bump version number to 1.3.0 2023-09-05 15:46:36 +02:00
Simon Hausmann
dae978a0f9 Fix HighDPI rendering on Windows when using Qt as default backend
When not explicitly selected, we would construct the Backend struct as-is,
without calling `new()`. Therefore we would
miss the call to ensure_initialized() and
later set the Qt::AA_PluginApplication
application attribute, which screws up rendering.
2023-09-01 11:40:31 +02:00
Olivier Goffart
95b6eda10b Make sure PLatformError is Send+Sync as it is needed for anyhow 2023-08-31 20:52:10 +02:00
Olivier Goffart
4920224be0
Rename Slider::vertical to Slider::orientation 2023-08-30 13:43:59 +02:00
Olivier Goffart
fde561a56a Some improvements to Window visibility
- From C++, always call the Window::show() and hide() function instead
   of going through set_visible directly as it doesn't set the size of
   the WindowItem
 - show() should also call resize on the renderer
 - remove the is_visible in the WindowAdapterInternal as it is no longer
   needed
2023-08-30 13:05:35 +02:00
Olivier Goffart
4ad5b1f6d6 Remove the pin of nix 0.26.2 since nix 0.26.4 was released 2023-08-29 18:42:30 +02:00
Simon Hausmann
a98e07417e Add support for a simple event loop with proxy to the testing backend
Moved from the spawn_local test, this allows for re-use in the
show_strongref integration test.
2023-08-28 13:45:28 +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
Simon Hausmann
48063f0df8 Fix Skia OpenGL/Vulkan feature selection
With C++, we would not forward the opengl/vulkan flags to the skia renderer, so
selecting no backend but just the SKIA_RENDERER_OPENGL would end
up merely selecting Skia, not activating the opengl feature.

The renderer features will continue to be delegated to the backend
selector crate, where they will be activated directly in the renderer.
2023-08-28 13:22:33 +02:00
Olivier Goffart
93a8f604a8 linuxkms: update dependencies 2023-08-28 12:04:34 +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
541e7137c6
Backends: don't resize the WindowItem in set_visible
We already query the size right after the call to set_visible in the
WindowInner::show()
2023-08-24 13:15:28 +02:00
Olivier Goffart
44a8147201
Rust platform API to query window properties 2023-08-22 18:32:50 +02:00
Olivier Goffart
f100ee48ff Fix alias to externaly modified property not being marked as such
In the case of bug #3318, the implicit alias to the window's height or
width was removed but the propery was not marked as externaly modified,
causing later pass to optimize and inline things that shouldn't

Fixes #3318
2023-08-22 16:20:13 +02:00
Olivier Goffart
25fb6ade76
winit: re-export the winit crate
Such that people that want to use i-slint-backend-winit don't need to
also import the right version of winit from their Cargo.toml and just
can re-use the re-exported version
2023-08-21 17:49:45 +02:00
Simon Hausmann
6dd60113f1 Add some information about the display handle when glutin::display::Display::new() fails
The error from glutin is just a string.

cc #3312
2023-08-21 17:16:55 +02:00
Olivier Goffart
c84a89c4ef Native Style: Fix groupbox with the fusion style 2023-08-17 20:44:51 +02:00
Olivier Goffart
8884ce3565 Native Style: don't call initFrom on QStyleOption
This adds the enabled state which we don't need
2023-08-17 20:44:51 +02:00
Olivier Goffart
244e03a823 Native style: Fix animations
Commit bcbe157712 fixed animations in the
breeze style, but broke other style because it removed the call to
accept() the event
2023-08-17 20:44:51 +02:00
Simon Hausmann
96d7bb132c reuse: remove glob for markdown files
Instead, place the copyright and license right into the source.

To satisfy reuse, this also removes the unnecessary MIT.txt
symlinks.
2023-08-17 08:55:28 +02:00
Tobias Hunger
09d3eaf00a Update license symlinks
run `cargo xtask check_reuse_compliance --fix-symlinks`
2023-08-16 11:46:15 +02:00
Simon Hausmann
81a53110c4 Fix window always coming to the front on Ubuntu 20.04 when window properties change
Only call set_window_level if the value changes.

Fixes #3280
2023-08-16 11:29:33 +02:00
Eric
4b9fb89332
add property for slider to support vertical orientation (#3236) 2023-08-16 09:58:50 +02:00
Olivier Goffart
7ec5b01ff0 C++: Properly enable the software renderer when the feature is enabled 2023-08-02 11:57:02 +02:00
Olivier Goffart
bcbe157712 Native style: Fix animations with the KDE's breeze style
The style use update() on an invisible widget so animations wouldn't
work. As a workaround, capture the MetaCall event
2023-08-02 10:56:25 +02:00
Olivier Goffart
5718b15899 Qt platform: use QWindow::requestUpdate instead of QWidget::update
Otherwise we may repaint too fast

Fixes #3193
2023-08-02 10:56:25 +02:00
Simon Hausmann
203a5ed431 linuxkms: Tweak mouse cursor appearance
- Fix the viewbox so that cursor isn't squashed but appears in the
  correct ratio.
- Add a ~2 pixel wide white stroke around it, so that it's easier to see
  on dark background.
2023-07-31 20:11:15 +02:00
Olivier Goffart
f5caafd379 linuxkms: Implement support for SLINT_SCALE_FACTOR 2023-07-31 19:35:17 +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
23ca0cb36c Disambiguate Render trait type name
Use FullscreenRenderer as name for the trait used in the linuxkms backend
2023-07-31 17:11:43 +02:00
Simon Hausmann
868173cc20 Disambiguate the type name SkiaRenderer
- Use WinitSkiaRenderer for the adapter in the winit backend (similar to WinitSoftwareRenderer)
- Use SkiaItemRenderer for the impl of the ItemRenderer trait
2023-07-31 17:11:43 +02:00