summaryrefslogtreecommitdiff
path: root/Userland
diff options
context:
space:
mode:
authorLucas CHOLLET <lucas.chollet@free.fr>2022-06-07 22:44:13 +0200
committerLinus Groh <mail@linusgroh.de>2022-07-19 10:49:38 +0100
commitcb4844bf649cd3a55e0f461c6278c44c102c97b3 (patch)
tree0ce208e643ced468f89f268422dcf989f9eea2de /Userland
parent9c2211f246b54de2cdc751b2713c998f7acaefac (diff)
downloadserenity-cb4844bf649cd3a55e0f461c6278c44c102c97b3.zip
LibGUI: Add VerticalDirection::operator!
This allows to invert the direction of a VerticalDirection.
Diffstat (limited to 'Userland')
-rw-r--r--Userland/Libraries/LibGUI/Widget.h7
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)