summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibGUI/SeparatorWidget.h
blob: 64393d190be752a0f5055503a49ec0f48f73313c (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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
/*
 * Copyright (c) 2020, Andreas Kling <kling@serenityos.org>
 * Copyright (c) 2022, the SerenityOS developers.
 *
 * SPDX-License-Identifier: BSD-2-Clause
 */

#pragma once

#include <LibGUI/Widget.h>

namespace GUI {

class SeparatorWidget : public Widget {
    C_OBJECT(SeparatorWidget);

public:
    virtual ~SeparatorWidget() override = default;

protected:
    explicit SeparatorWidget(Gfx::Orientation);

private:
    virtual void paint_event(PaintEvent&) override;
    virtual Optional<UISize> calculated_preferred_size() const override;

    const Gfx::Orientation m_orientation;
};

class VerticalSeparator final : public SeparatorWidget {
    C_OBJECT(VerticalSeparator)
public:
    virtual ~VerticalSeparator() override = default;

private:
    VerticalSeparator()
        : SeparatorWidget(Gfx::Orientation::Vertical)
    {
    }
};

class HorizontalSeparator final : public SeparatorWidget {
    C_OBJECT(HorizontalSeparator)
public:
    virtual ~HorizontalSeparator() override = default;

private:
    HorizontalSeparator()
        : SeparatorWidget(Gfx::Orientation::Horizontal)
    {
    }
};

}