blob: c33b53cbbdc16e6b11b5219ff1b55f3d12b8f5d3 (
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
|
#pragma once
#include <LibGUI/GWidget.h>
class GFrame : public GWidget {
public:
explicit GFrame(GWidget* parent);
virtual ~GFrame() override;
enum Shadow { Plain, Raised, Sunken };
enum Shape { NoFrame, Box, Panel, VerticalLine, HorizontalLine };
int frame_thickness() const { return m_thickness; }
void set_frame_thickness(int thickness) { m_thickness = thickness; }
Shadow frame_shadow() const { return m_shadow; }
void set_frame_shadow(Shadow shadow) { m_shadow = shadow; }
Shape frame_shape() const { return m_shape; }
void set_frame_shape(Shape shape) { m_shape = shape; }
Rect frame_inner_rect() const { return rect().shrunken(m_thickness * 2, m_thickness * 2); }
virtual const char* class_name() const override { return "GFrame"; }
protected:
void paint_event(GPaintEvent&) override;
private:
int m_thickness { 0 };
Shadow m_shadow { Plain };
Shape m_shape { NoFrame };
};
|