Summary: | [Patch] Provide a faster way to add measure points (ctrl+click) | ||
---|---|---|---|
Product: | [Applications] marble | Reporter: | k_the_first |
Component: | general | Assignee: | Dennis Nienhüser <nienhueser> |
Status: | RESOLVED MOVED | ||
Severity: | task | CC: | aspotashev, bastianholst, nienhueser, rahn, tommesml |
Priority: | NOR | Keywords: | junior-jobs |
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Debian testing | ||
OS: | Unspecified | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: | |||
Attachments: |
Proposed patch
[Patch] Proposed patch fast adding measure-points updated patch |
Description
k_the_first
2010-03-25 12:25:57 UTC
I am new to marble development. I played around with the QT-Version and would like to propose the following change. However, I am not sure if this change could break something around the rubber-band code, which uses the control-key as well. Therefore I compare the coordinates between button-press and button-release. The addMeasurePoint() triggers only if the coordinates are equal. I am not sure how to generate a patch. It would be great if anyone could point me to some guidelines. Thanks, Thomas File: marble/src/lib/MarbleWidgetInputHandler.cpp // Regarding mouse button releases: if ( e->type() == QEvent::MouseButtonRelease && event->button() == Qt::LeftButton ) { if ( ( event->modifiers() & Qt::ControlModifier ) && ( event->globalPos() == d->m_selectionOrigin ) ) { d->m_addMeasurePointAction->setData( QPoint( event->x(), event->y() ) ); addMeasurePoint(); } else { //emit current coordinates to be be interpreted //as requested emit mouseClickScreenPosition( d->m_leftpressedx, d->m_leftpressedy ); } MarbleWidgetInputHandler::d->m_widget->setViewContext( Still ); if ( MarbleWidgetInputHandler::d->m_widget->mapQuality( Still ) != MarbleWidgetInputHandler::d->m_widget->mapQuality( Animation ) ) { MarbleWidgetInputHandler::d->m_widget->updateChangedMap(); } d->m_leftpressed = false; } Created attachment 51276 [details]
Proposed patch
Thomas: thanks! Looks nice. I suggest that you also post patch suggestions to marble-devel and/or to reviewboard to raise awareness (I just accidently stumbled over this when looking through the bugs). :-) Created attachment 53830 [details]
[Patch] Proposed patch fast adding measure-points
Hello,
I would like to propose a second patch for this junior job.
It still uses the CTRL modifier key. However, "measure mode" has to be switched on via a new added menu toggle option within the right-mouse-button menu. This should avoid the conflict with the rubber-band-selection using the CTRL modifier key as well.
When in "measure mode" the mouse-pointer changes to the "arrow-up"-pointer when CTRL is pressed to indicate the different behaviour.
Please see attachment.
Best wishes,
Thomas
*** Bug 280121 has been marked as a duplicate of this bug. *** Created attachment 62999 [details]
updated patch
I've taken the Thomas Lenarz's patch and updated it, because it didn't apply to the latest Marble sources. Works as expected here. The feature works even better that in Google Earth, because in Google Earth you can't scroll the map using left mouse button while you are drawing the path (due to left mouse button being used for both dragging and path drawing).
Please follow up in https://phabricator.kde.org/T4260 |