Consolidate desktop controls with editable holidays and a running-window tray
This commit is contained in:
1 parent
9908dde9f8
commit
326465952a
55 files changed
+4207
-450
No files matched your search
@@ -19,7 +19,7 @@ impl App {
|
||||
return self.connection_card(
|
||||
column([])
|
||||
.spacing(8)
|
||||
.push(self.label("Wi-Fi unavailable", 14.))
|
||||
.push(self.label(ferese_config::tr!("Wi-Fi unavailable"), 14.))
|
||||
.push(self.connection_note(result.as_ref().expect_err(
|
||||
"the unavailable-services branch contains a connection error",
|
||||
))),
|
||||
@@ -44,7 +44,7 @@ impl App {
|
||||
column([])
|
||||
.spacing(2)
|
||||
.width(Length::Fill)
|
||||
.push(self.label("Wi-Fi", 15.))
|
||||
.push(self.label(ferese_config::tr!("Wi-Fi"), 15.))
|
||||
.push(self.connection_note(status)),
|
||||
)
|
||||
.push(
|
||||
@@ -65,7 +65,10 @@ impl App {
|
||||
body = body.push(
|
||||
row([])
|
||||
.align_y(Alignment::Center)
|
||||
.push(self.label("Networks", 14.).width(Length::Fill))
|
||||
.push(
|
||||
self.label(ferese_config::tr!("Networks"), 14.)
|
||||
.width(Length::Fill),
|
||||
)
|
||||
.push(self.connection_button("Scan", Input::Run(Command::WifiScan), ready, false)),
|
||||
);
|
||||
if wifi.networks.is_empty() {
|
||||
@@ -88,10 +91,14 @@ impl App {
|
||||
} else {
|
||||
""
|
||||
};
|
||||
let state = ferese_config::locale::text(state);
|
||||
let detail = format!(
|
||||
"{state}{} · {}% signal{}",
|
||||
network.security.label(),
|
||||
network.strength,
|
||||
"{state}{} · {}{}",
|
||||
ferese_config::locale::text(network.security.label()),
|
||||
ferese_config::locale::format(
|
||||
"{percent}% signal",
|
||||
&[("percent", network.strength.to_string())]
|
||||
),
|
||||
if wifi.radios.len() > 1 {
|
||||
format!(" · {radio}")
|
||||
} else {
|
||||
@@ -171,7 +178,7 @@ impl App {
|
||||
body = body.push(self.wifi_credentials());
|
||||
}
|
||||
if !wifi.saved.is_empty() {
|
||||
body = body.push(self.label("Saved networks", 14.));
|
||||
body = body.push(self.label(ferese_config::tr!("Saved networks"), 14.));
|
||||
for saved in &wifi.saved {
|
||||
body = body.push(
|
||||
self.connection_card(
|
||||
@@ -206,28 +213,34 @@ impl App {
|
||||
let s = &self.connections;
|
||||
let p = visuals::Palette::from_resolved(&self.resolved.presented);
|
||||
let target = self.wifi_target();
|
||||
let mut body = column([]).spacing(6).push(self.label(
|
||||
let mut body = column([]).spacing(6).push(self.ui_label(
|
||||
if s.hidden {
|
||||
"Hidden network".into()
|
||||
ferese_config::locale::translate("Hidden network")
|
||||
} else {
|
||||
format!(
|
||||
"Join {}",
|
||||
s.selected
|
||||
.as_ref()
|
||||
.map(|n| n.name.as_str())
|
||||
.unwrap_or("network")
|
||||
ferese_config::locale::format(
|
||||
"Join {network}",
|
||||
&[(
|
||||
"network",
|
||||
s.selected
|
||||
.as_ref()
|
||||
.map(|n| n.name.clone())
|
||||
.unwrap_or_else(|| ferese_config::locale::translate("network")),
|
||||
)],
|
||||
)
|
||||
},
|
||||
16.,
|
||||
));
|
||||
if s.hidden {
|
||||
body = body.push(
|
||||
text_input("Network name (SSID)", s.hidden_name.clone())
|
||||
.font(self.font)
|
||||
.size(13)
|
||||
.padding([5, 8])
|
||||
.style(visuals::input_style(p))
|
||||
.on_input(|name| message(Input::HiddenName(name))),
|
||||
text_input(
|
||||
ferese_config::tr!("Network name (SSID)"),
|
||||
s.hidden_name.clone(),
|
||||
)
|
||||
.font(self.font)
|
||||
.size(13)
|
||||
.padding([5, 8])
|
||||
.style(visuals::input_style(p))
|
||||
.on_input(|name| message(Input::HiddenName(name))),
|
||||
);
|
||||
let mut choices = row([]).spacing(6);
|
||||
for security in [
|
||||
@@ -251,7 +264,7 @@ impl App {
|
||||
.unwrap_or(s.hidden_security);
|
||||
if security.password() {
|
||||
body = body.push(
|
||||
text_input("Network password", s.password.as_str())
|
||||
text_input(ferese_config::tr!("Network password"), s.password.as_str())
|
||||
.id(cosmic::widget::Id::new("wifi-password"))
|
||||
.password()
|
||||
.font(self.font)
|
||||
|
||||
Reference in new issue
Block a user