fn update_bottom_buttons(
    all_gtk_box: &gtk4::Box,
    shared_using_for_preview: Rc<RefCell<(Option<TreePath>, Option<TreePath>)>>,
    image_cache: Rc<RefCell<Vec<(String, String, Image, Image, TreePath)>>>,
) {
    let left_tree_view = (*shared_using_for_preview.borrow()).0.clone().unwrap();
    let right_tree_view = (*shared_using_for_preview.borrow()).1.clone().unwrap();

    for (number, i) in get_all_children(all_gtk_box).into_iter().enumerate() {
        let cache_tree_path = (*image_cache.borrow())[number].4.clone();
        let is_chosen = cache_tree_path != right_tree_view && cache_tree_path != left_tree_view;

        let bx = i.downcast::<gtk4::Box>().unwrap();
        let smaller_bx = get_all_children(&bx)[0].clone().downcast::<gtk4::Box>().unwrap();
        for items in get_all_children(&smaller_bx) {
            if let Ok(btn) = items.downcast::<gtk4::Button>() {
                btn.set_sensitive(is_chosen);
            }
        }
    }
}
/// Disables/Enables L/R buttons at the bottom scrolled view
Disables/Enables L/R buttons at the bottom scrolled view
Disables / Enables L / R buttons at the bottom scrolled view
fn update_bottom_buttons(
    all_gtk_box: &gtk4::Box,
    shared_using_for_preview: Rc<RefCell<(Option<TreePath>, Option<TreePath>)>>,
    image_cache: Rc<RefCell<Vec<(String, String, Image, Image, TreePath)>>>,
) {
    let left_tree_view = (*shared_using_for_preview.borrow()).0.clone().unwrap();
    let right_tree_view = (*shared_using_for_preview.borrow()).1.clone().unwrap();
    for (number, i) in get_all_children(all_gtk_box).into_iter().enumerate() {
        let cache_tree_path = (*image_cache.borrow())[number].4.clone();
        let is_chosen = cache_tree_path != right_tree_view && cache_tree_path != left_tree_view;
        let bx = i.downcast::<gtk4::Box>().unwrap();
        let smaller_bx = get_all_children(&bx)[0].clone().downcast::<gtk4::Box>().unwrap();
        for items in get_all_children(&smaller_bx) {
            if let Ok(btn) = items.downcast::<gtk4::Button>() {
                btn.set_sensitive(is_chosen);
            }
        }
    }
}
fn update_bottom_buttons ( all_gtk_box : & gtk4 :: Box , shared_using_for_preview : Rc < RefCell < ( Option < TreePath > , Option < TreePath > ) > > , image_cache : Rc < RefCell < Vec < ( String , String , Image , Image , TreePath ) > > > , ) { let left_tree_view = ( * shared_using_for_preview . borrow ( ) ) . 0 . clone ( ) . unwrap ( ) ; let right_tree_view = ( * shared_using_for_preview . borrow ( ) ) . 1 . clone ( ) . unwrap ( ) ; for ( number , i ) in get_all_children ( all_gtk_box ) . into_iter ( ) . enumerate ( ) { let cache_tree_path = ( * image_cache . borrow ( ) ) [ number ] . 4 . clone ( ) ; let is_chosen = cache_tree_path != right_tree_view && cache_tree_path != left_tree_view ; let bx = i . downcast :: < gtk4 :: Box > ( ) . unwrap ( ) ; let smaller_bx = get_all_children ( & bx ) [ 0 ] . clone ( ) . downcast :: < gtk4 :: Box > ( ) . unwrap ( ) ; for items in get_all_children ( & smaller_bx ) { if let Ok ( btn ) = items . downcast :: < gtk4 :: Button > ( ) { btn . set_sensitive ( is_chosen ) ; } } } }
Disables/Enables L/R buttons at the bottom scrolled view
Disables / Enables L / R buttons at the bottom scrolled view
all_gtk_box
&gtk4::Box
shared_using_for_preview
Rc<RefCell<(Option<TreePath>, Option<TreePath>)>>
image_cache
Rc<RefCell<Vec<(String, String, Image, Image, TreePath)>>>
all_gtk_box
&gtk4::Box
shared_using_for_preview
Rc<RefCell<(Option<TreePath>, Option<TreePath>)>>
image_cache
Rc<RefCell<Vec<(String, String, Image, Image, TreePath)>>>