pub fn update_state(&self, state: &mut key_value::State, timer: &Snapshot<'_>) {
        let segment_index = timer.current_split_index();
        let current_phase = timer.current_phase();
        let comparison = comparison::resolve(&self.settings.comparison_override, timer);
        let text = self.text(comparison);
        let comparison = comparison::or_current(comparison, timer);

        let time = if self.settings.total_possible_time_save {
            Some(possible_time_save::calculate_total(
                timer,
                segment_index.unwrap_or(0),
                comparison,
            ))
        } else if current_phase == TimerPhase::Running || current_phase == TimerPhase::Paused {
            possible_time_save::calculate(timer, segment_index.unwrap(), comparison, false)
        } else {
            None
        };

        state.background = self.settings.background;
        state.key_color = self.settings.label_color;
        state.value_color = self.settings.value_color;
        state.semantic_color = Default::default();

        state.key.clear();
        state.key.push_str(&text); // FIXME: Uncow

        state.value.clear();
        let _ = write!(
            state.value,
            "{}",
            SegmentTime::with_accuracy(self.settings.accuracy).format(time)
        );

        state.key_abbreviations.clear();
        if self.settings.total_possible_time_save {
            state
                .key_abbreviations
                .push("Total Possible Time Save".into());
        }
        state.key_abbreviations.push("Possible Time Save".into());
        state.key_abbreviations.push("Poss. Time Save".into());
        state.key_abbreviations.push("Time Save".into());

        state.display_two_rows = self.settings.display_two_rows;
        state.updates_frequently = false;
    }
/// Updates the component's state based on the timer provided.
Updates the component's state based on the timer provided.
Updates the component ' s state based on the timer provided .
pub fn update_state(&self, state: &mut key_value::State, timer: &Snapshot<'_>) {
        let segment_index = timer.current_split_index();
        let current_phase = timer.current_phase();
        let comparison = comparison::resolve(&self.settings.comparison_override, timer);
        let text = self.text(comparison);
        let comparison = comparison::or_current(comparison, timer);
        let time = if self.settings.total_possible_time_save {
            Some(possible_time_save::calculate_total(
                timer,
                segment_index.unwrap_or(0),
                comparison,
            ))
        } else if current_phase == TimerPhase::Running || current_phase == TimerPhase::Paused {
            possible_time_save::calculate(timer, segment_index.unwrap(), comparison, false)
        } else {
            None
        };
        state.background = self.settings.background;
        state.key_color = self.settings.label_color;
        state.value_color = self.settings.value_color;
        state.semantic_color = Default::default();
        state.key.clear();
        state.key.push_str(&text); // FIXME: Uncow
        state.value.clear();
        let _ = write!(
            state.value,
            "{}",
            SegmentTime::with_accuracy(self.settings.accuracy).format(time)
        );
        state.key_abbreviations.clear();
        if self.settings.total_possible_time_save {
            state
                .key_abbreviations
                .push("Total Possible Time Save".into());
        }
        state.key_abbreviations.push("Possible Time Save".into());
        state.key_abbreviations.push("Poss. Time Save".into());
        state.key_abbreviations.push("Time Save".into());
        state.display_two_rows = self.settings.display_two_rows;
        state.updates_frequently = false;
    }
pub fn update_state ( & self , state : & mut key_value :: State , timer : & Snapshot < ' _ > ) { let segment_index = timer . current_split_index ( ) ; let current_phase = timer . current_phase ( ) ; let comparison = comparison :: resolve ( & self . settings . comparison_override , timer ) ; let text = self . text ( comparison ) ; let comparison = comparison :: or_current ( comparison , timer ) ; let time = if self . settings . total_possible_time_save { Some ( possible_time_save :: calculate_total ( timer , segment_index . unwrap_or ( 0 ) , comparison , ) ) } else if current_phase == TimerPhase :: Running || current_phase == TimerPhase :: Paused { possible_time_save :: calculate ( timer , segment_index . unwrap ( ) , comparison , false ) } else { None } ; state . background = self . settings . background ; state . key_color = self . settings . label_color ; state . value_color = self . settings . value_color ; state . semantic_color = Default :: default ( ) ; state . key . clear ( ) ; state . key . push_str ( & text ) ; // FIXME: Uncow state . value . clear ( ) ; let _ = write ! ( state value " " SegmentTime with_accuracy ( self settings accuracy ) format ( time ) ) ; state . key_abbreviations . clear ( ) ; if self . settings . total_possible_time_save { state . key_abbreviations . push ( " " . into ( ) ) ; } state . key_abbreviations . push ( " " . into ( ) ) ; state . key_abbreviations . push ( " " . into ( ) ) ; state . key_abbreviations . push ( " " . into ( ) ) ; state . display_two_rows = self . settings . display_two_rows ; state . updates_frequently = false ; }
Updates the component's state based on the timer provided.
Updates the component ' s state based on the timer provided .
&self
state
&mut key_value::State
timer
&Snapshot<'_>
&self
state
&mut key_value::State
timer
&Snapshot<'_>