[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-bugs-dist
Subject: [Bug 58247] Can't tab out of a text box
From: Germain Garand <germain () ebooksfrance ! com>
Date: 2005-02-20 17:37:11
Message-ID: 20050220173711.18113.qmail () ktown ! kde ! org
[Download RAW message or body]
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.
http://bugs.kde.org/show_bug.cgi?id=58247
germain ebooksfrance com changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|REOPENED |RESOLVED
Resolution| |FIXED
------- Additional Comments From germain ebooksfrance com 2005-02-20 18:37 -------
CVS commit by ggarand:
fix tab handling in textareas.
BUG: 58247
M +9 -0 ChangeLog 1.386
M +17 -10 html/html_formimpl.cpp 1.421
M +5 -1 rendering/render_replaced.cpp 1.184
--- kdelibs/khtml/ChangeLog #1.385:1.386
@ -1,2 +1,11 @
+2005-02-20 Germain Garand <germain ebooksfrance org>
+
+ * html/html_formimpl.cpp (FocusHandleWidget::focusNextPrev): TextEdit
+ needs to use QWidget::focusNextPrevChild.
+ (defaultEventHandler): only handle key tab if it wasn't accepted by the \
widget (#58247) +
+ * rendering/render_replaced.cpp (RenderWidget::handleEvent): return
+ something meaningful.
+
2005-02-18 Germain Garand <germain ebooksfrance org>
--- kdelibs/khtml/html/html_formimpl.cpp #1.420:1.421
@ -903,5 +903,6 @ class FocusHandleWidget : public QWidget
public:
void focusNextPrev(bool n) {
- focusNextPrevChild(n);
+ if (!focusNextPrevChild(n) && inherits("QTextEdit"))
+ QWidget::focusNextPrevChild(n);
}
};
@ -952,12 +953,18 @ void HTMLGenericFormElementImpl::default
}
- if (evt->id() == EventImpl::KHTML_KEYPRESS_EVENT) {
- TextEventImpl* const k = static_cast<TextEventImpl *>(evt);
- const int key = k->qKeyEvent() ? k->qKeyEvent()->key() : 0;
- if (m_render && (key == Qt::Key_Tab || key == Qt::Key_BackTab)) {
+ if (!evt->defaultHandled() && m_render && m_render->isWidget()) {
+ // handle tabbing out, either from a single or repeated key event.
+ // ### FIXME this is needlessly complicated by our internal \
KHTML_KEYPRESS_EVENT. + // What is it good for? It should be renamed and \
only emitted in case of a repeat. -gg + if ( evt->id() == \
EventImpl::KEYDOWN_EVENT || evt->id() == EventImpl::KHTML_KEYPRESS_EVENT ) { + \
QKeyEvent* const k = static_cast<TextEventImpl *>(evt)->qKeyEvent(); + \
if ( k && (k->key() == Qt::Key_Tab || k->key() == Qt::Key_BackTab) && + \
(evt->id() == EventImpl::KEYDOWN_EVENT || k->isAutoRepeat()) ) {
QWidget* const widget = \
static_cast<RenderWidget*>(m_render)->widget(); if (widget)
static_cast<FocusHandleWidget *>(widget)
- ->focusNextPrev(key == Qt::Key_Tab);
+ ->focusNextPrev(k->key() == Qt::Key_Tab);
+ evt->setDefaultHandled();
+ }
}
}
--- kdelibs/khtml/rendering/render_replaced.cpp #1.183:1.184
@ -679,4 +679,5 @ void RenderWidget::EventPropagator::send
bool RenderWidget::handleEvent(const DOM::EventImpl& ev)
{
+ bool ret = false;
switch(ev.id()) {
case EventImpl::MOUSEDOWN_EVENT:
@ -742,4 +743,5 @ bool RenderWidget::handleEvent(const DOM
QMouseEvent e(type, p, button, state);
static_cast<EventPropagator *>(m_widget)->sendEvent(&e);
+ ret = e.isAccepted();
break;
}
@ -749,4 +751,5 @ bool RenderWidget::handleEvent(const DOM
if (ke)
static_cast<EventPropagator *>(m_widget)->sendEvent(ke);
+ ret = ke->isAccepted();
break;
}
@ -769,4 +772,5 @ bool RenderWidget::handleEvent(const DOM
static_cast<EventPropagator *>(m_widget)->sendEvent(&releaseEv);
static_cast<EventPropagator *>(m_widget)->sendEvent(ke);
+ ret = ke->isAccepted();
}
@ -787,5 +791,5 @ bool RenderWidget::handleEvent(const DOM
break;
}
- return true;
+ return ret;
}
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic