Changeset 54058 in webkit
- Timestamp:
- Jan 29, 2010 6:00:29 AM (14 years ago)
- Location:
- trunk/WebKitTools
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebKitTools/ChangeLog
r54054 r54058 1 2010-01-29 Andreas Kling <andreas.kling@nokia.com> 2 3 Reviewed by Kenneth Rohde Christiansen. 4 5 [Qt] Add support for Maemo zoom keys in QtLauncher 6 7 https://bugs.webkit.org/show_bug.cgi?id=34160 8 9 * QtLauncher/main.cpp: 10 (LauncherWindow::LauncherWindow): 11 (LauncherWindow::~LauncherWindow): 12 (LauncherWindow::keyPressEvent): 13 (LauncherWindow::grabZoomKeys): 14 1 15 2010-01-29 Benjamin Poulain <benjamin.poulain@nokia.com> 2 16 -
trunk/WebKitTools/QtLauncher/main.cpp
r53952 r54058 50 50 #include <qwebinspector.h> 51 51 #include <qwebsettings.h> 52 53 #ifdef Q_WS_MAEMO_5 54 #include <qx11info_x11.h> 55 #endif 56 52 57 #include "urlloader.h" 53 58 #include "utils.h" … … 56 61 #include "webview.h" 57 62 63 #ifdef Q_WS_MAEMO_5 64 #include <X11/Xatom.h> 65 #include <X11/Xlib.h> 66 #undef KeyPress 67 #endif 68 58 69 #ifndef NDEBUG 59 70 void QWEBKIT_EXPORT qt_drt_garbageCollector_collect(); … … 96 107 zoomLevels << 110 << 120 << 133 << 150 << 170 << 200 << 240 << 300; 97 108 109 grabZoomKeys(true); 110 98 111 load(url); 112 } 113 114 ~LauncherWindow() 115 { 116 grabZoomKeys(false); 117 } 118 119 void keyPressEvent(QKeyEvent* event) 120 { 121 #ifdef Q_WS_MAEMO_5 122 switch (event->key()) { 123 case Qt::Key_F7: 124 zoomIn(); 125 event->accept(); 126 break; 127 case Qt::Key_F8: 128 zoomOut(); 129 event->accept(); 130 break; 131 } 132 #endif 133 MainWindow::keyPressEvent(event); 134 } 135 136 void grabZoomKeys(bool grab) 137 { 138 #ifdef Q_WS_MAEMO_5 139 if (!winId()) { 140 qWarning("Can't grab keys unless we have a window id"); 141 return; 142 } 143 144 Atom atom = XInternAtom(QX11Info::display(), "_HILDON_ZOOM_KEY_ATOM", False); 145 if (!atom) { 146 qWarning("Unable to obtain _HILDON_ZOOM_KEY_ATOM"); 147 return; 148 } 149 150 unsigned long val = (grab) ? 1 : 0; 151 XChangeProperty(QX11Info::display(), winId(), atom, XA_INTEGER, 32, PropModeReplace, reinterpret_cast<unsigned char*>(&val), 1); 152 #endif 99 153 } 100 154
Note: See TracChangeset
for help on using the changeset viewer.