Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
UI|Console|Client: Console log is closed when command line loses focus
Makes it easier to dismiss the log, and makes the view less cluttered
when accessing non-console related parts of the UI.
  • Loading branch information
skyjake committed Aug 20, 2013
1 parent f16e47c commit cd6966b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion doomsday/client/include/ui/widgets/consolewidget.h
Expand Up @@ -69,7 +69,7 @@ public slots:
void clearLog();
void showFullLog();
void setFullyOpaque();
void setTranslucent();
void commandLineFocusLost();
void focusOnCommandLine();
void openMenu();
void closeMenu();
Expand Down
5 changes: 3 additions & 2 deletions doomsday/client/src/ui/widgets/consolewidget.cpp
Expand Up @@ -229,7 +229,7 @@ ConsoleWidget::ConsoleWidget() : GuiWidget("console"), d(new Instance(this))

// Signals.
connect(d->cmdLine, SIGNAL(gotFocus()), this, SLOT(setFullyOpaque()));
connect(d->cmdLine, SIGNAL(lostFocus()), this, SLOT(setTranslucent()));
connect(d->cmdLine, SIGNAL(lostFocus()), this, SLOT(commandLineFocusLost()));
}

ButtonWidget &ConsoleWidget::button()
Expand Down Expand Up @@ -403,10 +403,11 @@ void ConsoleWidget::setFullyOpaque()
d->cmdLine->setOpacity(1, .25f);
}

void ConsoleWidget::setTranslucent()
void ConsoleWidget::commandLineFocusLost()
{
d->button->setOpacity(.75f, .25f);
d->cmdLine->setOpacity(.75f, .25f);
closeLog();
}

void ConsoleWidget::focusOnCommandLine()
Expand Down
1 change: 1 addition & 0 deletions doomsday/client/src/ui/widgets/dialogwidget.cpp
Expand Up @@ -291,6 +291,7 @@ int DialogWidget::exec(GuiRootWidget &root)
// The widget is added to the root temporarily (as top child).
DENG2_ASSERT(!hasRoot());
root.add(this);
root.setFocus(0);

prepare();

Expand Down

0 comments on commit cd6966b

Please sign in to comment.