Skip to content
This repository has been archived by the owner on Dec 14, 2021. It is now read-only.

Commit

Permalink
ui: move "Save Graph as Image..." up in "Edit" menu to keep "Preferen…
Browse files Browse the repository at this point in the history
…ces..." 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.
  • Loading branch information
mlangkabel authored Dec 31, 2020
1 parent a087ef9 commit d0f9056
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions src/lib_gui/qt/window/QtMainWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit d0f9056

Please sign in to comment.