1#[derive(Debug, Clone)]
6pub struct HostConfig {
7 pub app_id: String,
10 pub tray: bool,
11 pub tray_tooltip: String,
12 pub close_to_tray: bool,
14 pub single_instance: bool,
15 pub window_state: bool,
16}
17
18impl HostConfig {
19 pub fn new(app_id: impl Into<String>) -> Self {
20 let app_id = app_id.into();
21 Self {
22 tray_tooltip: app_id.clone(),
23 app_id,
24 tray: false,
25 close_to_tray: false,
26 single_instance: true,
27 window_state: true,
28 }
29 }
30
31 pub fn with_tray(mut self, tooltip: impl Into<String>) -> Self {
32 self.tray = true;
33 self.tray_tooltip = tooltip.into();
34 self
35 }
36
37 pub fn with_close_to_tray(mut self, close_to_tray: bool) -> Self {
38 self.close_to_tray = close_to_tray;
39 self
40 }
41}