Log out / lock screen buttons
This commit is contained in:
parent
329c6006c3
commit
1f65d44998
3 changed files with 51 additions and 1 deletions
|
|
@ -28,6 +28,7 @@ fn build_ui(application: >k4::Application) {
|
|||
.default_height(300)
|
||||
.build();
|
||||
|
||||
let session_section = ui::session::build();
|
||||
let system_section = ui::system::build();
|
||||
view! {
|
||||
main_box = gtk4::Box {
|
||||
|
|
@ -38,6 +39,7 @@ fn build_ui(application: >k4::Application) {
|
|||
set_margin_start: 24,
|
||||
set_margin_end: 24,
|
||||
append: first_separator = &Separator {},
|
||||
append: &session_section,
|
||||
append: second_separator = &Separator {},
|
||||
append: &system_section
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1 +1,49 @@
|
|||
// SPDX-License-Identifier: LGPL-3.0-or-later
|
||||
|
||||
use gtk4::{prelude::*, Align, Button, Image, Label, Orientation};
|
||||
|
||||
pub fn build() -> gtk4::Box {
|
||||
view! {
|
||||
inner_box = gtk4::Box {
|
||||
set_orientation: Orientation::Vertical,
|
||||
set_spacing: 5,
|
||||
append: lock_screen_button = &Button {
|
||||
set_child: lock_screen_box = Some(>k4::Box) {
|
||||
set_orientation: Orientation::Horizontal,
|
||||
set_spacing: 10,
|
||||
append: lock_screen_icon = &Image {
|
||||
set_icon_name: Some("system-lock-screen-symbolic"),
|
||||
},
|
||||
append: lock_screen_label = &Label {
|
||||
set_label: "Lock Screen",
|
||||
set_halign: Align::Start,
|
||||
set_hexpand: true
|
||||
},
|
||||
append: lock_screen_hotkey_label = &Label {
|
||||
set_label: "Super + Escape",
|
||||
set_halign: Align::End
|
||||
}
|
||||
}
|
||||
},
|
||||
append: log_out_button = &Button {
|
||||
set_child: log_out_box = Some(>k4::Box) {
|
||||
set_orientation: Orientation::Horizontal,
|
||||
set_spacing: 10,
|
||||
append: log_out_icon = &Image {
|
||||
set_icon_name: Some("system-log-out-symbolic"),
|
||||
},
|
||||
append: log_out_label = &Label {
|
||||
set_label: "Log Out",
|
||||
set_halign: Align::Start,
|
||||
set_hexpand: true
|
||||
},
|
||||
append: log_out_hotkey_label = &Label {
|
||||
set_label: "Ctrl + Alt + Delete",
|
||||
set_halign: Align::End
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
inner_box
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
// SPDX-License-Identifier: LGPL-3.0-or-later
|
||||
|
||||
use crate::RT;
|
||||
use gtk4::{prelude::*, Align, Button, IconSize, Image, Label, Orientation};
|
||||
use gtk4::{prelude::*, Button, IconSize, Image, Label, Orientation};
|
||||
use logind_zbus::manager::ManagerProxy;
|
||||
use zbus::Connection;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue