fix: absorb libcosmic theme-v2 API + reqwest stream feature
Leyoda 2026 – GPLv3
This commit is contained in:
parent
f93673c6f4
commit
e87a7f214a
5 changed files with 639 additions and 154 deletions
765
Cargo.lock
generated
765
Cargo.lock
generated
File diff suppressed because it is too large
Load diff
|
|
@ -17,7 +17,10 @@ regex = "1"
|
|||
ron = "0.11"
|
||||
serde = { version = "1", features = ["serde_derive"] }
|
||||
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
|
||||
clap_lex = "0.7"
|
||||
# Internationalization
|
||||
|
|
@ -62,6 +65,7 @@ dbus-config = ["cosmic/dbus-config"]
|
|||
wgpu = ["cosmic/wgpu", "cosmic-files/wgpu"]
|
||||
wayland = ["cosmic/wayland", "cosmic-files/wayland"]
|
||||
password_manager = ["secret-service", "thiserror", "secstr"]
|
||||
modjo = ["dep:reqwest", "dep:serde_json"]
|
||||
|
||||
[profile.release-with-debug]
|
||||
inherits = "release"
|
||||
|
|
|
|||
12
src/main.rs
12
src/main.rs
|
|
@ -685,7 +685,7 @@ impl App {
|
|||
|
||||
// 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 data = u32::from(bytes[2])
|
||||
| (u32::from(bytes[1]) << 8)
|
||||
|
|
@ -2958,7 +2958,9 @@ impl Application for App {
|
|||
let pos_y = _position.y as i32;
|
||||
|
||||
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::iced::runtime::platform_specific::wayland::popup::{SctkPopupSettings, SctkPositioner};
|
||||
|
||||
|
|
@ -3532,9 +3534,9 @@ impl Application for App {
|
|||
.class(style::Container::Custom(Box::new(|theme| {
|
||||
let cosmic = theme.cosmic();
|
||||
cosmic::iced::widget::container::Style {
|
||||
icon_color: Some(Color::from(cosmic.background.on)),
|
||||
text_color: Some(Color::from(cosmic.background.on)),
|
||||
background: Some(iced::Background::Color(cosmic.background.base.into())),
|
||||
icon_color: Some(Color::from(cosmic.background(false).on)),
|
||||
text_color: Some(Color::from(cosmic.background(false).on)),
|
||||
background: Some(iced::Background::Color(cosmic.background(false).base.into())),
|
||||
border: iced::Border::default(),
|
||||
shadow: iced::Shadow::default(),
|
||||
snap: true,
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ pub fn context_menu<'a>(
|
|||
String::new()
|
||||
};
|
||||
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;
|
||||
TextStyle {
|
||||
color: Some(color.into()),
|
||||
|
|
@ -131,7 +131,7 @@ pub fn context_menu<'a>(
|
|||
//TODO: move style to libcosmic
|
||||
.style(|theme| {
|
||||
let cosmic = theme.cosmic();
|
||||
let component = &cosmic.background.component;
|
||||
let component = &cosmic.background(false).component;
|
||||
widget::container::Style {
|
||||
icon_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
|
||||
.style(|theme| {
|
||||
let cosmic = theme.cosmic();
|
||||
let component = &cosmic.background.component;
|
||||
let component = &cosmic.background(false).component;
|
||||
widget::container::Style {
|
||||
icon_color: Some(component.on.into()),
|
||||
text_color: Some(component.on.into()),
|
||||
|
|
|
|||
|
|
@ -759,7 +759,7 @@ where
|
|||
let scrollbar_color: Color = if pressed {
|
||||
// pressed_state_color, 0.5
|
||||
cosmic_theme
|
||||
.background
|
||||
.background(false)
|
||||
.component
|
||||
.pressed
|
||||
.without_alpha()
|
||||
|
|
@ -769,7 +769,7 @@ where
|
|||
} else if hover {
|
||||
// hover_state_color, 0.2
|
||||
cosmic_theme
|
||||
.background
|
||||
.background(false)
|
||||
.component
|
||||
.hover
|
||||
.without_alpha()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue