1
0
Fork 0
mirror of synced 2024-04-29 10:03:00 +12:00
czkawka/czkawka_gui/src/gui_structs/gui_header.rs
2022-04-03 16:03:01 +02:00

28 lines
910 B
Rust

use gtk::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: gtk::Button,
pub button_app_info: gtk::Button,
}
impl GuiHeader {
pub fn create_from_builder(builder: &gtk::Builder) -> Self {
let button_settings: gtk::Button = builder.object("button_settings").unwrap();
let button_app_info: gtk::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")));
}
}