1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 10:57:35 +00:00

LibGUI: Move GUI::FocusPolicy to its own header & add explainer comment

This commit is contained in:
Andreas Kling 2021-10-21 12:29:36 +02:00
parent c1ba9c66b5
commit d621534511
2 changed files with 29 additions and 9 deletions

View file

@ -0,0 +1,28 @@
/*
* Copyright (c) 2020-2021, Andreas Kling <kling@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <AK/EnumBits.h>
namespace GUI {
// FocusPolicy determines how GUI widgets gain focus.
//
// - NoFocus: The widget is not focusable.
// - TabFocus: The widget can gain focus by cycling through focusable widgets with the Tab key.
// - ClickFocus: The widget gains focus when clicked.
// - StrongFocus: The widget can gain focus both via Tab, and by clicking on it.
enum class FocusPolicy {
NoFocus = 0,
TabFocus = 0x1,
ClickFocus = 0x2,
StrongFocus = TabFocus | ClickFocus,
};
AK_ENUM_BITWISE_OPERATORS(FocusPolicy)
}