Skip to content
Snippets Groups Projects

WIP: (conditional) addition of SSD installation page, some code-reorganizations, fix of stack sidebar tabbing, exit directly without cleanup script

Open plom requested to merge plom_experiments into main
1 file
+ 16
5
Compare changes
  • Side-by-side
  • Inline
+ 16
5
@@ -1006,8 +1006,20 @@ fn build_ui(app: &Application) {
window.add_controller(key_ctrl.clone());
key_ctrl.connect_key_pressed(move |_a, key, _b, _c| {
if key == gdk::Key::Tab || key == gdk::Key::ISO_Left_Tab {
match GtkWindowExt::focus(&window) {
Some(w) if w.is::<gtk::ListBoxRow>() && w.parent().unwrap().parent().unwrap().parent().unwrap().parent().unwrap().is::<StackSidebar>() => {
if let Some(w) = GtkWindowExt::focus(&window) {
let mut is_sidebar_tab = false;
if w.is::<gtk::ListBoxRow>() {
if let Some(w_father) = w.parent() {
if let Some(w_grandfather) = w_father.parent() {
if let Some(w_great_grandfather) = w_grandfather.parent() {
if let Some(w_great_great_grandfather) = w_great_grandfather.parent() {
is_sidebar_tab = w_great_great_grandfather.is::<StackSidebar>();
}
}
}
}
}
if is_sidebar_tab {
let old_focus_idx = w.clone().downcast::<gtk::ListBoxRow>().unwrap().index();
let new_focus_idx = old_focus_idx + match key {
gdk::Key::Tab => 1,
@@ -1018,9 +1030,8 @@ fn build_ui(app: &Application) {
let next_row = list_box.row_at_index(new_focus_idx.try_into().unwrap()).unwrap();
next_row.grab_focus();
return glib::Propagation::Stop
}
},
_ => ()
};
}
}
}
glib::Propagation::Proceed
Loading