Commit d95ff803 authored by hausmann@webkit.org's avatar hausmann@webkit.org

Simon Hausmann <hausmann@webkit.org>

Update the micro focus for input methods as soon as the composition mode changes
or the caret/selection changes.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@31906 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 1c26006e
......@@ -1766,7 +1766,16 @@ QWebFrame *QWebPageContext::targetFrame() const
/*!
\fn void QWebPage::download(const QNetworkRequest &request)
This signals is emitted when the user decides to download a link.
This signal is emitted when the user decides to download a link.
*/
/*!
\fn void QWebPage::microFocusChanged()
This signal is emitted when for example the position of the cursor in an editable form
element changes. It is used inform input methods about the new on-screen position where
the user is able to enter text. This signal is usually connected to QWidget's updateMicroFocus()
slot.
*/
#include "moc_qwebpage.cpp"
......@@ -218,6 +218,8 @@ Q_SIGNALS:
//QHash<QString, QWidget *> embeddableWidgets() const;
//void clearEmbeddableWidgets();
void microFocusChanged();
protected:
virtual QWebPage *createWindow();
virtual QWebPage *createModalDialog();
......
......@@ -123,6 +123,9 @@ void QWebView::setPage(QWebPage *page)
this, SIGNAL(loadProgressChanged(int)));
connect(d->page, SIGNAL(statusBarTextChanged(const QString &)),
this, SIGNAL(statusBarTextChanged(const QString &)));
connect(d->page, SIGNAL(microFocusChanged()),
this, SLOT(updateMicroFocus()));
}
update();
}
......
2008-04-15 Simon Hausmann <hausmann@webkit.org>
Reviewed by Holger.
Update the micro focus for input methods as soon as the composition mode changes
or the caret/selection changes.
* Api/qwebpage.cpp:
* Api/qwebpage.h:
* Api/qwebview.cpp:
(QWebView::setPage):
* WebCoreSupport/EditorClientQt.cpp:
(WebCore::EditorClientQt::respondToChangedSelection):
(WebCore::EditorClientQt::setInputMethodState):
2008-04-15 Simon Hausmann <hausmann@webkit.org>
Reviewed by Holger.
......
......@@ -218,6 +218,7 @@ void EditorClientQt::respondToChangedSelection()
m_page->d->updateEditorActions();
emit m_page->selectionChanged();
emit m_page->microFocusChanged();
}
void EditorClientQt::didEndEditing()
......@@ -545,8 +546,10 @@ bool EditorClientQt::isEditing() const
void EditorClientQt::setInputMethodState(bool active)
{
QWidget *view = m_page->view();
if (view)
if (view) {
view->setAttribute(Qt::WA_InputMethodEnabled, active);
emit m_page->microFocusChanged();
}
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment