diff options
Diffstat (limited to '')
-rw-r--r-- | src/menu/mouse_event.cpp | 7 | ||||
-rw-r--r-- | src/menu/software_mouse_pointer.cpp | 3 |
2 files changed, 6 insertions, 4 deletions
diff --git a/src/menu/mouse_event.cpp b/src/menu/mouse_event.cpp index 3f4104a0..ddcc00f2 100644 --- a/src/menu/mouse_event.cpp +++ b/src/menu/mouse_event.cpp @@ -25,6 +25,7 @@ #include <cstddef> #include "mouse_event.hpp" +#include "utils/compat/chrono_literals.hpp" namespace usdx { @@ -48,17 +49,17 @@ namespace usdx { if (direction == UP) { if (this->direction == DOWN) { - if (time.since(std::chrono::milliseconds{5000})) + if (time.since(5000_ms)) return CLICK; } else if (this->direction == CLICK) { - if (time.since(std::chrono::milliseconds{5000})) + if (time.since(5000_ms)) return DBL_CLICK; } } else if (direction == DOWN) { if (this->direction == CLICK && - time.since(std::chrono::milliseconds{5000})) + time.since(5000_ms)) return CLICK; } } diff --git a/src/menu/software_mouse_pointer.cpp b/src/menu/software_mouse_pointer.cpp index 2708917c..fd102fa8 100644 --- a/src/menu/software_mouse_pointer.cpp +++ b/src/menu/software_mouse_pointer.cpp @@ -28,13 +28,14 @@ #include "software_mouse_pointer.hpp" #include "utils/activator.hpp" +#include "utils/compat/chrono_literals.hpp" namespace usdx { SoftwareMousePointer::SoftwareMousePointer(Container* parent, EventManager* event_manager) : DrawableControl(parent), color(255,255,255,100), down(false) { - fade_inactive = new Timer(this, std::chrono::seconds{2}, true); + fade_inactive = new Timer(this, 2_s, true); this->vertices[0] = 0.0f; this->vertices[1] = 40.0f; |