chore: clippy
This commit is contained in:
parent
73e99ae549
commit
d17894f94e
7 changed files with 12 additions and 28 deletions
|
|
@ -561,7 +561,7 @@ impl cosmic::Application for Audio {
|
||||||
self.timeline
|
self.timeline
|
||||||
.as_subscription()
|
.as_subscription()
|
||||||
.map(|(_, now)| Message::Frame(now)),
|
.map(|(_, now)| Message::Frame(now)),
|
||||||
self.core.watch_config(Self::APP_ID.into()).map(|u| {
|
self.core.watch_config(Self::APP_ID).map(|u| {
|
||||||
for err in u.errors {
|
for err in u.errors {
|
||||||
tracing::error!(?err, "Error watching config");
|
tracing::error!(?err, "Error watching config");
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -165,7 +165,7 @@ async fn update(state: State, output: &mut futures::channel::mpsc::Sender<MprisU
|
||||||
return State::Setup;
|
return State::Setup;
|
||||||
};
|
};
|
||||||
let conn = player.connection();
|
let conn = player.connection();
|
||||||
let media_players = mpris2_zbus::media_player::MediaPlayer::new_all(&conn)
|
let media_players = mpris2_zbus::media_player::MediaPlayer::new_all(conn)
|
||||||
.await
|
.await
|
||||||
.unwrap_or_else(|_| Vec::new());
|
.unwrap_or_else(|_| Vec::new());
|
||||||
|
|
||||||
|
|
@ -224,7 +224,7 @@ async fn update(state: State, output: &mut futures::channel::mpsc::Sender<MprisU
|
||||||
// if they are, break
|
// if they are, break
|
||||||
if !matches!(update.status, PlaybackStatus::Playing) {
|
if !matches!(update.status, PlaybackStatus::Playing) {
|
||||||
let conn = player.connection();
|
let conn = player.connection();
|
||||||
let players = mpris2_zbus::media_player::MediaPlayer::new_all(&conn)
|
let players = mpris2_zbus::media_player::MediaPlayer::new_all(conn)
|
||||||
.await
|
.await
|
||||||
.unwrap_or_else(|_| Vec::new());
|
.unwrap_or_else(|_| Vec::new());
|
||||||
if let Some(active) = find_active(players).await {
|
if let Some(active) = find_active(players).await {
|
||||||
|
|
@ -250,7 +250,7 @@ async fn find_active(mut players: Vec<MediaPlayer>) -> Option<Player> {
|
||||||
players.sort_by(|a, b| {
|
players.sort_by(|a, b| {
|
||||||
let a = a.destination();
|
let a = a.destination();
|
||||||
let b = b.destination();
|
let b = b.destination();
|
||||||
a.cmp(&b)
|
a.cmp(b)
|
||||||
});
|
});
|
||||||
let mut best = (0, None);
|
let mut best = (0, None);
|
||||||
let eval = |p: Player| async move {
|
let eval = |p: Player| async move {
|
||||||
|
|
|
||||||
|
|
@ -161,7 +161,7 @@ impl cosmic::Application for Notifications {
|
||||||
fn subscription(&self) -> Subscription<Message> {
|
fn subscription(&self) -> Subscription<Message> {
|
||||||
Subscription::batch(vec![
|
Subscription::batch(vec![
|
||||||
self.core
|
self.core
|
||||||
.watch_config(cosmic_notifications_config::ID.into())
|
.watch_config(cosmic_notifications_config::ID)
|
||||||
.map(|res| {
|
.map(|res| {
|
||||||
for err in res.errors {
|
for err in res.errors {
|
||||||
tracing::error!("{:?}", err);
|
tracing::error!("{:?}", err);
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ use cosmic::{
|
||||||
},
|
},
|
||||||
window, Subscription,
|
window, Subscription,
|
||||||
},
|
},
|
||||||
iced_style::{application, menu},
|
iced_style::{application},
|
||||||
Theme,
|
Theme,
|
||||||
};
|
};
|
||||||
use std::collections::BTreeMap;
|
use std::collections::BTreeMap;
|
||||||
|
|
|
||||||
|
|
@ -80,12 +80,4 @@ impl WorkspacesWatcher {
|
||||||
let tx = wayland::spawn_workspaces(tx);
|
let tx = wayland::spawn_workspaces(tx);
|
||||||
Ok(Self { tx, rx })
|
Ok(Self { tx, rx })
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn get_sender(&self) -> SyncSender<TilingState> {
|
|
||||||
self.tx.clone()
|
|
||||||
}
|
|
||||||
|
|
||||||
pub async fn workspaces(&mut self) -> Option<TilingState> {
|
|
||||||
self.rx.next().await
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -50,7 +50,7 @@ pub enum Message {
|
||||||
Frame(Instant),
|
Frame(Instant),
|
||||||
ToggleTileWindows(chain::Toggler, bool),
|
ToggleTileWindows(chain::Toggler, bool),
|
||||||
ToggleActiveHint(chain::Toggler, bool),
|
ToggleActiveHint(chain::Toggler, bool),
|
||||||
MyConfigUpdate(CosmicCompConfig),
|
MyConfigUpdate(Box<CosmicCompConfig>),
|
||||||
TileMode(Entity),
|
TileMode(Entity),
|
||||||
WorkspaceUpdate(WorkspacesUpdate),
|
WorkspaceUpdate(WorkspacesUpdate),
|
||||||
NewWorkspace(Entity),
|
NewWorkspace(Entity),
|
||||||
|
|
@ -144,8 +144,8 @@ impl cosmic::Application for Window {
|
||||||
timeline,
|
timeline,
|
||||||
self.core
|
self.core
|
||||||
.watch_config::<CosmicCompConfig>("com.system76.CosmicComp")
|
.watch_config::<CosmicCompConfig>("com.system76.CosmicComp")
|
||||||
.map(|u| Message::MyConfigUpdate(u.config)),
|
.map(|u| Message::MyConfigUpdate(Box::new(u.config))),
|
||||||
wayland_subscription::workspaces().map(|e| Message::WorkspaceUpdate(e)),
|
wayland_subscription::workspaces().map(Message::WorkspaceUpdate),
|
||||||
])
|
])
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -258,7 +258,7 @@ impl cosmic::Application for Window {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
self.config = c;
|
self.config = *c;
|
||||||
}
|
}
|
||||||
Message::TileMode(e) => {
|
Message::TileMode(e) => {
|
||||||
let behavior = if e == self.autotile_global_entity {
|
let behavior = if e == self.autotile_global_entity {
|
||||||
|
|
@ -311,7 +311,7 @@ impl cosmic::Application for Window {
|
||||||
segmented_selection::horizontal(&self.new_workspace_behavior_model);
|
segmented_selection::horizontal(&self.new_workspace_behavior_model);
|
||||||
if matches!(self.config.autotile_behavior, TileBehavior::PerWorkspace) {
|
if matches!(self.config.autotile_behavior, TileBehavior::PerWorkspace) {
|
||||||
new_workspace_behavior_button =
|
new_workspace_behavior_button =
|
||||||
new_workspace_behavior_button.on_activate(|e| Message::NewWorkspace(e));
|
new_workspace_behavior_button.on_activate(Message::NewWorkspace);
|
||||||
}
|
}
|
||||||
let content_list = column![
|
let content_list = column![
|
||||||
padded_control(container(
|
padded_control(container(
|
||||||
|
|
@ -336,7 +336,7 @@ impl cosmic::Application for Window {
|
||||||
column![
|
column![
|
||||||
text(fl!("autotile-behavior")).size(14),
|
text(fl!("autotile-behavior")).size(14),
|
||||||
segmented_selection::horizontal(&self.autotile_behavior_model)
|
segmented_selection::horizontal(&self.autotile_behavior_model)
|
||||||
.on_activate(|e| Message::TileMode(e))
|
.on_activate(Message::TileMode)
|
||||||
],
|
],
|
||||||
divider::horizontal::default(),
|
divider::horizontal::default(),
|
||||||
column![
|
column![
|
||||||
|
|
|
||||||
|
|
@ -79,12 +79,4 @@ impl WorkspacesWatcher {
|
||||||
let tx = wayland::spawn_workspaces(tx);
|
let tx = wayland::spawn_workspaces(tx);
|
||||||
Ok(Self { tx, rx })
|
Ok(Self { tx, rx })
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn get_sender(&self) -> SyncSender<WorkspaceEvent> {
|
|
||||||
self.tx.clone()
|
|
||||||
}
|
|
||||||
|
|
||||||
pub async fn workspaces(&mut self) -> Option<WorkspaceList> {
|
|
||||||
self.rx.next().await
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue