parent
68fd2a6c17
commit
a1de560240
1 changed files with 19 additions and 30 deletions
|
|
@ -8,7 +8,7 @@ use cosmic::iced_widget::Row;
|
||||||
use cosmic::{
|
use cosmic::{
|
||||||
iced::{
|
iced::{
|
||||||
wayland::popup::{destroy_popup, get_popup},
|
wayland::popup::{destroy_popup, get_popup},
|
||||||
widget::{column, container, row, scrollable, text, text_input, Column},
|
widget::{column, row},
|
||||||
Alignment, Length, Subscription,
|
Alignment, Length, Subscription,
|
||||||
},
|
},
|
||||||
iced_runtime::core::{
|
iced_runtime::core::{
|
||||||
|
|
@ -18,7 +18,7 @@ use cosmic::{
|
||||||
},
|
},
|
||||||
iced_style::application,
|
iced_style::application,
|
||||||
theme::Button,
|
theme::Button,
|
||||||
widget::{button, divider, icon},
|
widget::{button, container, divider, icon, scrollable, text, text_input, Column},
|
||||||
Element, Theme,
|
Element, Theme,
|
||||||
};
|
};
|
||||||
use cosmic_dbus_networkmanager::interface::enums::{
|
use cosmic_dbus_networkmanager::interface::enums::{
|
||||||
|
|
@ -458,7 +458,7 @@ impl cosmic::Application for CosmicNetworkApplet {
|
||||||
match conn {
|
match conn {
|
||||||
ActiveConnectionInfo::Vpn { name, ip_addresses } => {
|
ActiveConnectionInfo::Vpn { name, ip_addresses } => {
|
||||||
let mut ipv4 = Vec::with_capacity(ip_addresses.len() + 1);
|
let mut ipv4 = Vec::with_capacity(ip_addresses.len() + 1);
|
||||||
ipv4.push(text(name).size(14).into());
|
ipv4.push(text::body(name).into());
|
||||||
for addr in ip_addresses {
|
for addr in ip_addresses {
|
||||||
ipv4.push(text(format!("{}: {}", fl!("ipv4"), addr)).size(10).into());
|
ipv4.push(text(format!("{}: {}", fl!("ipv4"), addr)).size(10).into());
|
||||||
}
|
}
|
||||||
|
|
@ -471,10 +471,9 @@ impl cosmic::Application for CosmicNetworkApplet {
|
||||||
)
|
)
|
||||||
.size(40),
|
.size(40),
|
||||||
Column::with_children(ipv4),
|
Column::with_children(ipv4),
|
||||||
text(fl!("connected"))
|
text::body(fl!("connected"))
|
||||||
.width(Length::Fill)
|
.width(Length::Fill)
|
||||||
.horizontal_alignment(Horizontal::Right)
|
.horizontal_alignment(Horizontal::Right),
|
||||||
.size(14),
|
|
||||||
]
|
]
|
||||||
.align_items(Alignment::Center)
|
.align_items(Alignment::Center)
|
||||||
.spacing(8)
|
.spacing(8)
|
||||||
|
|
@ -503,14 +502,13 @@ impl cosmic::Application for CosmicNetworkApplet {
|
||||||
)
|
)
|
||||||
.size(40),
|
.size(40),
|
||||||
Column::with_children(ipv4),
|
Column::with_children(ipv4),
|
||||||
text(format!(
|
text::body(format!(
|
||||||
"{} - {speed} {}",
|
"{} - {speed} {}",
|
||||||
fl!("connected"),
|
fl!("connected"),
|
||||||
fl!("megabits-per-second")
|
fl!("megabits-per-second")
|
||||||
))
|
))
|
||||||
.width(Length::Fill)
|
.width(Length::Fill)
|
||||||
.horizontal_alignment(Horizontal::Right)
|
.horizontal_alignment(Horizontal::Right),
|
||||||
.size(14),
|
|
||||||
]
|
]
|
||||||
.align_items(Alignment::Center)
|
.align_items(Alignment::Center)
|
||||||
.spacing(8)
|
.spacing(8)
|
||||||
|
|
@ -548,8 +546,7 @@ impl cosmic::Application for CosmicNetworkApplet {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
ActiveConnectionState::Activated => btn_content.push(
|
ActiveConnectionState::Activated => btn_content.push(
|
||||||
text(fl!("connected").to_string())
|
text::body(fl!("connected"))
|
||||||
.size(14)
|
|
||||||
.horizontal_alignment(Horizontal::Right)
|
.horizontal_alignment(Horizontal::Right)
|
||||||
.vertical_alignment(Vertical::Center)
|
.vertical_alignment(Vertical::Center)
|
||||||
.into(),
|
.into(),
|
||||||
|
|
@ -680,10 +677,8 @@ impl cosmic::Application for CosmicNetworkApplet {
|
||||||
"go-next-symbolic"
|
"go-next-symbolic"
|
||||||
};
|
};
|
||||||
let available_connections_btn = menu_button(row![
|
let available_connections_btn = menu_button(row![
|
||||||
text(fl!("visible-wireless-networks"))
|
text::body(fl!("visible-wireless-networks"))
|
||||||
.size(14)
|
|
||||||
.width(Length::Fill)
|
.width(Length::Fill)
|
||||||
.height(Length::Fixed(24.0))
|
|
||||||
.vertical_alignment(Vertical::Center),
|
.vertical_alignment(Vertical::Center),
|
||||||
container(icon::from_name(dropdown_icon).size(14).symbolic(true))
|
container(icon::from_name(dropdown_icon).size(14).symbolic(true))
|
||||||
.align_x(Horizontal::Center)
|
.align_x(Horizontal::Center)
|
||||||
|
|
@ -706,7 +701,7 @@ impl cosmic::Application for CosmicNetworkApplet {
|
||||||
icon::from_name("network-wireless-acquiring-symbolic")
|
icon::from_name("network-wireless-acquiring-symbolic")
|
||||||
.size(24)
|
.size(24)
|
||||||
.symbolic(true),
|
.symbolic(true),
|
||||||
text(&access_point.ssid).size(14),
|
text::body(&access_point.ssid),
|
||||||
]
|
]
|
||||||
.align_items(Alignment::Center)
|
.align_items(Alignment::Center)
|
||||||
.spacing(12),
|
.spacing(12),
|
||||||
|
|
@ -714,18 +709,17 @@ impl cosmic::Application for CosmicNetworkApplet {
|
||||||
content = content.push(id);
|
content = content.push(id);
|
||||||
let col = padded_control(
|
let col = padded_control(
|
||||||
column![
|
column![
|
||||||
text(fl!("enter-password")),
|
text::body(fl!("enter-password")),
|
||||||
text_input("", password)
|
text_input("", password)
|
||||||
.on_input(Message::Password)
|
.on_input(Message::Password)
|
||||||
.on_paste(Message::Password)
|
.on_paste(Message::Password)
|
||||||
.on_submit(Message::SubmitPassword)
|
.on_submit(Message::SubmitPassword)
|
||||||
.password(),
|
.password(),
|
||||||
container(text(fl!("router-wps-button"))).padding(8),
|
container(text::body(fl!("router-wps-button"))).padding(8),
|
||||||
row![
|
row![
|
||||||
button(container(text(fl!("cancel"))).padding([0, 24]))
|
button::standard(fl!("cancel"))
|
||||||
.on_press(Message::CancelNewConnection),
|
.on_press(Message::CancelNewConnection),
|
||||||
button(container(text(fl!("connect"))).padding([0, 24]))
|
button::suggested(fl!("connect"))
|
||||||
.style(Button::Suggested)
|
|
||||||
.on_press(Message::SubmitPassword)
|
.on_press(Message::SubmitPassword)
|
||||||
]
|
]
|
||||||
.spacing(24)
|
.spacing(24)
|
||||||
|
|
@ -775,13 +769,11 @@ impl cosmic::Application for CosmicNetworkApplet {
|
||||||
text(fl!("unable-to-connect")),
|
text(fl!("unable-to-connect")),
|
||||||
text(fl!("check-wifi-connection")),
|
text(fl!("check-wifi-connection")),
|
||||||
row![
|
row![
|
||||||
button(container(text("Cancel")).padding([0, 24]))
|
button::standard(fl!("cancel"))
|
||||||
.on_press(Message::CancelNewConnection),
|
.on_press(Message::CancelNewConnection),
|
||||||
button(container(text("Connect")).padding([0, 24]))
|
button::suggested(fl!("connect")).on_press(
|
||||||
.style(Button::Suggested)
|
Message::SelectWirelessAccessPoint(access_point.clone())
|
||||||
.on_press(Message::SelectWirelessAccessPoint(
|
)
|
||||||
access_point.clone()
|
|
||||||
))
|
|
||||||
]
|
]
|
||||||
.spacing(24)
|
.spacing(24)
|
||||||
]
|
]
|
||||||
|
|
@ -808,10 +800,7 @@ impl cosmic::Application for CosmicNetworkApplet {
|
||||||
icon::from_name(wifi_icon(ap.strength))
|
icon::from_name(wifi_icon(ap.strength))
|
||||||
.size(16)
|
.size(16)
|
||||||
.symbolic(true),
|
.symbolic(true),
|
||||||
text(&ap.ssid)
|
text::body(&ap.ssid).vertical_alignment(Vertical::Center)
|
||||||
.size(14)
|
|
||||||
.height(Length::Fixed(24.0))
|
|
||||||
.vertical_alignment(Vertical::Center)
|
|
||||||
]
|
]
|
||||||
.align_items(Alignment::Center)
|
.align_items(Alignment::Center)
|
||||||
.spacing(12),
|
.spacing(12),
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue