summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2019-07-16 01:30:09 +0200
committerPetr Mrázek <peterix@gmail.com>2019-07-16 01:30:09 +0200
commit2eec1df1a026eafcdcd4bcc2a4ae90f795c1f71b (patch)
treee565870ce4129e3f3534ea9e76d4c5db8da99694
parent6fde775b9017401351425186deffd685827df3d3 (diff)
downloadMultiMC-2eec1df1a026eafcdcd4bcc2a4ae90f795c1f71b.tar
MultiMC-2eec1df1a026eafcdcd4bcc2a4ae90f795c1f71b.tar.gz
MultiMC-2eec1df1a026eafcdcd4bcc2a4ae90f795c1f71b.tar.lz
MultiMC-2eec1df1a026eafcdcd4bcc2a4ae90f795c1f71b.tar.xz
MultiMC-2eec1df1a026eafcdcd4bcc2a4ae90f795c1f71b.zip
NOISSUE hide main toolbar toggle action instead of working around it
-rw-r--r--application/MainWindow.cpp14
-rw-r--r--application/MainWindow.h5
2 files changed, 10 insertions, 9 deletions
diff --git a/application/MainWindow.cpp b/application/MainWindow.cpp
index 00f95fca..4d143143 100644
--- a/application/MainWindow.cpp
+++ b/application/MainWindow.cpp
@@ -828,6 +828,13 @@ MainWindow::~MainWindow()
{
}
+QMenu * MainWindow::createPopupMenu()
+{
+ QMenu* filteredMenu = QMainWindow::createPopupMenu();
+ filteredMenu->removeAction( ui->mainToolBar->toggleViewAction() );
+ return filteredMenu;
+}
+
void MainWindow::konamiTriggered()
{
// ENV.enableFeature("NewModsPage");
@@ -1654,13 +1661,6 @@ void MainWindow::on_actionAbout_triggered()
dialog.exec();
}
-void MainWindow::on_mainToolBar_visibilityChanged(bool)
-{
- // Don't allow hiding the main toolbar.
- // This is the only way I could find to prevent it... :/
- ui->mainToolBar->setVisible(true);
-}
-
void MainWindow::on_actionDeleteInstance_triggered()
{
if (!m_selectedInstance)
diff --git a/application/MainWindow.h b/application/MainWindow.h
index 69ea7c6b..a415b5e8 100644
--- a/application/MainWindow.h
+++ b/application/MainWindow.h
@@ -60,6 +60,9 @@ public:
signals:
void isClosing();
+protected:
+ QMenu * createPopupMenu() override;
+
private slots:
void onCatToggled(bool);
@@ -109,8 +112,6 @@ private slots:
void newsButtonClicked();
- void on_mainToolBar_visibilityChanged(bool);
-
void on_actionLaunchInstance_triggered();
void on_actionLaunchInstanceOffline_triggered();