mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 19:27:44 +00:00
Everywhere: Use ElapsedTimer::elapsed_time() for comparisons
Simplify a lot of uses of ElapsedTimer by converting the callers to elapsed_time from elapsed, as the AK::Time returned is better for unit conversions and comparisons against constants.
This commit is contained in:
parent
4afa6e264c
commit
ddf348daeb
8 changed files with 22 additions and 12 deletions
|
@ -252,6 +252,8 @@ void TextEditor::doubleclick_event(MouseEvent& event)
|
|||
|
||||
void TextEditor::mousedown_event(MouseEvent& event)
|
||||
{
|
||||
using namespace AK::TimeLiterals;
|
||||
|
||||
if (event.button() != MouseButton::Primary) {
|
||||
return;
|
||||
}
|
||||
|
@ -262,7 +264,7 @@ void TextEditor::mousedown_event(MouseEvent& event)
|
|||
if (is_displayonly())
|
||||
return;
|
||||
|
||||
if (m_triple_click_timer.is_valid() && m_triple_click_timer.elapsed() < 250) {
|
||||
if (m_triple_click_timer.is_valid() && m_triple_click_timer.elapsed_time() < 250_ms) {
|
||||
m_triple_click_timer = Core::ElapsedTimer();
|
||||
select_current_line();
|
||||
return;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue