ui: move "Save Graph as Image..." up in "Edit" menu to keep "Preferences..." at the bottom (#1124)

This is done because users may already be used to "preferences" being the bottom-most button and may accidentally click "Save Graph as Image..." when they actually want to open the preferences screen.
This commit is contained in:
Malte Langkabel
2020-12-31 18:39:07 +01:00
committed by GitHub
parent a087ef9454
commit d0f9056f15
+14 -6
View File
@@ -33,12 +33,12 @@
#include "MessageRefresh.h"
#include "MessageRefreshUI.h"
#include "MessageResetZoom.h"
#include "MessageSaveAsImage.h"
#include "MessageTabClose.h"
#include "MessageTabOpen.h"
#include "MessageTabSelect.h"
#include "MessageWindowClosed.h"
#include "MessageZoom.h"
#include "MessageSaveAsImage.h"
#include "QtAbout.h"
#include "QtContextMenu.h"
#include "QtFileDialog.h"
@@ -713,8 +713,8 @@ void QtMainWindow::forceRefresh()
void QtMainWindow::saveAsImage()
{
QString filePath = QtFileDialog::showSaveFileDialog(this, tr("Save as Image"), FilePath(),
"PNG (*.png);;JPEG (*.JPEG);;BMP Files (*.bmp)");
QString filePath = QtFileDialog::showSaveFileDialog(
this, tr("Save as Image"), FilePath(), "PNG (*.png);;JPEG (*.JPEG);;BMP Files (*.bmp)");
if (filePath.isNull())
{
return;
@@ -933,13 +933,19 @@ void QtMainWindow::setupEditMenu()
menu->addSeparator();
menu->addAction(
tr("&Save Graph as Image..."),
this,
&QtMainWindow::saveAsImage,
QKeySequence(Qt::SHIFT + Qt::CTRL + Qt::Key_S));
menu->addSeparator();
menu->addAction(
tr("Preferences..."),
this,
&QtMainWindow::openSettings,
QKeySequence(Qt::CTRL + Qt::Key_Comma));
menu->addAction(tr("&Save as Image"), this, &QtMainWindow::saveAsImage, QKeySequence(Qt::SHIFT + Qt::CTRL + Qt::Key_S));
}
void QtMainWindow::setupViewMenu()
@@ -1150,7 +1156,9 @@ void QtMainWindow::setShowDockWidgetTitleBars(bool showTitleBars)
{
if (showTitleBars)
{
dock.widget->setFeatures(QDockWidget::DockWidgetClosable | QDockWidget::DockWidgetMovable | QDockWidget::DockWidgetFloatable);
dock.widget->setFeatures(
QDockWidget::DockWidgetClosable | QDockWidget::DockWidgetMovable |
QDockWidget::DockWidgetFloatable);
dock.widget->setTitleBarWidget(nullptr);
}
else