feat(client): redesign native UI, themes, settings and avatars
Separate conversation drafts and voice view state, add native settings and restricted CSS themes, implement validated avatar cropping, and refresh dependencies with documented desktop compatibility backports.
This commit is contained in:
parent
44d284a568
commit
8e5ab56611
276 changed files with 53546 additions and 3399 deletions
127
patches/changes/i-slint-backend-winit.patch
Normal file
127
patches/changes/i-slint-backend-winit.patch
Normal file
|
|
@ -0,0 +1,127 @@
|
|||
--- a/i-slint-backend-winit/Cargo.toml
|
||||
+++ b/i-slint-backend-winit/Cargo.toml
|
||||
@@ -87,7 +87,7 @@
|
||||
]
|
||||
wayland = [
|
||||
"winit/wayland",
|
||||
- "winit/wayland-csd-adwaita",
|
||||
+ "winit/wayland-csd-adwaita-crossfont",
|
||||
"glutin?/wayland",
|
||||
"glutin-winit?/wayland",
|
||||
"dep:arboard",
|
||||
@@ -261,8 +261,8 @@
|
||||
version = "0.3.31"
|
||||
|
||||
[target.'cfg(not(any(target_family = "windows", target_vendor = "apple", target_arch = "wasm32", target_os = "android")))'.dependencies.zbus]
|
||||
-version = "5.14.0"
|
||||
-features = ["async-io"]
|
||||
+version = "6.1"
|
||||
+features = ["default-rt", "proxy", "service", "object-manager"]
|
||||
default-features = false
|
||||
|
||||
[target.'cfg(not(target_arch = "wasm32"))'.dependencies.accesskit]
|
||||
--- a/i-slint-backend-winit/xdg_desktop_settings.rs
|
||||
+++ b/i-slint-backend-winit/xdg_desktop_settings.rs
|
||||
@@ -63,7 +63,7 @@
|
||||
struct SettingDescriptor {
|
||||
namespace: &'static str,
|
||||
key: &'static str,
|
||||
- apply: fn(zbus::zvariant::OwnedValue, &SettingsContext),
|
||||
+ apply: fn(zbus::wire::OwnedVariant, &SettingsContext),
|
||||
}
|
||||
|
||||
/// Every desktop setting Slint reacts to. Add a row here (and a small `apply_*`
|
||||
@@ -95,7 +95,7 @@
|
||||
last.parse::<f32>().ok().filter(|p| p.is_finite() && *p > 0.0)
|
||||
}
|
||||
|
||||
-fn xdg_color_scheme_to_slint(value: zbus::zvariant::OwnedValue) -> ColorScheme {
|
||||
+fn xdg_color_scheme_to_slint(value: zbus::wire::OwnedVariant) -> ColorScheme {
|
||||
match value.downcast_ref::<u32>() {
|
||||
Ok(1) => ColorScheme::Dark,
|
||||
Ok(2) => ColorScheme::Light,
|
||||
@@ -103,7 +103,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
-fn xdg_accent_color_to_slint(value: zbus::zvariant::OwnedValue) -> Option<Color> {
|
||||
+fn xdg_accent_color_to_slint(value: zbus::wire::OwnedVariant) -> Option<Color> {
|
||||
// The accent-color setting returns a (ddd) tuple of RGB doubles in [0.0, 1.0]
|
||||
let (r, g, b) = value.downcast_ref::<(f64, f64, f64)>().ok()?;
|
||||
Some(Color::from_argb_f32(1.0, r as f32, g as f32, b as f32))
|
||||
@@ -111,7 +111,7 @@
|
||||
|
||||
/// Sets the color scheme on the context and pushes the matching winit theme to
|
||||
/// every mapped window so client-side decorations stay in sync.
|
||||
-fn apply_color_scheme_value(value: zbus::zvariant::OwnedValue, cx: &SettingsContext) {
|
||||
+fn apply_color_scheme_value(value: zbus::wire::OwnedVariant, cx: &SettingsContext) {
|
||||
let scheme = xdg_color_scheme_to_slint(value);
|
||||
if let Some(ctx) = cx.ctx.upgrade() {
|
||||
ctx.set_color_scheme(scheme);
|
||||
@@ -132,7 +132,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
-fn apply_accent_value(value: zbus::zvariant::OwnedValue, cx: &SettingsContext) {
|
||||
+fn apply_accent_value(value: zbus::wire::OwnedVariant, cx: &SettingsContext) {
|
||||
if let Some(color) = xdg_accent_color_to_slint(value)
|
||||
&& let Some(ctx) = cx.ctx.upgrade()
|
||||
{
|
||||
@@ -140,7 +140,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
-fn apply_font_value(value: zbus::zvariant::OwnedValue, cx: &SettingsContext) {
|
||||
+fn apply_font_value(value: zbus::wire::OwnedVariant, cx: &SettingsContext) {
|
||||
if let Ok(name) = value.downcast_ref::<&str>()
|
||||
&& let Some(points) = parse_font_points(name)
|
||||
&& let Some(ctx) = cx.ctx.upgrade()
|
||||
@@ -149,7 +149,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
-fn apply_cursor_blink_value(value: zbus::zvariant::OwnedValue, cx: &SettingsContext) {
|
||||
+fn apply_cursor_blink_value(value: zbus::wire::OwnedVariant, cx: &SettingsContext) {
|
||||
if let Ok(enabled) = value.downcast_ref::<bool>()
|
||||
&& let Some(shared) = cx.shared.upgrade()
|
||||
{
|
||||
@@ -157,7 +157,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
-fn apply_cursor_blink_time_value(value: zbus::zvariant::OwnedValue, cx: &SettingsContext) {
|
||||
+fn apply_cursor_blink_time_value(value: zbus::wire::OwnedVariant, cx: &SettingsContext) {
|
||||
if let Ok(ms) = value.downcast_ref::<i32>()
|
||||
&& ms > 0
|
||||
&& let Some(shared) = cx.shared.upgrade()
|
||||
@@ -183,7 +183,7 @@
|
||||
async fn read_setting(
|
||||
settings_proxy: &zbus::Proxy<'_>,
|
||||
setting: &SettingDescriptor,
|
||||
-) -> zbus::Result<zbus::zvariant::OwnedValue> {
|
||||
+) -> zbus::Result<zbus::wire::OwnedVariant> {
|
||||
let args = (setting.namespace, setting.key);
|
||||
#[cfg_attr(slint_nightly_test, allow(non_exhaustive_omitted_patterns))]
|
||||
match settings_proxy.call("ReadOne", &args).await {
|
||||
@@ -219,9 +219,9 @@
|
||||
|
||||
let connection = zbus::Connection::session().await?;
|
||||
let settings_proxy: zbus::Proxy = zbus::proxy::Builder::new(&connection)
|
||||
- .interface("org.freedesktop.portal.Settings")?
|
||||
- .path("/org/freedesktop/portal/desktop")?
|
||||
- .destination("org.freedesktop.portal.Desktop")?
|
||||
+ .interface("org.freedesktop.portal.Settings")
|
||||
+ .path("/org/freedesktop/portal/desktop")
|
||||
+ .destination("org.freedesktop.portal.Desktop")
|
||||
.build()
|
||||
.await?;
|
||||
|
||||
@@ -238,7 +238,7 @@
|
||||
|
||||
while let Some(message) = settings_stream.next().await {
|
||||
let Ok((namespace, key, value)) =
|
||||
- message.body().deserialize::<(String, String, zbus::zvariant::OwnedValue)>()
|
||||
+ message.body().deserialize::<(String, String, zbus::wire::OwnedVariant)>()
|
||||
else {
|
||||
continue;
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue