1
0
Fork 0
mirror of synced 2024-05-06 21:42:42 +12:00
czkawka/czkawka_gui/src/connect_things/connect_notebook_tabs.rs
2022-05-22 10:59:09 +02:00

22 lines
777 B
Rust

use crate::gui_structs::gui_data::GuiData;
use crate::help_functions::*;
use crate::notebook_enums::*;
pub fn connect_notebook_tabs(gui_data: &GuiData) {
let shared_buttons = gui_data.shared_buttons.clone();
let buttons_array = gui_data.bottom_buttons.buttons_array.clone();
let notebook_main_clone = gui_data.main_notebook.notebook_main.clone();
let buttons_names = gui_data.bottom_buttons.buttons_names;
notebook_main_clone.connect_switch_page(move |_, _, number| {
let current_tab_in_main_notebook = to_notebook_main_enum(number);
// Buttons
set_buttons(
&mut *shared_buttons.borrow_mut().get_mut(&current_tab_in_main_notebook).unwrap(),
&buttons_array,
&buttons_names,
);
});
}