Changeset 35558
- Timestamp:
- 08/05/08 06:40:57 (4 months ago)
- Location:
- trunk/WebKit/qt
- Files:
-
- 4 modified
-
Api/qwebpage.cpp (modified) (4 diffs)
-
Api/qwebpage.h (modified) (1 diff)
-
ChangeLog (modified) (1 diff)
-
WebCoreSupport/EditorClientQt.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebKit/qt/Api/qwebpage.cpp
r35537 r35558 155 155 0, // InspectElement, 156 156 157 "InsertNewline", // InsertParagraphSeparator 158 "InsertLineBreak", // InsertLineSeparator 159 157 160 0 // WebActionCount 158 161 }; … … 593 596 QKeySequence::StandardKey standardKey; 594 597 QWebPage::WebAction action; 595 } editorActions[ 32] = {598 } editorActions[] = { 596 599 { QKeySequence::Cut, QWebPage::Cut }, 597 600 { QKeySequence::Copy, QWebPage::Copy }, … … 625 628 { QKeySequence::DeleteStartOfWord, QWebPage::DeleteStartOfWord }, 626 629 { QKeySequence::DeleteEndOfWord, QWebPage::DeleteEndOfWord }, 630 #if QT_VERSION >= 0x040500 631 { QKeySequence::InsertParagraphSeparator, QWebPage::InsertParagraphSeparator }, 632 { QKeySequence::InsertLineSeparator, QWebPage::InsertLineSeparator }, 633 #endif 627 634 { QKeySequence::UnknownKey, QWebPage::NoWebAction } 628 635 }; … … 1043 1050 \value ToggleUnderline Toggle underlining. 1044 1051 \value InspectElement Show the Web Inspector with the currently highlighted HTML element. 1052 \value InsertParagraphSeparator Insert a new paragraph. 1053 \value InsertLineSeparator Insert a new line. 1045 1054 \omitvalue WebActionCount 1046 1055 -
trunk/WebKit/qt/Api/qwebpage.h
r34738 r35558 143 143 InspectElement, 144 144 145 InsertParagraphSeparator, 146 InsertLineSeparator, 147 145 148 WebActionCount 146 149 }; -
trunk/WebKit/qt/ChangeLog
r35537 r35558 1 2008-08-05 Tor Arne VestbÞ <tavestbo@trolltech.com> 2 3 Reviewed by Simon. 4 5 Move event handling of the return-key from EditorClientQt to QWebPage. 6 7 https://bugs.webkit.org/show_bug.cgi?id=20191 8 9 This is a first step in refactoring the big switch block 10 in EditorClientQt::handleKeyboardEvent to using WebActions 11 instead. 12 13 The new logic uses two new StandardKeys from QKeySequence: 14 15 - InsertParagraphSeparator 16 - InsertLineSeparator 17 18 Which translate to the commands InsertNewline and InsertLineBreak 19 respectivly. On Windows/X11 pressing the shift modifier will invoke 20 the latter action. For Mac this is triggered by pressing the meta 21 modifier (Ctrl). 22 23 Initial patch by: Erik Bunce 24 25 * Api/qwebpage.cpp: 26 (editorActionForKeyEvent): 27 * Api/qwebpage.h: 28 * WebCoreSupport/EditorClientQt.cpp: 29 (WebCore::EditorClientQt::handleKeyboardEvent): 30 1 31 2008-08-04 Erik Bunce <elbunce@thehive.com> 2 32 -
trunk/WebKit/qt/WebCoreSupport/EditorClientQt.cpp
r35481 r35558 345 345 if (start->isContentEditable()) { 346 346 switch (kevent->windowsVirtualKeyCode()) { 347 #if QT_VERSION < 0x040500 347 348 case VK_RETURN: 348 frame->editor()->command("InsertLineBreak").execute(); 349 break; 349 #ifdef QT_WS_MAC 350 if (kevent->shiftKey() || kevent->metaKey()) 351 #else 352 if (kevent->shiftKey()) 353 #endif 354 frame->editor()->command("InsertLineBreak").execute(); 355 else 356 frame->editor()->command("InsertNewline").execute(); 357 break; 358 #endif 350 359 case VK_BACK: 351 360 frame->editor()->deleteWithDirection(SelectionController::BACKWARD,