[Kst] kdeextragear-2/kst/kst
George Staikos
staikos at kde.org
Thu May 27 11:55:21 CEST 2004
CVS commit by staikos:
some better keyboard handling and zooming feedback. only one major bug left I
think.
M +26 -7 kst2dplot.cpp 1.35
M +2 -0 kstviewwidget.cpp 1.31
--- kdeextragear-2/kst/kst/kst2dplot.cpp #1.34:1.35
@@ -1930,6 +1930,13 @@ void Kst2DPlot::mouseMoveEvent(QWidget *
setCursorForMode(view);
} else {
+ ButtonState s = e->stateAfter();
if (pr.contains(e->pos())) {
+ if (s & Qt::ShiftButton) {
+ view->setCursor(QCursor(Qt::SizeVerCursor));
+ } else if (s & Qt::ControlButton) {
+ view->setCursor(QCursor(Qt::SizeHorCursor));
+ } else {
view->setCursor(QCursor(Qt::CrossCursor));
+ }
} else {
view->setCursor(QCursor(Qt::ArrowCursor));
@@ -2199,9 +2206,11 @@ void Kst2DPlot::setCursorForMode(QWidget
void Kst2DPlot::keyReleaseEvent(QWidget *view, QKeyEvent *e) {
- if (_mouse.zooming()) {
+ if (_mouse.zooming() || _mouse.mode == INACTIVE) {
// FIXME: wrong
+ if (_mouse.mode != INACTIVE) {
KstMouseModeType newType = XY_ZOOMBOX;
zoomRectUpdate(view, newType, _mouse.lastLocation.x(), _mouse.lastLocation.y());
_mouse.mode = newType;
+ }
setCursorForMode(view);
} else {
@@ -2212,6 +2221,6 @@ void Kst2DPlot::keyReleaseEvent(QWidget
void Kst2DPlot::keyPressEvent(QWidget *view, QKeyEvent *e) {
- if (_mouse.zooming()) {
ButtonState s = e->stateAfter();
+ if (_mouse.zooming()) {
KstMouseModeType newType;
if (s & Qt::ShiftButton) {
@@ -2235,6 +2244,16 @@ void Kst2DPlot::keyPressEvent(QWidget *v
setCursorForMode(view);
} else {
+ if (_mouse.mode == INACTIVE && GetPlotRegion().contains(view->mapFromGlobal(QCursor::pos()))) {
+ if (s & Qt::ShiftButton) {
+ view->setCursor(QCursor(Qt::SizeVerCursor));
+ } else if (s & Qt::ControlButton) {
+ view->setCursor(QCursor(Qt::SizeHorCursor));
+ } else {
+ view->setCursor(QCursor(Qt::CrossCursor));
+ }
+ } else {
e->ignore();
}
+ }
}
--- kdeextragear-2/kst/kst/kstviewwidget.cpp #1.30:1.31
@@ -330,4 +330,5 @@ void KstViewWidget::keyPressEvent(QKeyEv
void KstViewWidget::keyReleaseEvent(QKeyEvent *e) {
if (_view->viewMode() == KstTopLevelView::DisplayMode) {
+kdDebug() << "Key release " << endl;
KstViewObjectPtr vo;
// Note: should mouse grabbers get keyboard input?
@@ -338,4 +339,5 @@ void KstViewWidget::keyReleaseEvent(QKey
}
if (vo) {
+kdDebug() << "SENDING IT" << endl;
vo->keyReleaseEvent(this, e);
}
More information about the Kst
mailing list