Skip to content

Commit 55aaaf7

Browse files
committed
feat: app icon on settings window, smarter updater UI, startup status
1 parent 68dfa08 commit 55aaaf7

4 files changed

Lines changed: 38 additions & 8 deletions

File tree

src/tray.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ pub struct TrayHandle {
2323
pub ids: TrayMenuIds,
2424
}
2525

26-
const ICON_SIZE: usize = 64;
26+
pub const ICON_SIZE: usize = 64;
2727

2828
// pixel helpers
2929

src/ui/mod.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,11 +168,18 @@ pub fn open_settings(config_shared: Arc<Mutex<AppConfig>>, cmd_tx: mpsc::Sender<
168168
}
169169
let _guard = Guard;
170170

171+
let icon = {
172+
let rgba = crate::tray::build_icon_rgba(&crate::state::AppState::default());
173+
let size = crate::tray::ICON_SIZE as u32;
174+
std::sync::Arc::new(egui::IconData { rgba, width: size, height: size })
175+
};
176+
171177
let native_options = eframe::NativeOptions {
172178
viewport: egui::ViewportBuilder::default()
173179
.with_title("HideDesktopApps Settings")
174180
.with_inner_size([600.0, 480.0])
175-
.with_resizable(true),
181+
.with_resizable(true)
182+
.with_icon(icon),
176183
event_loop_builder: Some(Box::new(|builder| {
177184
use winit::platform::windows::EventLoopBuilderExtWindows;
178185
builder.with_any_thread(true);

src/ui/startup_tab.rs

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,27 @@ impl SettingsApp {
1616
self.dirty = true;
1717
}
1818

19+
// Big clear status banner so the user always knows the actual state.
20+
let (banner_text, banner_color) = if self.config.startup.enabled {
21+
("Startup: ENABLED", egui::Color32::from_rgb(80, 200, 100))
22+
} else {
23+
("Startup: DISABLED", egui::Color32::from_rgb(160, 160, 160))
24+
};
25+
ui.colored_label(banner_color, banner_text);
26+
1927
ui.add_space(8.0);
2028
ui.separator();
2129

22-
// Query the registry directly so the status is always accurate.
30+
// Query the task scheduler directly so the status is always accurate.
2331
let registered = crate::startup::is_registered();
2432
self.startup_registered = registered;
2533

26-
ui.label(if registered {
27-
"Status: Registered in startup."
34+
let (task_text, task_color) = if registered {
35+
("Task registered: Yes", egui::Color32::from_rgb(80, 200, 100))
2836
} else {
29-
"Status: Not registered in startup."
30-
});
37+
("Task registered: No", egui::Color32::from_rgb(220, 100, 80))
38+
};
39+
ui.colored_label(task_color, task_text);
3140

3241
ui.add_space(4.0);
3342
ui.horizontal(|ui| {

src/ui/updater_tab.rs

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,13 +118,27 @@ impl SettingsApp {
118118
self.update_status = Some("Checking...".to_string());
119119
}
120120

121-
if ui.button("Download & Install Update").clicked() {
121+
let update_ready = self
122+
.update_status
123+
.as_deref()
124+
.map_or(false, |s| s.starts_with("Update available"));
125+
126+
if update_ready && ui.button("Download & Install Update").clicked() {
122127
let channel = self.config.updater.channel.clone();
123128
crate::updater::background_apply(channel);
124129
self.update_status = Some("Downloading update...".to_string());
125130
}
126131
});
127132

133+
if self.config.updater.enabled {
134+
ui.add_space(2.0);
135+
ui.weak(format!(
136+
"Auto-checks every {} hour{}.",
137+
self.config.updater.check_interval_h,
138+
if self.config.updater.check_interval_h == 1 { "" } else { "s" }
139+
));
140+
}
141+
128142
ui.add_space(8.0);
129143
ui.label("Updates are verified with SHA-256 before applying.");
130144
}

0 commit comments

Comments
 (0)