Raise console window when it's open, but hidden behind other windows.

This commit is contained in:
Petr Mrázek 2014-03-24 01:54:18 +01:00
parent b60fbf87ab
commit 9617326cf8

View File

@ -186,6 +186,11 @@ void ConsoleWindow::toggleConsole()
QScrollBar *bar = ui->text->verticalScrollBar(); QScrollBar *bar = ui->text->verticalScrollBar();
if (isVisible()) if (isVisible())
{ {
if(!isActiveWindow())
{
activateWindow();
return;
}
int max_bar = bar->maximum(); int max_bar = bar->maximum();
int val_bar = m_last_scroll_value = bar->value(); int val_bar = m_last_scroll_value = bar->value();
m_scroll_active = (max_bar - val_bar) <= 1; m_scroll_active = (max_bar - val_bar) <= 1;
@ -194,6 +199,7 @@ void ConsoleWindow::toggleConsole()
else else
{ {
show(); show();
isTopLevel();
if (m_scroll_active) if (m_scroll_active)
{ {
bar->setValue(bar->maximum()); bar->setValue(bar->maximum());