-
Notifications
You must be signed in to change notification settings - Fork 2
/
draw_helper.h
61 lines (49 loc) · 1.63 KB
/
draw_helper.h
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
55
56
57
58
59
60
61
#ifndef UI_DRAWHELPER_DRAWHELPER_H
#define UI_DRAWHELPER_DRAWHELPER_H
#include <QColor>
#include <QObject>
#include <QSize>
#include "common_ui_define.h"
class QPainter;
class DrawCharacter {
public:
DrawCharacter() = default;
~DrawCharacter() = default;
static void DrawX(QPainter* painter,
const QRect& target_rect,
const QColor& text_color = X_CHARACTER_COLOR,
const QSize& text_size = QSize(8, 8),
const int pen_width = 2);
static void DrawPlus(QPainter* painter,
const QRect& target_rect,
const QColor& text_color = X_CHARACTER_COLOR,
const QSize& text_size = QSize(8, 8),
const int pen_width = 2);
};
class DrawCircle {
public:
DrawCircle() = default;
~DrawCircle() = default;
static void Draw(QPainter* painter,
const QRect& target_rect,
const QColor& bg_color = CIRCLE_BG_COLOR);
};
class DrawRoundRect {
public:
DrawRoundRect() = default;
~DrawRoundRect() = default;
static void Draw(QPainter* painter,
const QRect& target_rect,
const QColor& bg_color = CIRCLE_BG_COLOR,
const int round_size = 5);
};
// 未完成
class DrawCircleArror {
public:
DrawCircleArror() = default;
~DrawCircleArror() = default;
static void Draw(QPainter* painter,
const QRect& target_rect,
const QColor& bg_color = CIRCLE_BG_COLOR);
};
#endif // UI_DRAWHELPER_DRAWHELPER_H