fix: absorb libcosmic theme-v2 API + reqwest stream feature

Leyoda 2026 – GPLv3
This commit is contained in:
Lionel DARNIS 2026-07-03 14:04:49 +02:00
parent 9de2d66f85
commit d5eb4b8308
4 changed files with 17 additions and 11 deletions

View file

@ -17,7 +17,10 @@ regex = "1"
ron = "0.11" ron = "0.11"
serde = { version = "1", features = ["serde_derive"] } serde = { version = "1", features = ["serde_derive"] }
shlex = "1" shlex = "1"
tokio = { version = "1", features = ["sync"] } tokio = { version = "1", features = ["sync", "rt", "macros", "time"] }
# HTTP client for Modjo AI integration
reqwest = { version = "0.12", features = ["json", "stream"], optional = true }
serde_json = { version = "1", optional = true }
# CLI arguments # CLI arguments
clap_lex = "0.7" clap_lex = "0.7"
# Internationalization # Internationalization
@ -62,6 +65,7 @@ dbus-config = ["cosmic/dbus-config"]
wgpu = ["cosmic/wgpu", "cosmic-files/wgpu"] wgpu = ["cosmic/wgpu", "cosmic-files/wgpu"]
wayland = ["cosmic/wayland", "cosmic-files/wayland"] wayland = ["cosmic/wayland", "cosmic-files/wayland"]
password_manager = ["secret-service", "thiserror", "secstr"] password_manager = ["secret-service", "thiserror", "secstr"]
modjo = ["dep:reqwest", "dep:serde_json"]
[profile.release-with-debug] [profile.release-with-debug]
inherits = "release" inherits = "release"

View file

@ -688,7 +688,7 @@ impl App {
// Update terminal window background color // Update terminal window background color
{ {
let color = Color::from(theme.cosmic().background.base); let color = Color::from(theme.cosmic().background(false).base);
let bytes = color.into_rgba8(); let bytes = color.into_rgba8();
let data = u32::from(bytes[2]) let data = u32::from(bytes[2])
| (u32::from(bytes[1]) << 8) | (u32::from(bytes[1]) << 8)
@ -2968,7 +2968,9 @@ impl Application for App {
let pos_y = _position.y as i32; let pos_y = _position.y as i32;
tasks.push(cosmic::task::message(Message::Surface( tasks.push(cosmic::task::message(Message::Surface(
cosmic::surface::action::app_popup(move |_app: &mut Self| { cosmic::surface::action::app_popup(
|_: &Self| cosmic::surface::action::LiveSettings::default(),
move |_app: &mut Self| {
use cosmic::cctk::wayland_protocols::xdg::shell::client::xdg_positioner::{Anchor, Gravity}; use cosmic::cctk::wayland_protocols::xdg::shell::client::xdg_positioner::{Anchor, Gravity};
use cosmic::iced::runtime::platform_specific::wayland::popup::{SctkPopupSettings, SctkPositioner}; use cosmic::iced::runtime::platform_specific::wayland::popup::{SctkPopupSettings, SctkPositioner};
@ -3542,9 +3544,9 @@ impl Application for App {
.class(style::Container::Custom(Box::new(|theme| { .class(style::Container::Custom(Box::new(|theme| {
let cosmic = theme.cosmic(); let cosmic = theme.cosmic();
cosmic::iced::widget::container::Style { cosmic::iced::widget::container::Style {
icon_color: Some(Color::from(cosmic.background.on)), icon_color: Some(Color::from(cosmic.background(false).on)),
text_color: Some(Color::from(cosmic.background.on)), text_color: Some(Color::from(cosmic.background(false).on)),
background: Some(iced::Background::Color(cosmic.background.base.into())), background: Some(iced::Background::Color(cosmic.background(false).base.into())),
border: iced::Border::default(), border: iced::Border::default(),
shadow: iced::Shadow::default(), shadow: iced::Shadow::default(),
snap: true, snap: true,

View file

@ -45,7 +45,7 @@ pub fn context_menu<'a>(
String::new() String::new()
}; };
fn key_style(theme: &cosmic::Theme) -> TextStyle { fn key_style(theme: &cosmic::Theme) -> TextStyle {
let mut color = theme.cosmic().background.component.on; let mut color = theme.cosmic().background(false).component.on;
color.alpha *= 0.75; color.alpha *= 0.75;
TextStyle { TextStyle {
color: Some(color.into()), color: Some(color.into()),
@ -131,7 +131,7 @@ pub fn context_menu<'a>(
//TODO: move style to libcosmic //TODO: move style to libcosmic
.style(|theme| { .style(|theme| {
let cosmic = theme.cosmic(); let cosmic = theme.cosmic();
let component = &cosmic.background.component; let component = &cosmic.background(false).component;
widget::container::Style { widget::container::Style {
icon_color: Some(component.on.into()), icon_color: Some(component.on.into()),
text_color: Some(component.on.into()), text_color: Some(component.on.into()),
@ -179,7 +179,7 @@ pub fn color_scheme_menu<'a>(
//TODO: move style to libcosmic //TODO: move style to libcosmic
.style(|theme| { .style(|theme| {
let cosmic = theme.cosmic(); let cosmic = theme.cosmic();
let component = &cosmic.background.component; let component = &cosmic.background(false).component;
widget::container::Style { widget::container::Style {
icon_color: Some(component.on.into()), icon_color: Some(component.on.into()),
text_color: Some(component.on.into()), text_color: Some(component.on.into()),

View file

@ -756,7 +756,7 @@ where
let scrollbar_color: Color = if pressed { let scrollbar_color: Color = if pressed {
// pressed_state_color, 0.5 // pressed_state_color, 0.5
cosmic_theme cosmic_theme
.background .background(false)
.component .component
.pressed .pressed
.without_alpha() .without_alpha()
@ -766,7 +766,7 @@ where
} else if hover { } else if hover {
// hover_state_color, 0.2 // hover_state_color, 0.2
cosmic_theme cosmic_theme
.background .background(false)
.component .component
.hover .hover
.without_alpha() .without_alpha()