Skip to content
Extraits de code Groupes Projets
Vérifiée Valider 2995f6b8 rédigé par Kubat's avatar Kubat
Parcourir les fichiers

UI: Discard the toolbars for now in the main window as it's ugly with the custom frameless window

parent e403566c
Aucune branche associée trouvée
Aucune étiquette associée trouvée
1 requête de fusion!10UI improvements
...@@ -26,18 +26,12 @@ ...@@ -26,18 +26,12 @@
#define DCL_MENU(menu, name) [[maybe_unused]] QMenu *menu##Menu = menuBar()->addMenu(name); #define DCL_MENU(menu, name) [[maybe_unused]] QMenu *menu##Menu = menuBar()->addMenu(name);
#define DCL_TOOLBAR(method, name) \
[[maybe_unused]] QToolBar *method##ToolBar = new QToolBar(tr(name), this); \
addToolBar(method##ToolBar);
#define DCL_ACTION(method, name, tip, menu) \ #define DCL_ACTION(method, name, tip, menu) \
[[maybe_unused]] QAction *method##Act = new QAction(tr(name), this); \ [[maybe_unused]] QAction *method##Act = new QAction(tr(name), this); \
method##Act->setStatusTip(tr(tip)); \ method##Act->setStatusTip(tr(tip)); \
menu##Menu->addAction(method##Act); \ menu##Menu->addAction(method##Act); \
connect(method##Act, &QAction::triggered, this, &MainWindow::method); connect(method##Act, &QAction::triggered, this, &MainWindow::method);
#define TOOLBAR_ADD_ACTION(toolbar, action) toolbar##ToolBar->addAction(action##Act);
#define ACTION_ADD_ICON(action, icon) action##Act->setIcon(QIcon::fromTheme(icon)); #define ACTION_ADD_ICON(action, icon) action##Act->setIcon(QIcon::fromTheme(icon));
#define ACTION_ADD_SHORTCUT(action, shortcut) action##Act->setShortcut(shortcut); #define ACTION_ADD_SHORTCUT(action, shortcut) action##Act->setShortcut(shortcut);
...@@ -54,8 +48,6 @@ MainWindow::MainWindow() noexcept ...@@ -54,8 +48,6 @@ MainWindow::MainWindow() noexcept
viewMenu = viewTmpMenu; // Save the view menu viewMenu = viewTmpMenu; // Save the view menu
DCL_MENU(simulate, "&Simulate"); DCL_MENU(simulate, "&Simulate");
DCL_MENU(help, "&Help"); DCL_MENU(help, "&Help");
DCL_TOOLBAR(file, "File");
DCL_TOOLBAR(other, "Other");
DCL_ACTION(newDocument, "&New document", "Create a new document", file); DCL_ACTION(newDocument, "&New document", "Create a new document", file);
DCL_ACTION(openDocument, "&Open document", "Open a document", file); DCL_ACTION(openDocument, "&Open document", "Open a document", file);
...@@ -78,12 +70,6 @@ MainWindow::MainWindow() noexcept ...@@ -78,12 +70,6 @@ MainWindow::MainWindow() noexcept
ACTION_ADD_SHORTCUT(openDocument, QKeySequence::Open); ACTION_ADD_SHORTCUT(openDocument, QKeySequence::Open);
ACTION_ADD_SHORTCUT(saveFile, QKeySequence::Save); ACTION_ADD_SHORTCUT(saveFile, QKeySequence::Save);
TOOLBAR_ADD_ACTION(file, newDocument);
TOOLBAR_ADD_ACTION(file, openDocument);
TOOLBAR_ADD_ACTION(file, saveFile);
TOOLBAR_ADD_ACTION(file, saveFileAs);
TOOLBAR_ADD_ACTION(other, openDialogHelp);
// Setup the tabs to display the documents // Setup the tabs to display the documents
documents = new QTabWidget(this); documents = new QTabWidget(this);
documents->setMovable(true); documents->setMovable(true);
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter