feat: more explicit cancel button for profile editor and wivrn config editor

This commit is contained in:
Gabriele Musco 2023-12-26 08:03:23 +00:00
parent cd0e55aa9b
commit e8220b410f
2 changed files with 18 additions and 0 deletions

View file

@ -66,6 +66,8 @@ impl SimpleComponent for ProfileEditor {
set_vexpand: true,
add_top_bar: top_bar = &adw::HeaderBar {
set_vexpand: false,
set_show_end_title_buttons: false,
set_show_start_title_buttons: false,
pack_end: save_btn = &gtk::Button {
set_label: "Save",
add_css_class: "suggested-action",
@ -73,6 +75,13 @@ impl SimpleComponent for ProfileEditor {
sender.input(Self::Input::SaveProfile);
},
},
pack_start: cancel_btn = &gtk::Button {
set_label: "Cancel",
add_css_class: "destructive-action",
connect_clicked[win] => move |_| {
win.close();
}
},
},
#[wrap(Some)]
set_content: pref_page = &adw::PreferencesPage {

View file

@ -49,6 +49,8 @@ impl SimpleComponent for WivrnConfEditor {
set_vexpand: true,
add_top_bar: top_bar = &adw::HeaderBar {
set_vexpand: false,
set_show_end_title_buttons: false,
set_show_start_title_buttons: false,
pack_end: save_btn = &gtk::Button {
set_label: "Save",
add_css_class: "suggested-action",
@ -56,6 +58,13 @@ impl SimpleComponent for WivrnConfEditor {
sender.input(Self::Input::Save);
},
},
pack_start: cancel_btn = &gtk::Button {
set_label: "Cancel",
add_css_class: "destructive-action",
connect_clicked[win] => move |_| {
win.close();
}
},
},
#[wrap(Some)]
set_content: pref_page = &adw::PreferencesPage {