tweaks
This commit is contained in:
parent
033db88b8e
commit
4957f3f30b
2 changed files with 6 additions and 13 deletions
src/timer
|
@ -43,14 +43,8 @@ impl eframe::App for Timer {
|
|||
}
|
||||
|
||||
fn get_color(t: f32) -> Color32 {
|
||||
let sr = STARTING_COLOR[0];
|
||||
let sg = STARTING_COLOR[1];
|
||||
let sb = STARTING_COLOR[2];
|
||||
|
||||
let ur = UNIT_COLOR[0];
|
||||
let ug = UNIT_COLOR[1];
|
||||
let ub = UNIT_COLOR[2];
|
||||
|
||||
let [sr, sg, sb] = STARTING_COLOR;
|
||||
let [ur, ug, ub] = UNIT_COLOR;
|
||||
let mag = t * 162.0;
|
||||
let (r, g, b) = (
|
||||
(sr + (mag * ur).round()) as u8,
|
||||
|
|
|
@ -10,7 +10,6 @@ mod state;
|
|||
use state::{ChronoState, NextTimerState, TimerState};
|
||||
mod eframe_app;
|
||||
mod gui;
|
||||
use gui::*;
|
||||
|
||||
#[derive(Debug, Clone, Copy)]
|
||||
pub enum CountDirection {
|
||||
|
@ -97,7 +96,7 @@ impl Timer {
|
|||
self.done = 0.0;
|
||||
|
||||
let (sender, rx) = channel();
|
||||
one_row(ui, &[(start, NextTimerState::Running)], sender);
|
||||
gui::one_row(ui, &[(start, NextTimerState::Running)], sender);
|
||||
|
||||
if rx.recv().is_ok() {
|
||||
let dur = self.duration;
|
||||
|
@ -138,7 +137,7 @@ impl Timer {
|
|||
};
|
||||
let color = Color32::DARK_GRAY;
|
||||
let tsize = size * DIGIT_FACTOR;
|
||||
two_rows(
|
||||
gui::two_rows(
|
||||
ui,
|
||||
&[(text, state::NextTimerState::Paused)],
|
||||
sender,
|
||||
|
@ -187,7 +186,7 @@ impl Timer {
|
|||
CountDirection::Up => self.duration - remaining,
|
||||
};
|
||||
|
||||
two_rows(
|
||||
gui::two_rows(
|
||||
ui,
|
||||
&[
|
||||
(resume, NextTimerState::Running),
|
||||
|
@ -239,7 +238,7 @@ impl Timer {
|
|||
};
|
||||
let (sender, rx) = channel();
|
||||
|
||||
two_rows(
|
||||
gui::two_rows(
|
||||
ui,
|
||||
&[(reset, NextTimerState::Running)], // technically we can send anything but let's try not to be misleading
|
||||
sender,
|
||||
|
|
Loading…
Reference in a new issue