diff --git a/src/backlight.rs b/src/backlight.rs index 1991021..0b4ff33 100644 --- a/src/backlight.rs +++ b/src/backlight.rs @@ -114,13 +114,13 @@ impl ModuleImpl for Backlight { "backlight", )?; draw_bar( - &mut buf.subdimensions((128, 0, 432, 24))?, + &mut buf.subdimensions((128, 0, 464, 24))?, &c, - 432, + 464, 24, self.brightness(), )?; - draw_box(&mut buf.subdimensions((128, 0, 432, 24))?, &c, (432, 24))?; + draw_box(&mut buf.subdimensions((128, 0, 464, 24))?, &c, (464, 24))?; Ok(vec![buf.get_signed_bounds()]) } diff --git a/src/battery.rs b/src/battery.rs index e5f5851..981f89b 100644 --- a/src/battery.rs +++ b/src/battery.rs @@ -213,17 +213,17 @@ impl ModuleImpl for UpowerBattery { "battery", )?; draw_bar( - &mut buf.subdimensions((128, 0, 432, 24))?, + &mut buf.subdimensions((128, 0, 464, 24))?, &bar_color, - 432, + 464, 24, (inner.capacity as f32) / 100.0, )?; draw_box( - &mut buf.subdimensions((128, 0, 432, 24))?, + &mut buf.subdimensions((128, 0, 464, 24))?, &bar_color, - (432, 24), + (464, 24), )?; Ok(vec![buf.get_signed_bounds()]) } diff --git a/src/calendar.rs b/src/calendar.rs index 392c0d6..8471a3e 100644 --- a/src/calendar.rs +++ b/src/calendar.rs @@ -79,7 +79,7 @@ impl Calendar { }; self.day_cache.draw_text( - &mut buf.subdimensions((idx * 48 + 4, (y_off * 32) + 64, 32, 16))?, + &mut buf.subdimensions((idx * 48 + 4, (y_off * 32) + 64, 24, 16))?, background_color, &Color::new(1.0, 1.0, 1.0, 1.0), &wk_chr, @@ -105,7 +105,7 @@ impl Calendar { // let wk = time.iso_week(); self.calendar_cache.draw_text( - &mut buf.subdimensions((0 * 48, (y_off * 32) + 64, 38, 32))?, + &mut buf.subdimensions((0 * 48, (y_off * 32) + 64, 32, 32))?, background_color, &Color::new(0.75, 0.75, 0.75, 1.0), &format!("{:02}", wk.week()), @@ -123,11 +123,12 @@ impl Calendar { }; self.calendar_cache.draw_text( - &mut buf.subdimensions((x_pos * 48, (y_off * 32) + 64, 38, 32))?, + &mut buf.subdimensions((x_pos * 48, (y_off * 32) + 64, 32, 32))?, background_color, &c, &format!("{:02}", time.day()), )?; + let t = time.with_day(time.day() + 1); if t.is_none() { done = true; @@ -139,7 +140,6 @@ impl Calendar { y_off += 1; } - Ok(buf.get_signed_bounds()) } } @@ -195,13 +195,13 @@ impl ModuleImpl for Calendar { .unwrap(); } self.draw_month( - &mut buf.subdimensions((0, 0, 384, 344))?, + &mut buf.subdimensions((0, 0, 368, 320))?, background_color, &time, &t.pred().with_day(1).unwrap(), )?; self.draw_month( - &mut buf.subdimensions((448, 0, 384, 344))?, + &mut buf.subdimensions((432, 0, 368, 320))?, background_color, &time, &t, @@ -212,7 +212,7 @@ impl ModuleImpl for Calendar { t.with_month(t.month() + 1).unwrap() }; self.draw_month( - &mut buf.subdimensions((896, 0, 384, 344))?, + &mut buf.subdimensions((864, 0, 368, 320))?, background_color, &time, &n, diff --git a/src/clock.rs b/src/clock.rs index d72c257..1151cbf 100644 --- a/src/clock.rs +++ b/src/clock.rs @@ -55,7 +55,7 @@ impl ModuleImpl for Clock { buf.memset(bg); self.date_cache.draw_text( - &mut buf.subdimensions((0, 0, 448, 64))?, + &mut buf.subdimensions((0, 0, 240 * 2 + 56, 64))?, bg, &Color::new(1.0, 1.0, 1.0, 1.0), &format!( @@ -68,10 +68,10 @@ impl ModuleImpl for Clock { )?; self.clock_cache.draw_text_fixed_width( - &mut buf.subdimensions((0, 64, 288 * 2 + 64, 256))?, + &mut buf.subdimensions((0, 64, 240 * 2 + 56, 256))?, bg, &Color::new(1.0, 1.0, 1.0, 1.0), - &[120, 120, 64, 120, 120], + &[120, 120, 56, 120, 120], &format!("{:02}:{:02}", time.hour(), time.minute()), )?; diff --git a/src/launcher.rs b/src/launcher.rs index 7656e11..4a07e60 100644 --- a/src/launcher.rs +++ b/src/launcher.rs @@ -66,7 +66,7 @@ impl ModuleImpl for Launcher { )?; let mut x_off: i32 = 0; - let mut width_remaining: i32 = 1280 - 64; + let mut width_remaining: i32 = 1232 - 64; if self.matches.len() == 0 && self.cur.len() > 0 { self.font.borrow_mut().auto_draw_text( &mut buf diff --git a/src/main.rs b/src/main.rs index dbc29f9..97f4442 100644 --- a/src/main.rs +++ b/src/main.rs @@ -154,25 +154,25 @@ impl App { let (mod_tx, mod_rx) = channel(); std::thread::spawn(move || { let mut modules = vec![ - Module::new(Box::new(Clock::new(tx.clone())), (0, 0, 720, 320)), - Module::new(Box::new(Calendar::new()), (0, 368, 1280, 344)), + Module::new(Box::new(Clock::new(tx.clone())), (0, 0, 536, 320)), + Module::new(Box::new(Calendar::new()), (0, 368, 1232, 344)), ]; if let Ok(m) = Launcher::new() { - modules.push(Module::new(Box::new(m), (0, 768, 1280, 32))); + modules.push(Module::new(Box::new(m), (0, 728, 1232, 32))); } let mut vert_off = 0; if let Ok(m) = UpowerBattery::new(tx.clone()) { - modules.push(Module::new(Box::new(m), (720, vert_off, 560, 32))); + modules.push(Module::new(Box::new(m), (640, vert_off, 592, 32))); vert_off += 32; } if let Ok(m) = Backlight::new() { - modules.push(Module::new(Box::new(m), (720, vert_off, 560, 32))); + modules.push(Module::new(Box::new(m), (640, vert_off, 592, 32))); vert_off += 32; } if let Ok(m) = PulseAudio::new(tx.clone()) { - modules.push(Module::new(Box::new(m), (720, vert_off, 560, 32))); + modules.push(Module::new(Box::new(m), (640, vert_off, 592, 32))); } mod_tx.send(modules).unwrap(); diff --git a/src/sound.rs b/src/sound.rs index cc28c34..4cf1626 100644 --- a/src/sound.rs +++ b/src/sound.rs @@ -446,15 +446,15 @@ impl ModuleImpl for PulseAudio { &Color::new(1.0, 1.0, 1.0, 1.0), "volume", )?; - draw_bar(&mut buf.subdimensions((128, 0, 432, 24))?, &c, 432, 24, vol)?; + draw_bar(&mut buf.subdimensions((128, 0, 464, 24))?, &c, 464, 24, vol)?; let mut iter = 1.0; while vol > 1.0 { let c = &Color::new(0.75 / iter, 0.25 / iter, 0.25 / iter, 1.0); vol -= 1.0; iter += 1.0; - draw_bar(&mut buf.subdimensions((128, 0, 432, 24))?, &c, 432, 24, vol)?; + draw_bar(&mut buf.subdimensions((128, 0, 464, 24))?, &c, 464, 24, vol)?; } - draw_box(&mut buf.subdimensions((128, 0, 432, 24))?, &c, (432, 24))?; + draw_box(&mut buf.subdimensions((128, 0, 464, 24))?, &c, (464, 24))?; Ok(vec![buf.get_signed_bounds()]) }