File: gui_header.rs

package info (click to toggle)
rust-czkawka-gui 8.0.0-4
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 2,208 kB
  • sloc: xml: 37; makefile: 13
file content (27 lines) | stat: -rw-r--r-- 910 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
use gtk4::prelude::*;

use crate::help_functions::set_icon_of_button;
use crate::{flg};

#[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").expect("Cambalache");
        let button_app_info: gtk4::Button = builder.object("button_app_info").expect("Cambalache");

        //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")));
    }
}