1
0
Fork 0
mirror of synced 2024-04-30 02:23:53 +12:00
czkawka/czkawka_gui/src/connect_notebook_tabs.rs
Rafał Mikrut 5db5d17afb
Use max line length 180 instead 250 (#515)
This was a little too big value.
I don't like too much too small values, because code looks ugly.
2021-12-21 18:44:20 +01:00

24 lines
794 B
Rust

use gtk::prelude::*;
use crate::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.clone();
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,
);
});
}