Maki
Formally verfied 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
30
QColor highlightColor;
31
Config::ControlPosition position = Config::ControlPosition::Top;
32
};
33
34
class
CanvasControlWidget :
public
QGraphicsProxyWidget
35
{
36
public
:
37
CanvasControlWidget(std::function<
void
()> dismissed, QGraphicsItem* parent =
nullptr
);
38
39
maki::ControlWidget* controlWidget()
const
;
40
void
setControlWidget(maki::ControlWidget* controls,
const
ControlProperties
& properties);
41
42
bool
hideControl();
43
44
protected
:
45
void
hoverEnterEvent(QGraphicsSceneHoverEvent* event)
override
;
46
void
hoverLeaveEvent(QGraphicsSceneHoverEvent* event)
override
;
47
bool
eventFilter(QObject* watched, QEvent* event)
override
;
48
49
private
:
50
const
int
FADE_DELAY_MS = 2000;
51
const
int
FADE_DURATION_MS = 150;
52
53
StyledFrame
* mFrame =
nullptr
;
54
QHBoxLayout* mFrameLayout =
nullptr
;
55
maki::ControlWidget* mControls =
nullptr
;
56
CloseButton
* mCloseButton =
nullptr
;
57
58
std::function<void()> mDismissed;
59
60
ControlProperties
mProperties;
61
bool
mMouseInside =
false
;
62
QTimer* mFadeTimer =
nullptr
;
63
QPropertyAnimation* mFadeAnimation =
nullptr
;
64
65
void
startFadeOut();
66
void
cancelFadeOut();
67
};
CloseButton
Definition
close_button.h:6
StyledFrame
Definition
frame.h:10
maki
Contains UI helper widgets and layout grouping utilities used by MAKI.
Definition
generator.h:10
ControlProperties
Definition
canvas_control_widget.h:25
Generated for
MAKI
· © 2026 with
Doxygen
1.9.8
GitHub
Research