Maki
Formally verified 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;
36class EditorWorkspace;
37} // namespace maki
38
42class MainWindowLayout : public QMainWindow
43{
44 Q_OBJECT
45
46public:
52 explicit MainWindowLayout(QWidget* parent = nullptr);
53
54protected:
55 // === Main ===
56 QWidget* mCentralWidget;
57 QSplitter* mMainSplitter;
58
59 // === Left Panel ===
60 QTabWidget* mPalette;
62 QScrollArea* mStructureScrollArea;
63
65 QScrollArea* mBehaviourScrollArea;
66
68 QScrollArea* mPipelineScrollArea;
69
71 QSplitter* mLeftPanel;
72
73 // === Central Panel ===
75 oclero::qlementine::LoadingSpinner* mGenerationSpinner;
76
77 QSplitter* mCentralSplitter;
79 QPushButton* mBrowserTabButton;
80
81 // BadgedTabWidget* mBottomPanel;
83 QStackedWidget* mBottomPanel;
84 oclero::qlementine::NavigationBar* mBottomNavigation;
86 QTextBrowser* mInfoText;
89 maki::TypeEditor* mTypeEditor;
90
91 // === Right Panel ===
92 QSplitter* mRightPanel;
93 QTabWidget* mNavigationTab;
96
97 QTabWidget* mPropertiesTab;
99
100 // === Menu Bar ===
101 QMenuBar* mMenuBar;
102
103 // === Actions ===
104 // File menu
105 QAction* mActionNew;
107 QAction* mActionOpen;
109 QAction* mActionSave;
110 QAction* mActionSaveAs;
111
114
115 QAction* mActionExit;
116
117 // Edit menu
118 QUndoGroup* mUndoGroup;
119 QAction* mActionUndo;
120 QAction* mActionRedo;
121
122 QAction* mActionCopy;
123 QAction* mActionPaste;
124 QAction* mActionCut;
125 QAction* mActionDelete;
126
127 // View menu
128 QAction* mActionZoomIn;
129 QAction* mActionZoomOut;
133
136 QAction* mOpenInfoPanel;
137
139
140 // Diagram menu
143 QAction* mActionAlignV;
144 QAction* mActionAlignH;
145 QAction* mActionDistribute;
146
147 QAction* mActionGenerate;
150 QAction* mActionToggleSnapToGrid;
151
152 // Help menu
153 QAction* mActionDocumentation;
158 QAction* mAboutAction;
159
160 int INFO_TAB = 0;
165 QString DEFAULT_TEMPLATE = "";
166
167protected:
171 void onLanguageChanged();
172
178 void toggleGenerationButton(bool running);
179
180 virtual void onActionNew(const QString& templatePath);
181
182private:
183 QList<TranslatableWidget> mTranslatable;
184
188 void buildMainWindow();
189
193 void buildLeftPanel();
194
198 void buildCentralPanel();
199
203 void buildRightPanel();
204
208 void buildMenuBar();
209
213 void applyTheme();
214
223 QWidget* createHeaderComboBox(QComboBox* comboBox, const QString& iconPath, const QString& tooltip);
224
231 void togglePanelVisibility(QWidget* panel, QAction* action);
232
242 int setTabBarWidth(QTabBar* bar, int minWidth, int minBorder, int minPadding);
243};
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:112
QMenu * mSpecialTabsMenu
Pointer to the open info panel action.
Definition main_window_layout.h:138
QAction * mActionOpen
Pointer to the new from template action.
Definition main_window_layout.h:107
MainWindowLayout(QWidget *parent=nullptr)
Constructs a new MainWindowLayout object.
Definition main_window_layout.cpp:44
QAction * mActionZoomIn
Pointer to the delete action.
Definition main_window_layout.h:128
QAction * mActionZoomOut
Pointer to the zoom in action.
Definition main_window_layout.h:129
int setTabBarWidth(QTabBar *bar, int minWidth, int minBorder, int minPadding)
Sets the minimum width for a tab bar.
Definition main_window_layout.cpp:739
void buildCentralPanel()
Builds the central panel.
Definition main_window_layout.cpp:210
maki::MissionParameterWidget * mMissionParameters
Pointer to the process tab.
Definition main_window_layout.h:88
QMenu * mGeneratorMenu
Pointer to the special tabs menu.
Definition main_window_layout.h:141
QPushButton * mBrowserTabButton
Pointer to the canvas/editor workspace widget.
Definition main_window_layout.h:79
QAction * mActionRedo
Pointer to the undo action.
Definition main_window_layout.h:120
StyledFrame * mStructureTab
Pointer to the palette tab widget.
Definition main_window_layout.h:61
QAction * mActionToggleGrid
Pointer to the simulate action.
Definition main_window_layout.h:149
QAction * mActionUndo
Pointer to the undo group.
Definition main_window_layout.h:119
QScrollArea * mStructureScrollArea
Pointer to the structure tab frame.
Definition main_window_layout.h:62
void applyTheme()
Applies the current theme.
Definition main_window_layout.cpp:762
QAction * mActionToggleToasts
Pointer to the fit to screen action.
Definition main_window_layout.h:132
PropertiesMenu * mPropertiesMenu
Pointer to the properties tab widget.
Definition main_window_layout.h:98
maki::EditorWorkspace * mEditorWorkspace
Pointer to the central splitter.
Definition main_window_layout.h:78
QString DEFAULT_TEMPLATE
Index of the type editor tab.
Definition main_window_layout.h:165
int LOG_TAB_INDEX
Index of the info tab.
Definition main_window_layout.h:161
void togglePanelVisibility(QWidget *panel, QAction *action)
Toggles the visibility of a panel based on an action.
Definition main_window_layout.cpp:936
int INFO_TAB
Pointer to the about action.
Definition main_window_layout.h:160
QAction * mActionQuickStartGuide
Pointer to the documentation action.
Definition main_window_layout.h:154
oclero::qlementine::LoadingSpinner * mGenerationSpinner
Pointer to the generator option combo box.
Definition main_window_layout.h:75
QAction * mActionDelete
Pointer to the cut action.
Definition main_window_layout.h:125
ExecuteButton * mPipelineRun
Pointer to the left panel splitter.
Definition main_window_layout.h:74
GeneratedFilesPanel * mFileMenu
Pointer to the system menu.
Definition main_window_layout.h:95
oclero::qlementine::NavigationBar * mBottomNavigation
Pointer to the bottom panel stacked widget.
Definition main_window_layout.h:84
SystemMenu * mSystemMenu
Pointer to the navigation tab widget.
Definition main_window_layout.h:94
QAction * mActionNewFromTemplate
Pointer to the new action.
Definition main_window_layout.h:106
QAction * mActionReportIssue
Pointer to the shortcuts action.
Definition main_window_layout.h:157
QAction * mActionShortcuts
Pointer to the open all settings action.
Definition main_window_layout.h:156
QAction * mOpenPropertiesPanel
Pointer to the open components panel action.
Definition main_window_layout.h:135
int TYPE_EDITOR_INDEX
Index of the mission parameter tab.
Definition main_window_layout.h:164
QAction * mOpenInfoPanel
Pointer to the open properties panel action.
Definition main_window_layout.h:136
void onLanguageChanged()
Handles language changed event.
Definition main_window_layout.cpp:851
QAction * mActionNew
Pointer to the menu bar.
Definition main_window_layout.h:105
QWidget * mBottomContainer
Pointer to the browser tab button.
Definition main_window_layout.h:82
void buildRightPanel()
Builds the right panel.
Definition main_window_layout.cpp:430
QAction * mActionSave
Pointer to the open recent menu.
Definition main_window_layout.h:109
QMenu * mActionOpenRecent
Pointer to the open action.
Definition main_window_layout.h:108
QAction * mActionCut
Pointer to the paste action.
Definition main_window_layout.h:124
QMenuBar * mMenuBar
Pointer to the properties menu.
Definition main_window_layout.h:101
QAction * mActionResetZoom
Pointer to the zoom out action.
Definition main_window_layout.h:130
QSplitter * mLeftPanel
Pointer to the palette search widget.
Definition main_window_layout.h:71
QAction * mOpenComponentsPanel
Pointer to the minimize notification toasts action.
Definition main_window_layout.h:134
QAction * mActionInstallPlugin
Pointer to the import library action.
Definition main_window_layout.h:113
int PROCESS_TAB_INDEX
Index of the log tab.
Definition main_window_layout.h:162
QSplitter * mCentralSplitter
Pointer to the generation spinner.
Definition main_window_layout.h:77
StyledFrame * mBehaviourTab
Pointer to the structure scroll area.
Definition main_window_layout.h:64
void buildMainWindow()
List of translatable widgets.
Definition main_window_layout.cpp:50
QScrollArea * mPipelineScrollArea
Pointer to the pipeline tab frame.
Definition main_window_layout.h:68
QTextBrowser * mInfoText
Pointer to the log table widget.
Definition main_window_layout.h:86
QAction * mActionPaste
Pointer to the copy action.
Definition main_window_layout.h:123
void toggleGenerationButton(bool running)
Toggles the generation button state.
Definition main_window_layout.cpp:913
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:890
QAction * mOpenAllSettings
Pointer to the quick start guide action.
Definition main_window_layout.h:155
StyledFrame * mPipelineTab
Pointer to the behaviour scroll area.
Definition main_window_layout.h:67
QTabWidget * mNavigationTab
Pointer to the right panel splitter.
Definition main_window_layout.h:93
void buildLeftPanel()
Builds the left panel.
Definition main_window_layout.cpp:86
QScrollArea * mBehaviourScrollArea
Pointer to the behaviour tab frame.
Definition main_window_layout.h:65
QUndoGroup * mUndoGroup
Pointer to the exit action.
Definition main_window_layout.h:118
QAction * mAboutAction
Pointer to the report issue action.
Definition main_window_layout.h:158
void buildMenuBar()
Builds the menu bar.
Definition main_window_layout.cpp:486
QAction * mActionAutoRoute
Pointer to the generator menu.
Definition main_window_layout.h:142
int MISSION_PARAMETER_INDEX
Index of the process tab.
Definition main_window_layout.h:163
LogTableWidget * mLogTable
Pointer to the bottom navigation bar.
Definition main_window_layout.h:85
maki::SearchWidget * mPaletteSearch
Pointer to the pipeline scroll area.
Definition main_window_layout.h:70
QAction * mActionSaveAs
Pointer to the save action.
Definition main_window_layout.h:110
QAction * mActionSimulate
Pointer to the generate action.
Definition main_window_layout.h:148
QAction * mActionExit
Pointer to the install plugin action.
Definition main_window_layout.h:115
QTabWidget * mPalette
Pointer to the main splitter.
Definition main_window_layout.h:60
QAction * mActionFitToScreen
Pointer to the reset zoom action.
Definition main_window_layout.h:131
QAction * mActionCopy
Pointer to the redo action.
Definition main_window_layout.h:122
QTabWidget * mPropertiesTab
Pointer to the file menu.
Definition main_window_layout.h:97
QSplitter * mMainSplitter
Pointer to the central widget.
Definition main_window_layout.h:57
ProcessTab * mProcessTab
Pointer to the info text browser.
Definition main_window_layout.h:87
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:29
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:23
Definition editor_workspace.h:27
Definition mission_parameter_widget.h:11
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 macros.h:9