diff options
author | Lucas CHOLLET <lucas.chollet@free.fr> | 2022-06-07 22:44:13 +0200 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2022-07-19 10:49:38 +0100 |
commit | cb4844bf649cd3a55e0f461c6278c44c102c97b3 (patch) | |
tree | 0ce208e643ced468f89f268422dcf989f9eea2de /Userland/Libraries/LibGUI/Widget.h | |
parent | 9c2211f246b54de2cdc751b2713c998f7acaefac (diff) | |
download | serenity-cb4844bf649cd3a55e0f461c6278c44c102c97b3.zip |
LibGUI: Add VerticalDirection::operator!
This allows to invert the direction of a VerticalDirection.
Diffstat (limited to 'Userland/Libraries/LibGUI/Widget.h')
-rw-r--r-- | Userland/Libraries/LibGUI/Widget.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Userland/Libraries/LibGUI/Widget.h b/Userland/Libraries/LibGUI/Widget.h index 830007fa8e..f856f137b6 100644 --- a/Userland/Libraries/LibGUI/Widget.h +++ b/Userland/Libraries/LibGUI/Widget.h @@ -52,6 +52,13 @@ enum class VerticalDirection { Down }; +constexpr VerticalDirection operator!(VerticalDirection const& other) +{ + if (other == VerticalDirection::Up) + return VerticalDirection::Down; + return VerticalDirection::Up; +} + constexpr VerticalDirection key_code_to_vertical_direction(KeyCode const& key) { if (key == Key_Up) |