Port SettingsEntry from cosmic-settings
This commit is contained in:
parent
9ed29eab94
commit
9da2b030d7
4 changed files with 230 additions and 15 deletions
|
|
@ -1,27 +1,22 @@
|
|||
use gtk4::{prelude::*, Align, Label, Orientation, Separator, Switch};
|
||||
use crate::widgets::SettingsEntry;
|
||||
use gtk4::{prelude::*, Orientation, Separator, Switch};
|
||||
|
||||
pub fn add_toggles(target: >k4::Box) {
|
||||
view! {
|
||||
airplane_mode_box = gtk4::Box {
|
||||
append: airplane_mode_label = &Label {
|
||||
set_markup: "<b>Airplane Mode</b>",
|
||||
set_halign: Align::Start
|
||||
},
|
||||
append: airplane_mode_switch = &Switch {}
|
||||
airplane_mode = SettingsEntry {
|
||||
set_title_markup: "<b>Airplane Mode</b>",
|
||||
set_child: airplane_mode_switch = &Switch {}
|
||||
}
|
||||
}
|
||||
view! {
|
||||
wifi_box = gtk4::Box {
|
||||
append: wifi_label = &Label {
|
||||
set_markup: "<b>WiFi</b>",
|
||||
set_halign: Align::Start
|
||||
},
|
||||
append: wifi_switch = &Switch {}
|
||||
wifi = SettingsEntry {
|
||||
set_title_markup: "<b>WiFi</b>",
|
||||
set_child: wifi_switch = &Switch {}
|
||||
}
|
||||
}
|
||||
|
||||
target.append(&airplane_mode_box);
|
||||
target.append(&airplane_mode);
|
||||
target.append(&Separator::new(Orientation::Horizontal));
|
||||
target.append(&wifi_box);
|
||||
target.append(&wifi);
|
||||
target.append(&Separator::new(Orientation::Horizontal));
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue