初步重构
This commit is contained in:
@@ -7,15 +7,15 @@ struct Hover_Info_Render_Able_InterFace;
|
||||
struct LIB_DECL Hover_Info_Render_State {
|
||||
virtual ~Hover_Info_Render_State() = default;
|
||||
Hover_Info_Render_State() {
|
||||
hoverInfoBrush = QBrush(Qt::white);
|
||||
hover_info_brush = QBrush(Qt::white);
|
||||
}
|
||||
int hoverInfoLeft = 4, hoverInfoTop = 4, hoverInfoRight = 4, hoverInfoBottom = 4;
|
||||
QBrush hoverInfoBrush;
|
||||
QFont hoverInfoFont;
|
||||
int hover_info_left = 4, hover_info_top = 4, hover_info_right = 4, hover_info_bottom = 4;
|
||||
QBrush hover_info_brush;
|
||||
QFont hover_info_font;
|
||||
QPen hover_info_pen;
|
||||
bool use_hover_info = true;
|
||||
bool hoverInfoActive = false;
|
||||
QPoint hoverInfoPos;
|
||||
bool hover_info_active = false;
|
||||
QPoint hover_info_pos;
|
||||
Hover_Info_Render_Able_InterFace* renderAble{};
|
||||
void draw_hover(QPainter* painter, Abs_Axis* h, Abs_Axis* v);
|
||||
bool hover_ok(Renderable* able) const;
|
||||
@@ -42,18 +42,18 @@ struct LIB_DECL Hover_Info_Render_Able_InterFace {
|
||||
}
|
||||
void set_hover_info_font(const QFont& font) {
|
||||
Hover_Info_Render_State* sc = begin_hover_edit();
|
||||
sc->hoverInfoFont = font;
|
||||
sc->hover_info_font = font;
|
||||
finish_hover_edit();
|
||||
}
|
||||
QFont hover_info_font(SRC src = SRC::Edit) {
|
||||
return hover_state(src)->hoverInfoFont;
|
||||
return hover_state(src)->hover_info_font;
|
||||
}
|
||||
QBrush hover_info_background_brush(SRC src = SRC::Edit) {
|
||||
return hover_state(src)->hoverInfoBrush;
|
||||
return hover_state(src)->hover_info_brush;
|
||||
}
|
||||
void set_hover_info_background_brush(const QBrush& brush) {
|
||||
Hover_Info_Render_State* sc = begin_hover_edit();
|
||||
sc->hoverInfoBrush = brush.color().isValid() ? brush : Qt::NoBrush;
|
||||
sc->hover_info_brush = brush.color().isValid() ? brush : Qt::NoBrush;
|
||||
finish_hover_edit();
|
||||
}
|
||||
QPen hover_info_pen(SRC src = SRC::Edit) {
|
||||
@@ -66,17 +66,17 @@ struct LIB_DECL Hover_Info_Render_Able_InterFace {
|
||||
}
|
||||
void get_hover_info_contents_margins(int& left, int& top, int& right, int& bottom, SRC src) {
|
||||
auto s = hover_state(src);
|
||||
left = s->hoverInfoLeft;
|
||||
top = s->hoverInfoTop;
|
||||
right = s->hoverInfoRight;
|
||||
bottom = s->hoverInfoBottom;
|
||||
left = s->hover_info_left;
|
||||
top = s->hover_info_top;
|
||||
right = s->hover_info_right;
|
||||
bottom = s->hover_info_bottom;
|
||||
}
|
||||
void set_hover_info_contents_margins(int left, int top, int right, int bottom) {
|
||||
Hover_Info_Render_State* sc = begin_hover_edit();
|
||||
sc->hoverInfoLeft = left;
|
||||
sc->hoverInfoTop = top;
|
||||
sc->hoverInfoRight = right;
|
||||
sc->hoverInfoBottom = bottom;
|
||||
sc->hover_info_left = left;
|
||||
sc->hover_info_top = top;
|
||||
sc->hover_info_right = right;
|
||||
sc->hover_info_bottom = bottom;
|
||||
finish_hover_edit();
|
||||
}
|
||||
protected:
|
||||
|
||||
Reference in New Issue
Block a user