Maki
Formally verified low-code orchestration
Toggle main menu visibility
Loading...
Searching...
No Matches
canvas_control_widget.h
1
#pragma once
2
3
#include <QColor>
4
#include <QGraphicsProxyWidget>
5
#include <functional>
6
7
#include "app_configs.h"
8
9
class
QEnterEvent;
10
class
QEvent;
11
class
QHBoxLayout;
12
class
QPropertyAnimation;
13
class
QTimer;
14
class
QWidget;
15
16
class
CloseButton
;
17
class
StyledFrame
;
18
19
namespace
maki
20
{
21
class
ControlWidget;
22
}
23
24
struct
ControlProperties
25
{
26
bool
isFading =
false
;
27
int
fadeDurationMs = 150;
28
int
fadeDelayMs = 1000;
29
QPointF fixedPosition = {};
30
31
QColor highlightColor;
32
Config::ControlPosition position = Config::ControlPosition::Top;
33
};
34
35
class
CanvasControlWidget :
public
QGraphicsProxyWidget
36
{
37
public
:
38
explicit
CanvasControlWidget(std::function<
void
()> dismissed, QGraphicsItem* parent =
nullptr
);
39
40
maki::ControlWidget* controlWidget()
const
;
41
void
setControlWidget(maki::ControlWidget* controls,
const
ControlProperties
& properties);
42
43
bool
hideControl();
44
void
activate();
45
void
setPermanent();
46
bool
permanent()
const
;
47
48
protected
:
49
void
hoverEnterEvent(QGraphicsSceneHoverEvent* event)
override
;
50
void
hoverLeaveEvent(QGraphicsSceneHoverEvent* event)
override
;
51
bool
eventFilter(QObject* watched, QEvent* event)
override
;
52
53
private
:
54
const
int
FADE_DELAY_MS = 2000;
55
const
int
FADE_DURATION_MS = 150;
56
57
StyledFrame
* mFrame =
nullptr
;
58
QHBoxLayout* mFrameLayout =
nullptr
;
59
maki::ControlWidget* mControls =
nullptr
;
60
CloseButton
* mCloseButton =
nullptr
;
61
std::function<void()> mDismissed;
62
63
ControlProperties
mProperties;
64
bool
mMouseInside =
false
;
65
QTimer* mFadeTimer =
nullptr
;
66
QPropertyAnimation* mFadeAnimation =
nullptr
;
67
68
void
startFadeOut();
69
void
cancelFadeOut();
70
};
CloseButton
Definition
close_button.h:6
StyledFrame
Definition
frame.h:10
maki
Contains UI helper widgets and layout grouping utilities used by MAKI.
Definition
macros.h:9
ControlProperties
Definition
canvas_control_widget.h:25
Generated for
MAKI
· © 2026 with
Doxygen
1.9.8
GitHub
Research