presencevnc (0.7) unstable; urgency=low
- * Show current magnification when zooming
* Doubleclick zoom slider for 100%
+ * Added "Zoom to cursor" option (on by default)
+ * Show current magnification when zooming
-- Christian Pulvermacher <pulvermacher@gmx.de> Sat, 23 Oct 2010 18:32:50 +0200
void MainWindow::reloadSettings()
{
-#ifdef Q_WS_MAEMO_5
QSettings settings;
+ zoom_to_cursor = settings.value("zoom_to_cursor", true).toBool();
+
+#ifdef Q_WS_MAEMO_5
int rotation = settings.value("screen_rotation", 0).toInt();
setAttribute(Qt::WA_Maemo5AutoOrientation, rotation == 0);
setAttribute(Qt::WA_Maemo5LandscapeOrientation, rotation == 1);
//scroll to center, if zoom level actually changed
if(old_factor != new_factor) {
- center = center * (double(new_factor)/old_factor);
+ if(zoom_to_cursor)
+ center = new_factor * vnc_view->cursorPosition();
+ else //zoom to center of visible region
+ center = center * (double(new_factor)/old_factor);
+
scroll_area->ensureVisible(center.x(), center.y(),
vnc_view->visibleRegion().boundingRect().width()/2,
vnc_view->visibleRegion().boundingRect().height()/2);
private:
void grabZoomKeys(bool grab);
void reloadSettings();
+
VncView *vnc_view;
ScrollArea *scroll_area;
QToolBar *toolbar;
QSlider *zoom_slider;
QAction *scaling, *show_toolbar, *disconnect_action;
KeyMenu *key_menu;
+ bool zoom_to_cursor;
};
#endif
always_show_local_cursor->setChecked(settings.value("always_show_local_cursor", false).toBool());
layout2->addWidget(always_show_local_cursor);
+ zoom_to_cursor = new QCheckBox(tr("Zoom to cursor"), this);
+ zoom_to_cursor->setChecked(settings.value("zoom_to_cursor", true).toBool());
+ layout2->addWidget(zoom_to_cursor);
+
QPushButton *ok = new QPushButton(tr("Done"));
ok->setMaximumWidth(100);
settings.setValue("disable_tapping", disable_tapping->isChecked());
#endif
settings.setValue("always_show_local_cursor", always_show_local_cursor->isChecked());
+ settings.setValue("zoom_to_cursor", zoom_to_cursor->isChecked());
settings.sync();
}
QMaemo5ListPickSelector *rightzoom_selector;
QCheckBox *disable_tapping;
#endif
- QCheckBox *always_show_local_cursor;
+ QCheckBox *always_show_local_cursor, *zoom_to_cursor;
};
#endif
void setViewOnly(bool viewOnly);
void showDotCursor(DotCursorState state);
void useFastTransformations(bool enabled);
+ QPoint cursorPosition() { return QPoint(cursor_x, cursor_y); }
public slots:
void setZoomLevel(int level = -1); //'level' doesn't correspond to actual magnification, though mapping is done here