a lightweight, interval-based utility to combat digital strain through "Ma" (intentional pauses) for the eyes and body.
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix(ui): default window size

+25 -14
+24 -13
src/settings/mod.rs
··· 5 5 use fontdue::Font; 6 6 use slint::{ComponentHandle, Model, ModelRc, SharedString, VecModel}; 7 7 8 - use crate::timer::active_profile; 9 8 use crate::autostart; 10 - use crate::config::{ 11 - self, AppConfig, BreakLevelConfig, LongBreakConfig, OverlayTheme, 12 - }; 9 + use crate::config::{self, AppConfig, BreakLevelConfig, LongBreakConfig, OverlayTheme}; 13 10 use crate::generated::{LevelEntry, PasswordSetupWindow, SettingsWindow}; 14 11 use crate::overlay::password; 15 12 use crate::timer::TimerCommand; 13 + use crate::timer::active_profile; 16 14 17 15 pub struct SettingsManager { 18 16 window: SettingsWindow, ··· 182 180 // creation; an explicit set_size after mapping ensures the correct height. 183 181 self.window 184 182 .window() 185 - .set_size(slint::LogicalSize::new(760.0, 680.0)); 183 + .set_size(slint::LogicalSize::new(680.0, 760.0)); 186 184 } 187 185 } 188 186 ··· 204 202 pub text_size_mode: i32, 205 203 } 206 204 207 - fn collect_form_data(window: &SettingsWindow, levels_model: &VecModel<LevelEntry>) -> SettingsFormData { 205 + fn collect_form_data( 206 + window: &SettingsWindow, 207 + levels_model: &VecModel<LevelEntry>, 208 + ) -> SettingsFormData { 208 209 SettingsFormData { 209 210 active_profile: window.get_active_profile().to_string(), 210 211 idle_detection_enabled: window.get_idle_detection_enabled(), 211 212 idle_threshold_mins: window.get_idle_threshold_mins(), 212 213 levels: (0..levels_model.row_count()) 213 214 .filter_map(|i| levels_model.row_data(i)) 214 - .map(|e| (e.work_mins, e.break_mins, e.break_extra_secs, e.label.to_string(), e.enforced)) 215 + .map(|e| { 216 + ( 217 + e.work_mins, 218 + e.break_mins, 219 + e.break_extra_secs, 220 + e.label.to_string(), 221 + e.enforced, 222 + ) 223 + }) 215 224 .collect(), 216 225 long_break_enabled: window.get_long_break_enabled(), 217 226 long_break_after_cycles: window.get_long_break_after_cycles(), ··· 241 250 prof.levels = data 242 251 .levels 243 252 .iter() 244 - .map(|(work_mins, break_mins, extra_secs, label, enforced)| BreakLevelConfig { 245 - work_secs: *work_mins as u64 * 60, 246 - break_secs: *break_mins as u64 * 60 + *extra_secs as u64, 247 - label: label.clone(), 248 - enforced: *enforced, 249 - }) 253 + .map( 254 + |(work_mins, break_mins, extra_secs, label, enforced)| BreakLevelConfig { 255 + work_secs: *work_mins as u64 * 60, 256 + break_secs: *break_mins as u64 * 60 + *extra_secs as u64, 257 + label: label.clone(), 258 + enforced: *enforced, 259 + }, 260 + ) 250 261 .collect(); 251 262 252 263 prof.long_break = if data.long_break_enabled {
+1 -1
ui/settings.slint
··· 15 15 export component SettingsWindow inherits Window { 16 16 title: "ioma — Settings"; 17 17 preferred-width: 680px; 18 - preferred-height: 880px; 18 + preferred-height: 760px; 19 19 min-width: 460px; 20 20 background: Theme.bg; 21 21 default-font-family: "Nunito";