Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
git-f0x committed Sep 24, 2024
1 parent 3a6b1b6 commit d9b3ecf
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 61 deletions.
52 changes: 26 additions & 26 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions cosmic-app-list/src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -1716,7 +1716,7 @@ impl cosmic::Application for CosmicAppList {
content: impl Into<Element<'a, Message>>,
) -> 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)
Expand Down
7 changes: 3 additions & 4 deletions cosmic-applet-audio/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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![
Expand Down
11 changes: 0 additions & 11 deletions cosmic-applet-network/src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
Expand Down
21 changes: 6 additions & 15 deletions cosmic-applet-tiling/src/window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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<calloop::channel::SyncSender<AppRequest>>,
workspace_tx: Option<SyncSender<AppRequest>>,
tile_windows: id::Toggler,
active_hint: id::Toggler,
token_tx: Option<calloop::channel::Sender<TokenRequest>>,
}

#[derive(Clone, Debug)]
Expand Down Expand Up @@ -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())
}
Expand Down Expand Up @@ -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()
Expand Down
5 changes: 2 additions & 3 deletions cosmic-applet-time/src/window.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright 2023 System76 <info@system76.com>
// SPDX-License-Identifier: GPL-3.0-only

use std::{borrow::Cow, str::FromStr};
use std::str::FromStr;

use chrono::{Datelike, Timelike};
use cosmic::{
Expand Down Expand Up @@ -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),
)
Expand Down

0 comments on commit d9b3ecf

Please sign in to comment.