Skip to content

Commit

Permalink
Client|UI: Adjusted task bar and console behavior
Browse files Browse the repository at this point in the history
Based on feedback, Esc now opens just the menu. Shift-Esc will open
just the task bar (focusing the console command line). Shift-Esc will
then dismiss the taskbar+console completely, while a plain Esc will
first close the console and then another press will hide the task bar.
  • Loading branch information
skyjake committed Jun 11, 2013
1 parent b754c89 commit 2548d1d
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 20 deletions.
16 changes: 2 additions & 14 deletions doomsday/client/src/ui/clientwindow.cpp
Expand Up @@ -105,22 +105,10 @@ DENG2_OBSERVES(Canvas, FocusChange)
.setInput(Rule::Width, root.viewWidth());
root.add(taskBar);

/*
Rule const &unit = ClientApp::windowSystem().style().rules().rule("unit");
console = new ConsoleWidget;
console->rule()
.setInput(Rule::Bottom, taskBar->rule().top() - unit)
.setInput(Rule::Left, root.viewLeft() + console->shift());
root.add(console);
*/

#if 0
taskBar->setOpeningAction(new CommandAction("menu open"));
taskBar->setClosingAction(new CommandAction("menu close"));

//connect(taskBar, SIGNAL(opened()), console, SLOT(clearLog()));
//connect(taskBar, SIGNAL(opened()), console, SLOT(open()));
//connect(taskBar, SIGNAL(closed()), console, SLOT(close()));
#endif

root.setFocus(&taskBar->commandLine());

Expand Down
22 changes: 16 additions & 6 deletions doomsday/client/src/ui/widgets/taskbarwidget.cpp
Expand Up @@ -285,21 +285,22 @@ bool TaskBarWidget::handleEvent(Event const &event)
{
KeyEvent const &key = event.as<KeyEvent>();

// Esc opens and closes the task bar.
// Shift-Esc opens and closes the task bar.
if(key.ddKey() == DDKEY_ESCAPE)
{
#if 0
// Shift-Esc opens the console.
if(key.modifiers().testFlag(KeyEvent::Shift))
if()
{
root().setFocus(&d->console->commandLine());
if(!isOpen()) open(false /* no action */);
return true;
}

#endif
if(isOpen())
{
// First press of Esc will just dismiss the console.
if(d->console->isLogOpen())
if(d->console->isLogOpen() && !key.modifiers().testFlag(KeyEvent::Shift))
{
d->console->commandLine().setText("");
d->console->closeLog();
Expand All @@ -308,12 +309,21 @@ bool TaskBarWidget::handleEvent(Event const &event)
}
// Also closes the console log.
close();
return true;
}
else
{
open();
if(key.modifiers().testFlag(KeyEvent::Shift) ||
!App_GameLoaded())
{
// Automatically focus the command line.
root().setFocus(&d->console->commandLine());

open();
return true;
}
}
return true;
return false;
}
}
return false;
Expand Down

0 comments on commit 2548d1d

Please sign in to comment.