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

28 lines
916 B
Rust

use gtk4::prelude::*;
use crate::help_functions::set_icon_of_button;
use crate::{flg, CZK_ICON_INFO, CZK_ICON_SETTINGS};
#[derive(Clone)]
pub struct GuiHeader {
pub button_settings: gtk4::Button,
pub button_app_info: gtk4::Button,
}
impl GuiHeader {
pub fn create_from_builder(builder: &gtk4::Builder) -> Self {
let button_settings: gtk4::Button = builder.object("button_settings").unwrap();
let button_app_info: gtk4::Button = builder.object("button_app_info").unwrap();
set_icon_of_button(&button_settings, CZK_ICON_SETTINGS);
set_icon_of_button(&button_app_info, CZK_ICON_INFO);
Self { button_settings, button_app_info }
}
pub fn update_language(&self) {
self.button_settings.set_tooltip_text(Some(&flg!("header_setting_button_tooltip")));
self.button_app_info.set_tooltip_text(Some(&flg!("header_about_button_tooltip")));
}
}