diff options
author | clifford <clifford@b57f626f-c46c-0410-a088-ec61d464b74c> | 2009-10-05 11:23:23 (GMT) |
---|---|---|
committer | clifford <clifford@b57f626f-c46c-0410-a088-ec61d464b74c> | 2009-10-05 11:23:23 (GMT) |
commit | 754a3dc15287bf90deb10f75afd099e2a47fe5ef (patch) | |
tree | 2f358f3c4c4458f4437d393a6eabf3da9374b368 /glview.cc | |
parent | f789f39f7518c16ceeecd08104a66e2774a7a469 (diff) |
Clifford Wolf:
Added keyboard zoom and menu view angle actions
git-svn-id: http://svn.clifford.at/openscad/trunk@95 b57f626f-c46c-0410-a088-ec61d464b74c
Diffstat (limited to 'glview.cc')
-rw-r--r-- | glview.cc | 15 |
1 files changed, 15 insertions, 0 deletions
@@ -212,6 +212,20 @@ void GLView::paintGL() renderfunc(renderfunc_vp); } +void GLView::keyPressEvent(QKeyEvent *event) +{ + if (event->key() == Qt::Key_Plus) { + viewer_distance *= 0.9; + updateGL(); + return; + } + if (event->key() == Qt::Key_Minus) { + viewer_distance /= 0.9; + updateGL(); + return; + } +} + void GLView::wheelEvent(QWheelEvent *event) { viewer_distance *= pow(0.9, event->delta() / 120.0); @@ -224,6 +238,7 @@ void GLView::mousePressEvent(QMouseEvent *event) last_mouse_x = event->globalX(); last_mouse_y = event->globalY(); grabMouse(); + setFocus(); } void GLView::mouseMoveEvent(QMouseEvent *event) |