From 33ca5716dd3bb93caf87bce65de15986dde86c63 Mon Sep 17 00:00:00 2001 From: deva Date: Fri, 11 Mar 2011 13:41:42 +0000 Subject: Huge improvements on 'keyboard-only' use. --- client/macrowindow.cc | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'client/macrowindow.cc') diff --git a/client/macrowindow.cc b/client/macrowindow.cc index ca76b46..d96facb 100644 --- a/client/macrowindow.cc +++ b/client/macrowindow.cc @@ -37,6 +37,7 @@ #include "widgets/window.h" #include "lua.h" #include "mainwindow.h" +#include "macrodrawer.h" #include "debug.h" @@ -47,9 +48,11 @@ extern QString user; MacroWindow::MacroWindow(NetCom &n, QString templ, bool is_static, bool compact, - QScrollArea *scrollarea) + QScrollArea *scrollarea, + MacroDrawer *d) : Collapser(NULL, compact?NULL:scrollarea), netcom(n) { + drawer = d; this->is_static = is_static; DEBUG(macrowindow, "Constructor %p\n", this); @@ -267,6 +270,7 @@ void MacroWindow::clear() if(mainwidget) { delete mainwidget; mainwidget = NULL; + drawer->setFocus(); } } @@ -283,15 +287,20 @@ void MacroWindow::animated(QWidget *w) waschanged = false; mainwidget->setValues(); + if(is_static) return; + + printf("SetFocus:\n"); // Set keyboard focus on the first focusable widget in the macro. QVector< Widget* > widgets; widgets = mainwidget->widgetList(true); QVector< Widget* >::iterator i = widgets.begin(); while(i != widgets.end()) { Widget *w = *i; + if(w) { + printf("\t%s\n", w->type().toStdString().c_str()); + } if(w && w->setKeyboardFocus()) break; i++; } - } } -- cgit v1.2.3