| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2007 Staikos Computing Services Inc. <info@staikos.net> | 3 * Copyright (C) 2007 Staikos Computing Services Inc. <info@staikos.net> |
| 4 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) | 4 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) |
| 5 * | 5 * |
| 6 * Redistribution and use in source and binary forms, with or without | 6 * Redistribution and use in source and binary forms, with or without |
| 7 * modification, are permitted provided that the following conditions | 7 * modification, are permitted provided that the following conditions |
| 8 * are met: | 8 * are met: |
| 9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 QAction* actScrollUp = menu.addAction(horizontal ? QCoreApplication::transla
te("QWebPage", "Scroll left") : QCoreApplication::translate("QWebPage", "Scroll
up")); | 69 QAction* actScrollUp = menu.addAction(horizontal ? QCoreApplication::transla
te("QWebPage", "Scroll left") : QCoreApplication::translate("QWebPage", "Scroll
up")); |
| 70 QAction* actScrollDown = menu.addAction(horizontal ? QCoreApplication::trans
late("QWebPage", "Scroll right") : QCoreApplication::translate("QWebPage", "Scro
ll down")); | 70 QAction* actScrollDown = menu.addAction(horizontal ? QCoreApplication::trans
late("QWebPage", "Scroll right") : QCoreApplication::translate("QWebPage", "Scro
ll down")); |
| 71 | 71 |
| 72 const QPoint globalPos = QPoint(event.globalX(), event.globalY()); | 72 const QPoint globalPos = QPoint(event.globalX(), event.globalY()); |
| 73 QAction* actionSelected = menu.exec(globalPos); | 73 QAction* actionSelected = menu.exec(globalPos); |
| 74 | 74 |
| 75 if (actionSelected == actScrollHere) { | 75 if (actionSelected == actScrollHere) { |
| 76 const QPoint pos = convertFromContainingWindow(event.pos()); | 76 const QPoint pos = convertFromContainingWindow(event.pos()); |
| 77 moveThumb(horizontal ? pos.x() : pos.y()); | 77 moveThumb(horizontal ? pos.x() : pos.y()); |
| 78 } else if (actionSelected == actScrollTop) | 78 } else if (actionSelected == actScrollTop) |
| 79 setValue(0); | 79 scroll(horizontal ? ScrollLeft : ScrollUp, ScrollByDocument); |
| 80 else if (actionSelected == actScrollBottom) | 80 else if (actionSelected == actScrollBottom) |
| 81 setValue(maximum()); | 81 scroll(horizontal ? ScrollRight : ScrollDown, ScrollByDocument); |
| 82 else if (actionSelected == actPageUp) | 82 else if (actionSelected == actPageUp) |
| 83 scroll(horizontal ? ScrollLeft: ScrollUp, ScrollByPage); | 83 scroll(horizontal ? ScrollLeft : ScrollUp, ScrollByPage); |
| 84 else if (actionSelected == actPageDown) | 84 else if (actionSelected == actPageDown) |
| 85 scroll(horizontal ? ScrollRight : ScrollDown, ScrollByPage); | 85 scroll(horizontal ? ScrollRight : ScrollDown, ScrollByPage); |
| 86 else if (actionSelected == actScrollUp) | 86 else if (actionSelected == actScrollUp) |
| 87 scroll(horizontal ? ScrollLeft : ScrollUp, ScrollByLine); | 87 scroll(horizontal ? ScrollLeft : ScrollUp, ScrollByLine); |
| 88 else if (actionSelected == actScrollDown) | 88 else if (actionSelected == actScrollDown) |
| 89 scroll(horizontal ? ScrollRight : ScrollDown, ScrollByLine); | 89 scroll(horizontal ? ScrollRight : ScrollDown, ScrollByLine); |
| 90 #endif // QT_NO_CONTEXTMENU | 90 #endif // QT_NO_CONTEXTMENU |
| 91 return true; | 91 return true; |
| 92 } | 92 } |
| 93 | 93 |
| 94 } | 94 } |
| 95 | 95 |
| 96 // vim: ts=4 sw=4 et | 96 // vim: ts=4 sw=4 et |
| OLD | NEW |