-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwindow.h
More file actions
70 lines (53 loc) · 1.56 KB
/
Copy pathwindow.h
File metadata and controls
70 lines (53 loc) · 1.56 KB
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
62
63
64
65
66
67
68
69
70
#ifndef WINDOW_H
#define WINDOW_H
#include <vector>
#include <QWidget>
#include <QTimer>
#include <QGridLayout>
#include <QResizeEvent>
class TaskWidget; // Forward reference
/*!
\brief Size aspect ratio
If not REGULAR, sets the other value to this. E.g. if WIDTH, sets height to width.
*/
enum SizeAspect {
REGULAR = 0,
HEIGHT = 1,
WIDTH = 2
};
/*!
\brief A positioned widget
Positioned using my positioning; percent of screen the widget is able to be on. This means to be in exactly touching the edge you would be at 100% or 0% (depending on which edge)
Coordinates can be floats or ints.
Can have a size aspect ratio (see `SizeAspect`)
*/
struct Widget {
QWidget* wid;
QPointF position;
QSizeF size;
SizeAspect sizeRatio = REGULAR;
};
class Window : public QWidget
{
Q_OBJECT
public:
Window();
/*!
\brief The widgets that are displayed
This list is iterated over to position all the widgets correctly in the `resizeElms` func.
*/
std::vector<Widget> wids;
/*! \brief Resize all the elements according to the screen size */
void resizeElms();
/*! \brief Create the main tasks view, destroying everything if exists and starting from scratch */
void mainView();
/*!
\brief The 4 sections that tasks are added to
Stored in the Window class as it is used all over the place
*/
std::array<std::vector<TaskWidget*>, 4> sections;
protected:
/*! \brief Just a wrapper for the `resizeElms` func */
void resizeEvent(QResizeEvent *event);
};
#endif