From bd5548c7bc880f34b08c2fffa6070754c5492f1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ole-Andr=C3=A9=20Rodlie?= Date: Wed, 9 Oct 2024 16:21:11 +0200 Subject: [PATCH] UI/UX Stuff --- .../GUI/Settings/generalsettingswidget.cpp | 13 +++++---- src/app/GUI/Settings/generalsettingswidget.h | 2 +- src/app/GUI/mainwindow.cpp | 29 ++++++++++--------- src/app/icons | 2 +- 4 files changed, 24 insertions(+), 22 deletions(-) diff --git a/src/app/GUI/Settings/generalsettingswidget.cpp b/src/app/GUI/Settings/generalsettingswidget.cpp index a711baa79..5b72f9f1f 100644 --- a/src/app/GUI/Settings/generalsettingswidget.cpp +++ b/src/app/GUI/Settings/generalsettingswidget.cpp @@ -47,7 +47,7 @@ GeneralSettingsWidget::GeneralSettingsWidget(QWidget *parent) , mToolBarActionOpen(nullptr) , mToolBarActionImport(nullptr) , mToolBarActionSave(nullptr) - , mToolBarActionScene(nullptr) + //, mToolBarActionScene(nullptr) , mToolBarActionRender(nullptr) , mToolBarActionPreview(nullptr) , mToolBarActionExport(nullptr) @@ -181,7 +181,7 @@ void GeneralSettingsWidget::applySettings() mSett.fToolBarActionOpen = mToolBarActionOpen->isChecked(); mSett.fToolBarActionImport = mToolBarActionImport->isChecked(); mSett.fToolBarActionSave = mToolBarActionSave->isChecked(); - mSett.fToolBarActionScene = mToolBarActionScene->isChecked(); + //mSett.fToolBarActionScene = mToolBarActionScene->isChecked(); mSett.fToolBarActionRender = mToolBarActionRender->isChecked(); mSett.fToolBarActionPreview = mToolBarActionPreview->isChecked(); mSett.fToolBarActionExport = mToolBarActionExport->isChecked(); @@ -212,7 +212,7 @@ void GeneralSettingsWidget::updateSettings(bool restore) mToolBarActionOpen->setChecked(mSett.fToolBarActionOpen); mToolBarActionImport->setChecked(mSett.fToolBarActionImport); mToolBarActionSave->setChecked(mSett.fToolBarActionSave); - mToolBarActionScene->setChecked(mSett.fToolBarActionScene); + //mToolBarActionScene->setChecked(mSett.fToolBarActionScene); mToolBarActionRender->setChecked(mSett.fToolBarActionRender); mToolBarActionPreview->setChecked(mSett.fToolBarActionPreview); mToolBarActionExport->setChecked(mSett.fToolBarActionExport); @@ -255,15 +255,16 @@ void GeneralSettingsWidget::setupToolBarWidgets(QVBoxLayout *lay) mToolBarActionOpen = new QCheckBox(tr("Open"), this); mToolBarActionImport = new QCheckBox(tr("Import"), this); mToolBarActionSave = new QCheckBox(tr("Save"), this); - mToolBarActionScene = new QCheckBox(tr("Scene"), this); + //mToolBarActionScene = new QCheckBox(tr("Scene"), this); mToolBarActionRender = new QCheckBox(tr("Render"), this); mToolBarActionPreview = new QCheckBox(tr("Preview SVG"), this); mToolBarActionExport = new QCheckBox(tr("Export SVG"), this); containerInnerLayout->addPair(mToolBarActionNew, mToolBarActionOpen); containerInnerLayout->addPair(mToolBarActionImport, mToolBarActionSave); - containerInnerLayout->addPair(mToolBarActionScene, mToolBarActionRender); - containerInnerLayout->addPair(mToolBarActionPreview, mToolBarActionExport); + containerInnerLayout->addPair(mToolBarActionRender, mToolBarActionPreview); + containerInnerLayout->addWidgetToFirstColumn(mToolBarActionExport); + containerLayout->addStretch(); lay->addWidget(container); } diff --git a/src/app/GUI/Settings/generalsettingswidget.h b/src/app/GUI/Settings/generalsettingswidget.h index 6e5df31b3..a5f36b30f 100644 --- a/src/app/GUI/Settings/generalsettingswidget.h +++ b/src/app/GUI/Settings/generalsettingswidget.h @@ -53,7 +53,7 @@ class GeneralSettingsWidget : public SettingsWidget QCheckBox *mToolBarActionOpen; QCheckBox *mToolBarActionImport; QCheckBox *mToolBarActionSave; - QCheckBox *mToolBarActionScene; + //QCheckBox *mToolBarActionScene; QCheckBox *mToolBarActionRender; QCheckBox *mToolBarActionPreview; QCheckBox *mToolBarActionExport; diff --git a/src/app/GUI/mainwindow.cpp b/src/app/GUI/mainwindow.cpp index f4465fe23..8e9e80ebd 100644 --- a/src/app/GUI/mainwindow.cpp +++ b/src/app/GUI/mainwindow.cpp @@ -417,7 +417,7 @@ void MainWindow::setupMenuBar() mFileMenu = mMenuBar->addMenu(tr("File", "MenuBar")); - const auto newAct = mFileMenu->addAction(QIcon::fromTheme("file_blank"), + const auto newAct = mFileMenu->addAction(QIcon::fromTheme("file_new"), tr("New", "MenuBar_File"), this, &MainWindow::newFile, Qt::CTRL + Qt::Key_N); @@ -443,7 +443,7 @@ void MainWindow::setupMenuBar() mLinkedAct->setData(tr("Link File")); cmdAddAction(mLinkedAct); - mImportAct = mFileMenu->addAction(QIcon::fromTheme("file_blank"), + mImportAct = mFileMenu->addAction(QIcon::fromTheme("file_import"), tr("Import", "MenuBar_File"), this, qOverload<>(&MainWindow::importFile), Qt::CTRL + Qt::Key_I); @@ -457,7 +457,7 @@ void MainWindow::setupMenuBar() cmdAddAction(mImportSeqAct); if (eSettings::instance().fToolBarActionOpen) { - const auto loadToolBtn = new QToolButton(this); + /*const auto loadToolBtn = new QToolButton(this); loadToolBtn->setPopupMode(QToolButton::MenuButtonPopup); loadToolBtn->setToolButtonStyle(Qt::ToolButtonTextBesideIcon); loadToolBtn->setFocusPolicy(Qt::NoFocus); @@ -470,11 +470,8 @@ void MainWindow::setupMenuBar() loadToolMenu->addAction(mImportSeqAct); loadToolMenu->addMenu(mRecentMenu); - mToolbar->addWidget(loadToolBtn); - } - - if (eSettings::instance().fToolBarActionImport) { - mToolbar->addAction(mImportAct); + mToolbar->addWidget(loadToolBtn);*/ + mToolbar->addAction(openAct); } mRevertAct = mFileMenu->addAction(QIcon::fromTheme("loop_back"), @@ -520,7 +517,7 @@ void MainWindow::setupMenuBar() mPreviewSVGAct->setData(mPreviewSVGAct->toolTip()); cmdAddAction(mPreviewSVGAct); - mExportSVGAct = mFileMenu->addAction(QIcon::fromTheme("seq_preview"), + mExportSVGAct = mFileMenu->addAction(QIcon::fromTheme("output"), tr("Export SVG", "MenuBar_File"), this, &MainWindow::exportSVG, QKeySequence(AppSupport::getSettings("shortcuts", @@ -532,7 +529,7 @@ void MainWindow::setupMenuBar() cmdAddAction(mExportSVGAct); if (eSettings::instance().fToolBarActionSave) { - const auto saveToolBtn = new QToolButton(this); + /*const auto saveToolBtn = new QToolButton(this); saveToolBtn->setPopupMode(QToolButton::MenuButtonPopup); saveToolBtn->setToolButtonStyle(Qt::ToolButtonTextBesideIcon); saveToolBtn->setFocusPolicy(Qt::NoFocus); @@ -544,9 +541,13 @@ void MainWindow::setupMenuBar() saveToolMenu->addAction(mSaveAsAct); saveToolMenu->addAction(mSaveBackAct); //saveToolMenu->addAction(exportSvgAct); - saveToolMenu->addSeparator(); + saveToolMenu->addSeparator();*/ - mToolbar->addWidget(saveToolBtn); + mToolbar->addAction(mSaveAct); + } + + if (eSettings::instance().fToolBarActionImport) { + mToolbar->addAction(mImportAct); } mFileMenu->addSeparator(); @@ -937,7 +938,7 @@ void MainWindow::setupMenuBar() mAddToQueAct->setEnabled(false); cmdAddAction(mAddToQueAct); - if (eSettings::instance().fToolBarActionScene) { + /*if (eSettings::instance().fToolBarActionScene) { const auto sceneToolBtn = new QToolButton(this); sceneToolBtn->setText(tr("Scene")); sceneToolBtn->setIcon(QIcon::fromTheme("sequence")); @@ -958,7 +959,7 @@ void MainWindow::setupMenuBar() this, [sceneToolBtn]() { sceneToolBtn->setText(tr("Scene")); }); mToolbar->addWidget(sceneToolBtn); - } + }*/ const auto zoomMenu = mViewMenu->addMenu(QIcon::fromTheme("zoom"), tr("Zoom","MenuBar_View")); diff --git a/src/app/icons b/src/app/icons index ff6a18106..5d63b70a3 160000 --- a/src/app/icons +++ b/src/app/icons @@ -1 +1 @@ -Subproject commit ff6a18106dec3fc2575f5f8f464b7f7df5c98a86 +Subproject commit 5d63b70a3c101ee49a497fe6b1f4eeecff8230f2