1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 12:37:44 +00:00

LibGUI: Add VerticalDirection::operator!

This allows to invert the direction of a VerticalDirection.
This commit is contained in:
Lucas CHOLLET 2022-06-07 22:44:13 +02:00 committed by Linus Groh
parent 9c2211f246
commit cb4844bf64

View file

@ -52,6 +52,13 @@ enum class VerticalDirection {
Down 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) constexpr VerticalDirection key_code_to_vertical_direction(KeyCode const& key)
{ {
if (key == Key_Up) if (key == Key_Up)