diff options
author | Petr Mrázek <peterix@gmail.com> | 2014-11-17 22:43:10 +0100 |
---|---|---|
committer | Petr Mrázek <peterix@gmail.com> | 2014-11-17 22:43:10 +0100 |
commit | f8bd68799451ec2a2a4c70248b6b5e7093636b2a (patch) | |
tree | 05b3ad5ef3acd9628793b97ecf3989a87de7338b | |
parent | fa8d3c564d152b98cad3ed1860bb99e75830b894 (diff) | |
download | MultiMC-f8bd68799451ec2a2a4c70248b6b5e7093636b2a.tar MultiMC-f8bd68799451ec2a2a4c70248b6b5e7093636b2a.tar.gz MultiMC-f8bd68799451ec2a2a4c70248b6b5e7093636b2a.tar.lz MultiMC-f8bd68799451ec2a2a4c70248b6b5e7093636b2a.tar.xz MultiMC-f8bd68799451ec2a2a4c70248b6b5e7093636b2a.zip |
NOISSUE Fix console window hiding
-rw-r--r-- | gui/ConsoleWindow.cpp | 22 |
1 files changed, 5 insertions, 17 deletions
diff --git a/gui/ConsoleWindow.cpp b/gui/ConsoleWindow.cpp index 9ea19478..e2d9db7e 100644 --- a/gui/ConsoleWindow.cpp +++ b/gui/ConsoleWindow.cpp @@ -22,6 +22,7 @@ #include <QHBoxLayout> #include <QPushButton> #include <qlayoutitem.h> +#include <QCloseEvent> #include <gui/Platform.h> #include <gui/dialogs/CustomMessageBox.h> @@ -170,7 +171,6 @@ void ConsoleWindow::setMayClose(bool mayclose) void ConsoleWindow::toggleConsole() { - //QScrollBar *bar = ui->text->verticalScrollBar(); if (isVisible()) { if(!isActiveWindow()) @@ -178,26 +178,11 @@ void ConsoleWindow::toggleConsole() activateWindow(); return; } - /* - int max_bar = bar->maximum(); - int val_bar = m_last_scroll_value = bar->value(); - m_scroll_active = (max_bar - val_bar) <= 1; - */ hide(); } else { show(); - /* - if (m_scroll_active) - { - bar->setValue(bar->maximum()); - } - else - { - bar->setValue(m_last_scroll_value); - } - */ } } @@ -206,6 +191,7 @@ void ConsoleWindow::closeEvent(QCloseEvent *event) if (!m_mayclose) { toggleConsole(); + event->ignore(); } else if(m_container->requestClose(event)) { @@ -214,7 +200,7 @@ void ConsoleWindow::closeEvent(QCloseEvent *event) emit isClosing(); m_trayIcon->hide(); - QMainWindow::closeEvent(event); + event->accept(); } } @@ -246,7 +232,9 @@ void ConsoleWindow::onEnded(InstancePtr instance, int code, QProcess::ExitStatus } } if (!isVisible()) + { show(); + } // Raise Window if (MMC->settings()->get("RaiseConsole").toBool()) { |