2020-12-30 03:52:27 +01:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2020, Andreas Kling <kling@serenityos.org>
|
2022-02-26 10:50:04 -07:00
|
|
|
* Copyright (c) 2022, the SerenityOS developers.
|
2020-12-30 03:52:27 +01:00
|
|
|
*
|
2021-04-22 01:24:48 -07:00
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
2020-12-30 03:52:27 +01:00
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <LibGUI/Widget.h>
|
|
|
|
|
|
|
|
namespace GUI {
|
|
|
|
|
2021-03-08 11:38:43 -05:00
|
|
|
class SeparatorWidget : public Widget {
|
2020-12-30 03:52:27 +01:00
|
|
|
C_OBJECT(SeparatorWidget);
|
|
|
|
|
|
|
|
public:
|
2022-02-26 10:50:04 -07:00
|
|
|
virtual ~SeparatorWidget() override = default;
|
2020-12-30 03:52:27 +01:00
|
|
|
|
2021-03-08 11:38:43 -05:00
|
|
|
protected:
|
2020-12-30 03:52:27 +01:00
|
|
|
explicit SeparatorWidget(Gfx::Orientation);
|
|
|
|
|
2021-03-08 11:38:43 -05:00
|
|
|
private:
|
2020-12-30 03:52:27 +01:00
|
|
|
virtual void paint_event(PaintEvent&) override;
|
2023-02-10 01:07:03 +01:00
|
|
|
virtual Optional<UISize> calculated_preferred_size() const override;
|
2023-02-28 19:24:56 +00:00
|
|
|
virtual Optional<UISize> calculated_min_size() const override;
|
2020-12-30 03:52:27 +01:00
|
|
|
|
|
|
|
const Gfx::Orientation m_orientation;
|
|
|
|
};
|
2021-03-08 11:38:43 -05:00
|
|
|
|
|
|
|
class VerticalSeparator final : public SeparatorWidget {
|
|
|
|
C_OBJECT(VerticalSeparator)
|
|
|
|
public:
|
2022-02-26 10:50:04 -07:00
|
|
|
virtual ~VerticalSeparator() override = default;
|
2021-03-08 11:38:43 -05:00
|
|
|
|
|
|
|
private:
|
|
|
|
VerticalSeparator()
|
|
|
|
: SeparatorWidget(Gfx::Orientation::Vertical)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
class HorizontalSeparator final : public SeparatorWidget {
|
|
|
|
C_OBJECT(HorizontalSeparator)
|
|
|
|
public:
|
2022-02-26 10:50:04 -07:00
|
|
|
virtual ~HorizontalSeparator() override = default;
|
2021-03-08 11:38:43 -05:00
|
|
|
|
|
|
|
private:
|
|
|
|
HorizontalSeparator()
|
|
|
|
: SeparatorWidget(Gfx::Orientation::Horizontal)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2020-12-30 03:52:27 +01:00
|
|
|
}
|