summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibGUI/FocusPolicy.h
blob: 20fa101d7635df01f61d23b82b1d30520a2f05a3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
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)

}