From f8bd68799451ec2a2a4c70248b6b5e7093636b2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Mr=C3=A1zek?= Date: Mon, 17 Nov 2014 22:43:10 +0100 Subject: NOISSUE Fix console window hiding --- gui/ConsoleWindow.cpp | 22 +++++----------------- 1 file changed, 5 insertions(+), 17 deletions(-) (limited to 'gui/ConsoleWindow.cpp') 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 #include #include +#include #include #include @@ -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()) { -- cgit v1.2.3