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