From d9b3ecf2feb2b93b4d4f45006669d3ba1c83b740 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vuka=C5=A1in=20Vojinovi=C4=87?= Date: Mon, 23 Sep 2024 00:59:28 +0200 Subject: [PATCH] fix --- Cargo.lock | 52 +++++++++++++++--------------- cosmic-app-list/src/app.rs | 4 +-- cosmic-applet-audio/src/lib.rs | 7 ++-- cosmic-applet-network/src/app.rs | 11 ------- cosmic-applet-tiling/src/window.rs | 21 ++++-------- cosmic-applet-time/src/window.rs | 5 ++- 6 files changed, 39 insertions(+), 61 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ef384b26..6a538836 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1268,7 +1268,7 @@ dependencies = [ [[package]] name = "cosmic-config" version = "0.1.0" -source = "git+https://github.com/pop-os/libcosmic#a962865230f3b9ecba40c0c09e9c279e832c9f10" +source = "git+https://github.com/pop-os/libcosmic#701638009df09a254b7d077ddc4d1076cd87a147" dependencies = [ "atomicwrites", "cosmic-config-derive", @@ -1290,7 +1290,7 @@ dependencies = [ [[package]] name = "cosmic-config-derive" version = "0.1.0" -source = "git+https://github.com/pop-os/libcosmic#a962865230f3b9ecba40c0c09e9c279e832c9f10" +source = "git+https://github.com/pop-os/libcosmic#701638009df09a254b7d077ddc4d1076cd87a147" dependencies = [ "quote", "syn 1.0.109", @@ -1385,7 +1385,7 @@ dependencies = [ [[package]] name = "cosmic-settings-subscriptions" version = "0.1.0" -source = "git+https://github.com/pop-os/cosmic-settings-subscriptions#90df5c4b22c47f0e0213dcf2025519b0312437df" +source = "git+https://github.com/pop-os/cosmic-settings-subscriptions#ece1b2475c9eb90e0f2042b743577670e799a010" dependencies = [ "cosmic-dbus-networkmanager", "futures", @@ -1406,7 +1406,7 @@ dependencies = [ [[package]] name = "cosmic-text" version = "0.12.1" -source = "git+https://github.com/pop-os/cosmic-text.git#e8f567cf5b456dfab749a575c257acaa36f622d9" +source = "git+https://github.com/pop-os/cosmic-text.git#4fe90bb6126c22f589b46768d7754d65ae300c5e" dependencies = [ "bitflags 2.6.0", "fontdb", @@ -1429,7 +1429,7 @@ dependencies = [ [[package]] name = "cosmic-theme" version = "0.1.0" -source = "git+https://github.com/pop-os/libcosmic#a962865230f3b9ecba40c0c09e9c279e832c9f10" +source = "git+https://github.com/pop-os/libcosmic#701638009df09a254b7d077ddc4d1076cd87a147" dependencies = [ "almost", "cosmic-config", @@ -2856,7 +2856,7 @@ dependencies = [ [[package]] name = "iced" version = "0.12.0" -source = "git+https://github.com/pop-os/libcosmic#a962865230f3b9ecba40c0c09e9c279e832c9f10" +source = "git+https://github.com/pop-os/libcosmic#701638009df09a254b7d077ddc4d1076cd87a147" dependencies = [ "dnd", "iced_accessibility", @@ -2874,7 +2874,7 @@ dependencies = [ [[package]] name = "iced_accessibility" version = "0.1.0" -source = "git+https://github.com/pop-os/libcosmic#a962865230f3b9ecba40c0c09e9c279e832c9f10" +source = "git+https://github.com/pop-os/libcosmic#701638009df09a254b7d077ddc4d1076cd87a147" dependencies = [ "accesskit", "accesskit_unix", @@ -2883,7 +2883,7 @@ dependencies = [ [[package]] name = "iced_core" version = "0.12.0" -source = "git+https://github.com/pop-os/libcosmic#a962865230f3b9ecba40c0c09e9c279e832c9f10" +source = "git+https://github.com/pop-os/libcosmic#701638009df09a254b7d077ddc4d1076cd87a147" dependencies = [ "bitflags 2.6.0", "dnd", @@ -2905,7 +2905,7 @@ dependencies = [ [[package]] name = "iced_futures" version = "0.12.0" -source = "git+https://github.com/pop-os/libcosmic#a962865230f3b9ecba40c0c09e9c279e832c9f10" +source = "git+https://github.com/pop-os/libcosmic#701638009df09a254b7d077ddc4d1076cd87a147" dependencies = [ "futures", "iced_core", @@ -2918,7 +2918,7 @@ dependencies = [ [[package]] name = "iced_graphics" version = "0.12.0" -source = "git+https://github.com/pop-os/libcosmic#a962865230f3b9ecba40c0c09e9c279e832c9f10" +source = "git+https://github.com/pop-os/libcosmic#701638009df09a254b7d077ddc4d1076cd87a147" dependencies = [ "bitflags 2.6.0", "bytemuck", @@ -2942,7 +2942,7 @@ dependencies = [ [[package]] name = "iced_renderer" version = "0.12.0" -source = "git+https://github.com/pop-os/libcosmic#a962865230f3b9ecba40c0c09e9c279e832c9f10" +source = "git+https://github.com/pop-os/libcosmic#701638009df09a254b7d077ddc4d1076cd87a147" dependencies = [ "iced_graphics", "iced_tiny_skia", @@ -2954,7 +2954,7 @@ dependencies = [ [[package]] name = "iced_runtime" version = "0.12.0" -source = "git+https://github.com/pop-os/libcosmic#a962865230f3b9ecba40c0c09e9c279e832c9f10" +source = "git+https://github.com/pop-os/libcosmic#701638009df09a254b7d077ddc4d1076cd87a147" dependencies = [ "dnd", "iced_accessibility", @@ -2968,7 +2968,7 @@ dependencies = [ [[package]] name = "iced_sctk" version = "0.1.0" -source = "git+https://github.com/pop-os/libcosmic#a962865230f3b9ecba40c0c09e9c279e832c9f10" +source = "git+https://github.com/pop-os/libcosmic#701638009df09a254b7d077ddc4d1076cd87a147" dependencies = [ "enum-repr", "float-cmp", @@ -2994,7 +2994,7 @@ dependencies = [ [[package]] name = "iced_style" version = "0.12.0" -source = "git+https://github.com/pop-os/libcosmic#a962865230f3b9ecba40c0c09e9c279e832c9f10" +source = "git+https://github.com/pop-os/libcosmic#701638009df09a254b7d077ddc4d1076cd87a147" dependencies = [ "iced_core", "once_cell", @@ -3004,7 +3004,7 @@ dependencies = [ [[package]] name = "iced_tiny_skia" version = "0.12.0" -source = "git+https://github.com/pop-os/libcosmic#a962865230f3b9ecba40c0c09e9c279e832c9f10" +source = "git+https://github.com/pop-os/libcosmic#701638009df09a254b7d077ddc4d1076cd87a147" dependencies = [ "bytemuck", "cosmic-text", @@ -3021,7 +3021,7 @@ dependencies = [ [[package]] name = "iced_wgpu" version = "0.12.0" -source = "git+https://github.com/pop-os/libcosmic#a962865230f3b9ecba40c0c09e9c279e832c9f10" +source = "git+https://github.com/pop-os/libcosmic#701638009df09a254b7d077ddc4d1076cd87a147" dependencies = [ "as-raw-xcb-connection", "bitflags 2.6.0", @@ -3050,7 +3050,7 @@ dependencies = [ [[package]] name = "iced_widget" version = "0.12.0" -source = "git+https://github.com/pop-os/libcosmic#a962865230f3b9ecba40c0c09e9c279e832c9f10" +source = "git+https://github.com/pop-os/libcosmic#701638009df09a254b7d077ddc4d1076cd87a147" dependencies = [ "dnd", "iced_renderer", @@ -3731,7 +3731,7 @@ checksum = "d8adc4bb1803a324070e64a98ae98f38934d91957a99cfb3a43dcbc01bc56439" [[package]] name = "libcosmic" version = "0.1.0" -source = "git+https://github.com/pop-os/libcosmic#a962865230f3b9ecba40c0c09e9c279e832c9f10" +source = "git+https://github.com/pop-os/libcosmic#701638009df09a254b7d077ddc4d1076cd87a147" dependencies = [ "apply", "ashpd 0.9.1", @@ -4637,9 +4637,9 @@ dependencies = [ [[package]] name = "pkg-config" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" +checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" [[package]] name = "png" @@ -4804,9 +4804,9 @@ dependencies = [ [[package]] name = "quick-xml" -version = "0.36.1" +version = "0.36.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96a05e2e8efddfa51a84ca47cec303fac86c8541b686d37cac5efc0e094417bc" +checksum = "f7649a7b4df05aed9ea7ec6f628c67c9953a43869b8bc50929569b2999d443fe" dependencies = [ "memchr", ] @@ -5744,18 +5744,18 @@ checksum = "7f1835c76a9d443834c04539860f3ce46b9d93ef8c260057f939e967ca81180a" [[package]] name = "thiserror" -version = "1.0.63" +version = "1.0.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0342370b38b6a11b6cc11d6a805569958d54cfa061a29969c3b5ce2ea405724" +checksum = "d50af8abc119fb8bb6dbabcfa89656f46f84aa0ac7688088608076ad2b459a84" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.63" +version = "1.0.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261" +checksum = "08904e7672f5eb876eaaf87e0ce17857500934f4981c4a0ab2b4aa98baac7fc3" dependencies = [ "proc-macro2", "quote", diff --git a/cosmic-app-list/src/app.rs b/cosmic-app-list/src/app.rs index d6bf4661..b5029b08 100755 --- a/cosmic-app-list/src/app.rs +++ b/cosmic-app-list/src/app.rs @@ -62,7 +62,7 @@ use futures::future::pending; use iced::{widget::container, Alignment, Background, Length}; use itertools::Itertools; use rand::{thread_rng, Rng}; -use std::{collections::HashMap, fs, path::PathBuf, rc::Rc, str::FromStr, time::Duration}; +use std::{collections::HashMap, path::PathBuf, rc::Rc, str::FromStr, time::Duration}; use switcheroo_control::Gpu; use tokio::time::sleep; use url::Url; @@ -1716,7 +1716,7 @@ impl cosmic::Application for CosmicAppList { content: impl Into>, ) -> cosmic::widget::Button<'a, Message> { button::custom(content) - .height(36) + .height(20 + 2 * theme::active().cosmic().space_xxs()) .style(Button::MenuItem) .padding(menu_control_padding()) .width(Length::Fill) diff --git a/cosmic-applet-audio/src/lib.rs b/cosmic-applet-audio/src/lib.rs index 5f0fbde9..93e56104 100644 --- a/cosmic-applet-audio/src/lib.rs +++ b/cosmic-applet-audio/src/lib.rs @@ -15,13 +15,13 @@ use cosmic::{ menu_button, menu_control_padding, padded_control, token::subscription::{activation_token_subscription, TokenRequest, TokenUpdate}, }, - cctk::sctk::reexports::{calloop, protocols::xdg::shell::client::xdg_positioner::Anchor}, + cctk::sctk::reexports::calloop, cosmic_config::CosmicConfigEntry, cosmic_theme::Spacing, iced::{ self, widget::{self, column, row, slider}, - window, Alignment, Length, Limits, Rectangle, Subscription, + window, Alignment, Length, Limits, Subscription, }, iced_runtime::core::alignment::Horizontal, iced_style::application, @@ -750,10 +750,9 @@ impl cosmic::Application for Audio { let mut audio_content = if audio_disabled { column![padded_control( - text(fl!("disconnected")) + text::title3(fl!("disconnected")) .width(Length::Fill) .horizontal_alignment(Horizontal::Center) - .size(24) )] } else { column![ diff --git a/cosmic-applet-network/src/app.rs b/cosmic-applet-network/src/app.rs index 5bcfe7a2..ab12f3f3 100644 --- a/cosmic-applet-network/src/app.rs +++ b/cosmic-applet-network/src/app.rs @@ -537,17 +537,6 @@ impl cosmic::Application for CosmicNetworkApplet { return self.update(Message::SelectWirelessAccessPoint(ap)); } } - Message::OpenSettings => { - let exec = "cosmic-settings networking".to_string(); - if let Some(tx) = self.token_tx.as_ref() { - let _ = tx.send(TokenRequest { - app_id: Self::APP_ID.to_string(), - exec, - }); - } else { - tracing::error!("Wayland tx is None"); - }; - } } Command::none() } diff --git a/cosmic-applet-tiling/src/window.rs b/cosmic-applet-tiling/src/window.rs index 8b47beae..c8a2a838 100644 --- a/cosmic-applet-tiling/src/window.rs +++ b/cosmic-applet-tiling/src/window.rs @@ -4,14 +4,13 @@ use crate::{ fl, wayland::AppRequest, wayland_subscription, wayland_subscription::WorkspacesUpdate, }; -use cctk::sctk::reexports::calloop; +use cctk::sctk::reexports::calloop::channel::SyncSender; use cosmic::{ app::Core, - applet::{menu_button, padded_control, token::subscription::TokenRequest}, + applet::{menu_button, padded_control}, cosmic_config::{Config, ConfigSet, CosmicConfigEntry}, cosmic_theme::Spacing, iced::{ - alignment::Horizontal, wayland::popup::{destroy_popup, get_popup}, window::Id, Command, Length, Limits, Subscription, @@ -46,10 +45,9 @@ pub struct Window { new_workspace_entity: Entity, /// may not match the config value if behavior is per-workspace autotiled: bool, - workspace_tx: Option>, + workspace_tx: Option>, tile_windows: id::Toggler, active_hint: id::Toggler, - token_tx: Option>, } #[derive(Clone, Debug)] @@ -128,7 +126,6 @@ impl cosmic::Application for Window { workspace_tx: None, tile_windows: id::Toggler::unique(), active_hint: id::Toggler::unique(), - token_tx: None, }; (window, Command::none()) } @@ -274,15 +271,9 @@ impl cosmic::Application for Window { }); } Message::OpenSettings => { - let exec = "cosmic-settings window-management".to_string(); - if let Some(tx) = self.token_tx.as_ref() { - let _ = tx.send(TokenRequest { - app_id: Self::APP_ID.to_string(), - exec, - }); - } else { - tracing::error!("Wayland tx is None"); - }; + let mut cmd = std::process::Command::new("cosmic-settings"); + cmd.arg("window-management"); + tokio::spawn(cosmic::process::spawn(cmd)); } } Command::none() diff --git a/cosmic-applet-time/src/window.rs b/cosmic-applet-time/src/window.rs index b665882f..0ade58e8 100644 --- a/cosmic-applet-time/src/window.rs +++ b/cosmic-applet-time/src/window.rs @@ -1,7 +1,7 @@ // Copyright 2023 System76 // SPDX-License-Identifier: GPL-3.0-only -use std::{borrow::Cow, str::FromStr}; +use std::str::FromStr; use chrono::{Datelike, Timelike}; use cosmic::{ @@ -653,8 +653,7 @@ fn date_button(day: u32, is_month: bool, is_day: bool) -> Button<'static, Messag }; let button = button::custom( - text(format!("{day}")) - .size(14.0) + text::body(format!("{day}")) .horizontal_alignment(Horizontal::Center) .vertical_alignment(Vertical::Center), )