Maki
Formally verfied low-code orchestration
Loading...
Searching...
No Matches
main_window_layout.h
1#pragma once
2
3#include <QMainWindow>
4#include <oclero/qlementine/widgets/LoadingSpinner.hpp>
5#include <oclero/qlementine/widgets/NavigationBar.hpp>
6
7#include "style_helpers.h"
8#include "widgets/execute_button.h"
9#include "widgets/settings_manager.h"
10
11class QWidget;
12class QSplitter;
13class QTabWidget;
14
15class SystemMenu;
16class QTextBrowser;
17class QComboBox;
18class QPushButton;
19class PropertiesMenu;
20class ProcessTab;
21class QUndoGroup;
23class SectionWidget;
24class QScrollArea;
25class BadgedTabWidget;
26class LogTableWidget;
27class QStackedWidget;
28class StyledFrame;
29class CanvasView;
30
31namespace maki
32{
33class SearchWidget;
35class TypeEditor;
36} // namespace maki
37
41class MainWindowLayout : public QMainWindow
42{
43 Q_OBJECT
44
45public:
51 MainWindowLayout(QWidget* parent = nullptr);
52
53protected:
54 // === Main ===
55 QWidget* mCentralWidget;
56 QSplitter* mMainSplitter;
57
58 // === Left Panel ===
59 QTabWidget* mPalette;
61 QScrollArea* mStructureScrollArea;
62
64 QScrollArea* mBehaviourScrollArea;
65
67 QScrollArea* mPipelineScrollArea;
68
70 QSplitter* mLeftPanel;
71
72 // === Central Panel ===
74 oclero::qlementine::LoadingSpinner* mGenerationSpinner;
75
76 QSplitter* mCentralSplitter;
77 QTabWidget* mCanvasPanel;
78 QPushButton* mBrowserTabButton;
79
80 // BadgedTabWidget* mBottomPanel;
82 QStackedWidget* mBottomPanel;
83 oclero::qlementine::NavigationBar* mBottomNavigation;
85 QTextBrowser* mInfoText;
88 maki::TypeEditor* mTypeEditor;
89
90 // === Right Panel ===
91 QSplitter* mRightPanel;
92 QTabWidget* mNavigationTab;
95
96 QTabWidget* mPropertiesTab;
98
99 // === Menu Bar ===
100 QMenuBar* mMenuBar;
101
102 // === Actions ===
103 // File menu
104 QAction* mActionNew;
106 QAction* mActionOpen;
108 QAction* mActionSave;
109 QAction* mActionSaveAs;
110
113
114 QAction* mActionExit;
115
116 // Edit menu
117 QUndoGroup* mUndoGroup;
118 QAction* mActionUndo;
119 QAction* mActionRedo;
120
121 QAction* mActionCopy;
122 QAction* mActionPaste;
123 QAction* mActionCut;
124 QAction* mActionDelete;
125
126 // View menu
127 QAction* mActionZoomIn;
128 QAction* mActionZoomOut;
132
135 QAction* mOpenInfoPanel;
136
138
139 // Diagram menu
142 QAction* mActionAlignV;
143 QAction* mActionAlignH;
144 QAction* mActionDistribute;
145
146 QAction* mActionGenerate;
149 QAction* mActionToggleSnapToGrid;
150
151 // Help menu
152 QAction* mActionDocumentation;
157 QAction* mAboutAction;
158
161
162protected:
166 void onLanguageChanged();
167
173 void toggleGenerationButton(bool running);
174
175 virtual void onActionNew(const QString& templatePath);
176
177private:
178 QList<TranslatableWidget> mTranslatable;
179
183 void buildMainWindow();
184
188 void buildLeftPanel();
189
193 void buildCentralPanel();
194
198 void buildRightPanel();
199
203 void buildMenuBar();
204
208 void applyTheme();
209
218 QWidget* createHeaderComboBox(QComboBox* comboBox, const QString& iconPath, const QString& tooltip);
219
226 void togglePanelVisibility(QWidget* panel, QAction* action);
227
237 int setTabBarWidth(QTabBar* bar, int minWidth, int minBorder, int minPadding);
238};
Custom QGraphicsView for a canvas application.
Definition canvas_view.h:15
Definition execute_button.h:6
A tree view panel for browsing and editing generated files.
Definition file_menu.h:35
A widget for displaying log tables with filtering and search functionality.
Definition log_table_widget.h:21
QAction * mActionImportLibrary
Pointer to the save as action.
Definition main_window_layout.h:111
QMenu * mSpecialTabsMenu
Pointer to the open info panel action.
Definition main_window_layout.h:137
QAction * mActionOpen
Pointer to the new from template action.
Definition main_window_layout.h:106
MainWindowLayout(QWidget *parent=nullptr)
Constructs a new MainWindowLayout object.
Definition main_window_layout.cpp:45
QAction * mActionZoomIn
Pointer to the delete action.
Definition main_window_layout.h:127
QAction * mActionZoomOut
Pointer to the zoom in action.
Definition main_window_layout.h:128
int setTabBarWidth(QTabBar *bar, int minWidth, int minBorder, int minPadding)
Sets the minimum width for a tab bar.
Definition main_window_layout.cpp:722
void buildCentralPanel()
Builds the central panel.
Definition main_window_layout.cpp:204
maki::MissionParameterWidget * mMissionParameters
Pointer to the process tab.
Definition main_window_layout.h:87
QMenu * mGeneratorMenu
Pointer to the special tabs menu.
Definition main_window_layout.h:140
QPushButton * mBrowserTabButton
Pointer to the canvas panel tab widget.
Definition main_window_layout.h:78
QAction * mActionRedo
Pointer to the undo action.
Definition main_window_layout.h:119
StyledFrame * mStructureTab
Pointer to the palette tab widget.
Definition main_window_layout.h:60
QAction * mActionToggleGrid
Pointer to the simulate action.
Definition main_window_layout.h:148
QAction * mActionUndo
Pointer to the undo group.
Definition main_window_layout.h:118
QScrollArea * mStructureScrollArea
Pointer to the structure tab frame.
Definition main_window_layout.h:61
void applyTheme()
Applies the current theme.
Definition main_window_layout.cpp:745
QAction * mActionToggleToasts
Pointer to the fit to screen action.
Definition main_window_layout.h:131
PropertiesMenu * mPropertiesMenu
Pointer to the properties tab widget.
Definition main_window_layout.h:97
int LOG_TAB_INDEX
Pointer to the about action.
Definition main_window_layout.h:159
void togglePanelVisibility(QWidget *panel, QAction *action)
Toggles the visibility of a panel based on an action.
Definition main_window_layout.cpp:944
QAction * mActionQuickStartGuide
Pointer to the documentation action.
Definition main_window_layout.h:153
oclero::qlementine::LoadingSpinner * mGenerationSpinner
Pointer to the generator option combo box.
Definition main_window_layout.h:74
QAction * mActionDelete
Pointer to the cut action.
Definition main_window_layout.h:124
ExecuteButton * mPipelineRun
Pointer to the left panel splitter.
Definition main_window_layout.h:73
GeneratedFilesPanel * mFileMenu
Pointer to the system menu.
Definition main_window_layout.h:94
oclero::qlementine::NavigationBar * mBottomNavigation
Pointer to the bottom panel stacked widget.
Definition main_window_layout.h:83
SystemMenu * mSystemMenu
Pointer to the navigation tab widget.
Definition main_window_layout.h:93
QAction * mActionNewFromTemplate
Pointer to the new action.
Definition main_window_layout.h:105
QAction * mActionReportIssue
Pointer to the shortcuts action.
Definition main_window_layout.h:156
QAction * mActionShortcuts
Pointer to the open all settings action.
Definition main_window_layout.h:155
QAction * mOpenPropertiesPanel
Pointer to the open components panel action.
Definition main_window_layout.h:134
QAction * mOpenInfoPanel
Pointer to the open properties panel action.
Definition main_window_layout.h:135
void onLanguageChanged()
Index of the process tab.
Definition main_window_layout.cpp:859
QAction * mActionNew
Pointer to the menu bar.
Definition main_window_layout.h:104
QWidget * mBottomContainer
Pointer to the browser tab button.
Definition main_window_layout.h:81
void buildRightPanel()
Builds the right panel.
Definition main_window_layout.cpp:414
QAction * mActionSave
Pointer to the open recent menu.
Definition main_window_layout.h:108
QMenu * mActionOpenRecent
Pointer to the open action.
Definition main_window_layout.h:107
QAction * mActionCut
Pointer to the paste action.
Definition main_window_layout.h:123
QMenuBar * mMenuBar
Pointer to the properties menu.
Definition main_window_layout.h:100
QAction * mActionResetZoom
Pointer to the zoom out action.
Definition main_window_layout.h:129
QSplitter * mLeftPanel
Pointer to the palette search widget.
Definition main_window_layout.h:70
QAction * mOpenComponentsPanel
Pointer to the minimize notification toasts action.
Definition main_window_layout.h:133
QAction * mActionInstallPlugin
Pointer to the import library action.
Definition main_window_layout.h:112
int PROCESS_TAB_INDEX
Index of the log tab.
Definition main_window_layout.h:160
QSplitter * mCentralSplitter
Pointer to the generation spinner.
Definition main_window_layout.h:76
StyledFrame * mBehaviourTab
Pointer to the structure scroll area.
Definition main_window_layout.h:63
void buildMainWindow()
List of translatable widgets.
Definition main_window_layout.cpp:51
QScrollArea * mPipelineScrollArea
Pointer to the pipeline tab frame.
Definition main_window_layout.h:67
QTextBrowser * mInfoText
Pointer to the log table widget.
Definition main_window_layout.h:85
QAction * mActionPaste
Pointer to the copy action.
Definition main_window_layout.h:122
void toggleGenerationButton(bool running)
Toggles the generation button state.
Definition main_window_layout.cpp:921
QWidget * createHeaderComboBox(QComboBox *comboBox, const QString &iconPath, const QString &tooltip)
Creates a header combo box with an icon and tooltip.
Definition main_window_layout.cpp:898
QAction * mOpenAllSettings
Pointer to the quick start guide action.
Definition main_window_layout.h:154
StyledFrame * mPipelineTab
Pointer to the behaviour scroll area.
Definition main_window_layout.h:66
QTabWidget * mNavigationTab
Pointer to the right panel splitter.
Definition main_window_layout.h:92
void buildLeftPanel()
Builds the left panel.
Definition main_window_layout.cpp:83
QScrollArea * mBehaviourScrollArea
Pointer to the behaviour tab frame.
Definition main_window_layout.h:64
QUndoGroup * mUndoGroup
Pointer to the exit action.
Definition main_window_layout.h:117
QAction * mAboutAction
Pointer to the report issue action.
Definition main_window_layout.h:157
void buildMenuBar()
Builds the menu bar.
Definition main_window_layout.cpp:470
QAction * mActionAutoRoute
Pointer to the generator menu.
Definition main_window_layout.h:141
LogTableWidget * mLogTable
Pointer to the bottom navigation bar.
Definition main_window_layout.h:84
maki::SearchWidget * mPaletteSearch
Pointer to the pipeline scroll area.
Definition main_window_layout.h:69
QAction * mActionSaveAs
Pointer to the save action.
Definition main_window_layout.h:109
QAction * mActionSimulate
Pointer to the generate action.
Definition main_window_layout.h:147
QAction * mActionExit
Pointer to the install plugin action.
Definition main_window_layout.h:114
QTabWidget * mCanvasPanel
Pointer to the central splitter.
Definition main_window_layout.h:77
QTabWidget * mPalette
Pointer to the main splitter.
Definition main_window_layout.h:59
QAction * mActionFitToScreen
Pointer to the reset zoom action.
Definition main_window_layout.h:130
QAction * mActionCopy
Pointer to the redo action.
Definition main_window_layout.h:121
QTabWidget * mPropertiesTab
Pointer to the file menu.
Definition main_window_layout.h:96
QSplitter * mMainSplitter
Pointer to the central widget.
Definition main_window_layout.h:56
ProcessTab * mProcessTab
Pointer to the info text browser.
Definition main_window_layout.h:86
A tab widget for displaying process output.
Definition process_tab.h:16
Menu used to edit the properties, fields, events and transitions of a node.
Definition properties_menu.h:52
A widget that represents a section with a collapsible content area.
Definition section.h:17
Definition frame.h:10
Tree widget used to display and manage flows and nodes in the system view.
Definition system_menu.h:24
Definition mission_parameter_widget.h:12
A widget providing a search input field with an icon and dismiss support.
Definition widget_factory.h:627
Definition type_editor.h:33
Contains UI helper widgets and layout grouping utilities used by MAKI.
Definition generator.h:10