remove useless conversions
This commit is contained in:
parent
974367f312
commit
12ef9ce993
4 changed files with 17 additions and 31 deletions
|
|
@ -121,7 +121,6 @@ impl DockItem {
|
||||||
|
|
||||||
let dot_radius = 2;
|
let dot_radius = 2;
|
||||||
let dots = (0..toplevels.len())
|
let dots = (0..toplevels.len())
|
||||||
.into_iter()
|
|
||||||
.map(|_| {
|
.map(|_| {
|
||||||
container(vertical_space(Length::Fixed(0.0)))
|
container(vertical_space(Length::Fixed(0.0)))
|
||||||
.padding(dot_radius)
|
.padding(dot_radius)
|
||||||
|
|
|
||||||
|
|
@ -293,30 +293,24 @@ async fn start_listening(
|
||||||
let conn_settings: HashMap<&str, HashMap<&str, zvariant::Value>> =
|
let conn_settings: HashMap<&str, HashMap<&str, zvariant::Value>> =
|
||||||
HashMap::from([
|
HashMap::from([
|
||||||
(
|
(
|
||||||
"802-11-wireless".into(),
|
"802-11-wireless",
|
||||||
HashMap::from([(
|
HashMap::from([(
|
||||||
"ssid".into(),
|
"ssid",
|
||||||
Value::Array(ssid.as_bytes().into()),
|
Value::Array(ssid.as_bytes().into()),
|
||||||
)]),
|
)]),
|
||||||
),
|
),
|
||||||
(
|
(
|
||||||
"connection".into(),
|
"connection",
|
||||||
HashMap::from([
|
HashMap::from([
|
||||||
("id".into(), Value::Str(ssid.as_str().into())),
|
("id", Value::Str(ssid.as_str().into())),
|
||||||
(
|
("type", Value::Str("802-11-wireless".into())),
|
||||||
"type".into(),
|
|
||||||
Value::Str("802-11-wireless".into()),
|
|
||||||
),
|
|
||||||
]),
|
]),
|
||||||
),
|
),
|
||||||
(
|
(
|
||||||
"802-11-wireless-security".into(),
|
"802-11-wireless-security",
|
||||||
HashMap::from([
|
HashMap::from([
|
||||||
(
|
("psk", Value::Str(password.as_str().into())),
|
||||||
"psk".into(),
|
("key-mgmt", Value::Str("wpa-psk".into())),
|
||||||
Value::Str(password.as_str().into()),
|
|
||||||
),
|
|
||||||
("key-mgmt".into(), Value::Str("wpa-psk".into())),
|
|
||||||
]),
|
]),
|
||||||
),
|
),
|
||||||
]);
|
]);
|
||||||
|
|
|
||||||
|
|
@ -328,7 +328,7 @@ impl cosmic::Application for Notifications {
|
||||||
let do_not_disturb = padded_control(row![anim!(
|
let do_not_disturb = padded_control(row![anim!(
|
||||||
DO_NOT_DISTURB,
|
DO_NOT_DISTURB,
|
||||||
&self.timeline,
|
&self.timeline,
|
||||||
String::from(fl!("do-not-disturb")),
|
fl!("do-not-disturb"),
|
||||||
self.config.do_not_disturb,
|
self.config.do_not_disturb,
|
||||||
Message::DoNotDisturb
|
Message::DoNotDisturb
|
||||||
)
|
)
|
||||||
|
|
@ -442,9 +442,7 @@ impl cosmic::Application for Notifications {
|
||||||
info!("app_icon: {:?}", &n.app_icon);
|
info!("app_icon: {:?}", &n.app_icon);
|
||||||
if n.app_icon.is_empty() {
|
if n.app_icon.is_empty() {
|
||||||
match n.image().cloned() {
|
match n.image().cloned() {
|
||||||
Some(Image::File(p)) => {
|
Some(Image::File(p)) => Some(cosmic::widget::icon::from_path(p)),
|
||||||
Some(cosmic::widget::icon::from_path(PathBuf::from(p)))
|
|
||||||
}
|
|
||||||
Some(Image::Name(name)) => {
|
Some(Image::Name(name)) => {
|
||||||
Some(cosmic::widget::icon::from_name(name).handle())
|
Some(cosmic::widget::icon::from_name(name).handle())
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -222,18 +222,13 @@ impl cosmic::Application for IcedWorkspacesApplet {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn subscription(&self) -> Subscription<Message> {
|
fn subscription(&self) -> Subscription<Message> {
|
||||||
Subscription::batch(
|
Subscription::batch(vec![
|
||||||
vec![
|
workspaces(0).map(Message::WorkspaceUpdate),
|
||||||
workspaces(0).map(Message::WorkspaceUpdate),
|
subscription::events_with(|e, _| match e {
|
||||||
subscription::events_with(|e, _| match e {
|
Mouse(mouse::Event::WheelScrolled { delta }) => Some(Message::WheelScrolled(delta)),
|
||||||
Mouse(mouse::Event::WheelScrolled { delta }) => {
|
_ => None,
|
||||||
Some(Message::WheelScrolled(delta))
|
}),
|
||||||
}
|
])
|
||||||
_ => None,
|
|
||||||
}),
|
|
||||||
]
|
|
||||||
.into_iter(),
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn style(&self) -> Option<<Theme as application::StyleSheet>::Style> {
|
fn style(&self) -> Option<<Theme as application::StyleSheet>::Style> {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue