mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-11-28 19:55:53 +03:00
term: bump on-return spinner delay from 0 to 100ms
Not drawing the spinner when the command gets processed nearly instantly makes things feel slightly better.
This commit is contained in:
parent
56f1ef3a4c
commit
fab0f65d58
@ -173,7 +173,8 @@ leftBracket, rightBracket :: Text
|
||||
leftBracket = "«"
|
||||
rightBracket = "»"
|
||||
|
||||
_spin_cool_us, _spin_warm_us, _spin_rate_us, _spin_idle_us :: Integral i => i
|
||||
_spin_fast_us, _spin_cool_us, _spin_warm_us, _spin_rate_us, _spin_idle_us :: Integral i => i
|
||||
_spin_fast_us = 100000
|
||||
_spin_cool_us = 500000
|
||||
_spin_warm_us = 50000
|
||||
_spin_rate_us = 250000
|
||||
@ -330,7 +331,7 @@ localClient doneSignal = fst <$> mkRAcquire start stop
|
||||
|
||||
current <- io $ now
|
||||
delay <- pure $ case mTxt of
|
||||
Nothing -> 0
|
||||
Nothing -> _spin_fast_us
|
||||
Just _ ->
|
||||
if (gap current lsPrevEndTime ^. microSecs) < _spin_idle_us
|
||||
then _spin_warm_us
|
||||
|
@ -1023,6 +1023,7 @@ _term_spin_timer_cb(uv_timer_t* tim_u)
|
||||
_term_spin_step(uty_u);
|
||||
}
|
||||
|
||||
#define _SPIN_FAST_US 100UL // spinner activation delay when expected
|
||||
#define _SPIN_COOL_US 500UL // spinner activation delay when cool
|
||||
#define _SPIN_WARM_US 50UL // spinner activation delay when warm
|
||||
#define _SPIN_RATE_US 250UL // spinner rate (ms/frame)
|
||||
@ -1047,7 +1048,7 @@ u3_term_start_spinner(u3_atom say, c3_o del_o)
|
||||
{
|
||||
c3_d now_d = _term_msc_out_host();
|
||||
c3_d end_d = tat_u->sun_u.end_d;
|
||||
c3_d wen_d = (c3n == del_o) ? 0UL :
|
||||
c3_d wen_d = (c3n == del_o) ? _SPIN_FAST_US :
|
||||
(now_d - end_d < _SPIN_IDLE_US) ?
|
||||
_SPIN_WARM_US : _SPIN_COOL_US;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user