Smooth column focus pulse
This commit is contained in:
parent
4ffed61769
commit
68aa45bb72
|
|
@ -59,6 +59,7 @@ const PREVIEW_SUCCESS: Color32 = Color32::from_rgb(115, 205, 150);
|
|||
const PREVIEW_AMBER: Color32 = Color32::from_rgb(235, 190, 95);
|
||||
const PREVIEW_GAP: Color32 = Color32::from_rgb(110, 200, 215);
|
||||
const PREVIEW_RED: Color32 = Color32::from_rgb(245, 125, 120);
|
||||
const COLUMN_FOCUS_PULSE_SECONDS: f64 = 1.8;
|
||||
|
||||
fn needs_information(d: &Diagnostic) -> bool {
|
||||
d.code.starts_with("MISSING_")
|
||||
|
|
@ -887,7 +888,7 @@ impl App {
|
|||
{
|
||||
mapping_focus_scroll = candidates.first().copied();
|
||||
mapping_focus = Some((role, candidates));
|
||||
mapping_focus_until = Some(now + 3.0);
|
||||
mapping_focus_until = Some(now + COLUMN_FOCUS_PULSE_SECONDS);
|
||||
}
|
||||
});
|
||||
egui::CollapsingHeader::new(RichText::new("Technical details").weak())
|
||||
|
|
@ -939,7 +940,11 @@ impl App {
|
|||
let mut frame = egui::Frame::new().inner_margin(6.0);
|
||||
if !highlighted_role.is_empty() {
|
||||
let pulse = if focused {
|
||||
((now * std::f64::consts::TAU * 1.5).sin() * 0.5 + 0.5) as f32
|
||||
let until = mapping_focus_until.unwrap_or(now);
|
||||
let progress = ((now - (until - COLUMN_FOCUS_PULSE_SECONDS))
|
||||
/ COLUMN_FOCUS_PULSE_SECONDS)
|
||||
.clamp(0.0, 1.0);
|
||||
(std::f64::consts::PI * progress).sin() as f32
|
||||
} else {
|
||||
0.0
|
||||
};
|
||||
|
|
@ -947,7 +952,7 @@ impl App {
|
|||
.lerp_to_gamma(Color32::from_rgb(91, 68, 24), pulse * 0.7);
|
||||
frame = frame
|
||||
.fill(fill)
|
||||
.stroke(egui::Stroke::new(1.0_f32 + pulse, PREVIEW_AMBER))
|
||||
.stroke(egui::Stroke::new(1.0_f32, PREVIEW_AMBER))
|
||||
.corner_radius(4.0);
|
||||
if focused {
|
||||
ui.ctx()
|
||||
|
|
|
|||
|
|
@ -55,10 +55,10 @@ cells marked as times display as `HH:MM:SS` in samples and the inspector; the
|
|||
original stored value remains available in the inspector.
|
||||
When several columns could have the same timing role, the error gives a short
|
||||
instruction and highlights all candidate columns in amber immediately. The
|
||||
**Choose … column…** button scrolls to that candidate group and briefly pulses
|
||||
its framing, which distinguishes the requested group when several mapping issues
|
||||
are present. The short message and button share a line when space permits. The
|
||||
original inference explanation remains under the subdued **Technical details**.
|
||||
**Choose … column…** button scrolls to that candidate group and gives it one slow
|
||||
brightness pulse with a fixed border, which distinguishes the group when several
|
||||
mapping issues are present. The short message and button share a line when space
|
||||
permits. The original inference explanation remains under the subdued **Technical details**.
|
||||
Review has two views:
|
||||
|
||||
The main navigation and Review view tabs use a subtle purple tint so they remain
|
||||
|
|
|
|||
Loading…
Reference in New Issue