1
0
Fork 0
mirror of synced 2024-05-15 18:02:53 +12:00
czkawka/czkawka_gui/src/gui_structs/gui_header.rs

28 lines
910 B
Rust
Raw Normal View History

2021-01-25 00:01:02 +13:00
use gtk::prelude::*;
2022-04-04 02:03:01 +12:00
use crate::help_functions::set_icon_of_button;
use crate::{flg, CZK_ICON_INFO, CZK_ICON_SETTINGS};
2021-01-25 00:01:02 +13:00
#[derive(Clone)]
2021-03-28 01:14:02 +13:00
pub struct GuiHeader {
2021-01-25 00:01:02 +13:00
pub button_settings: gtk::Button,
pub button_app_info: gtk::Button,
}
2021-03-28 01:14:02 +13:00
impl GuiHeader {
2021-01-25 00:01:02 +13:00
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();
2022-04-04 02:03:01 +12:00
set_icon_of_button(&button_settings, CZK_ICON_SETTINGS);
set_icon_of_button(&button_app_info, CZK_ICON_INFO);
2021-01-25 00:01:02 +13:00
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")));
}
2021-01-25 00:01:02 +13:00
}