Linux-Trace-Devel Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH 0/1] kernel-shark v1 changed.
@ 2021-01-25 14:05 Yordan Karadzhov (VMware)
  2021-01-25 14:05 ` [PATCH 1/1] kernel-shark: Use mouse wheel to scroll the graphs Yordan Karadzhov (VMware)
  0 siblings, 1 reply; 2+ messages in thread
From: Yordan Karadzhov (VMware) @ 2021-01-25 14:05 UTC (permalink / raw)
  To: rostedt; +Cc: linux-trace-devel, Yordan Karadzhov (VMware)

This is a KernelShark v1 patch. To be applied to the trace-cmd repo.

Yordan Karadzhov (VMware) (1):
  kernel-shark: Use mouse wheel to scroll the graphs

 kernel-shark/src/KsGLWidget.cpp   | 3 ++-
 kernel-shark/src/KsTraceGraph.hpp | 5 ++++-
 2 files changed, 6 insertions(+), 2 deletions(-)

-- 
2.25.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [PATCH 1/1] kernel-shark: Use mouse wheel to scroll the graphs
  2021-01-25 14:05 [PATCH 0/1] kernel-shark v1 changed Yordan Karadzhov (VMware)
@ 2021-01-25 14:05 ` Yordan Karadzhov (VMware)
  0 siblings, 0 replies; 2+ messages in thread
From: Yordan Karadzhov (VMware) @ 2021-01-25 14:05 UTC (permalink / raw)
  To: rostedt; +Cc: linux-trace-devel, Yordan Karadzhov (VMware), FeRD

The current zoom-in/zoom-out function of the mouse wheel will be
performed only when rolling the mouse wheel and simultaneously
pressing "Ctrl", while just rolling the wheel will move you up or
down in the scroll area of the graphs without zooming.

We want to introduce the change because zoom via Ctrl+ScrollWheel
is a binding familiar from the Web Browsers.

Suggested-by: FeRD (Frank Dana) <ferdnyc@gmail.com>
Signed-off-by: Yordan Karadzhov (VMware) <y.karadz@gmail.com>
---
 kernel-shark/src/KsGLWidget.cpp   | 3 ++-
 kernel-shark/src/KsTraceGraph.hpp | 5 ++++-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/kernel-shark/src/KsGLWidget.cpp b/kernel-shark/src/KsGLWidget.cpp
index 78ded33..404f0d0 100644
--- a/kernel-shark/src/KsGLWidget.cpp
+++ b/kernel-shark/src/KsGLWidget.cpp
@@ -266,7 +266,8 @@ void KsGLWidget::wheelEvent(QWheelEvent * event)
 {
 	int zoomFocus;
 
-	if (isEmpty())
+	if (QApplication::keyboardModifiers() != Qt::ControlModifier ||
+	    isEmpty())
 		return;
 
 	if (_mState->activeMarker()._isSet &&
diff --git a/kernel-shark/src/KsTraceGraph.hpp b/kernel-shark/src/KsTraceGraph.hpp
index 0eeef14..15ade42 100644
--- a/kernel-shark/src/KsTraceGraph.hpp
+++ b/kernel-shark/src/KsTraceGraph.hpp
@@ -28,7 +28,10 @@ public:
 	 * Reimplemented handler for mouse wheel events. All mouse wheel
 	 * events will be ignored.
 	 */
-	void wheelEvent(QWheelEvent *evt) {evt->ignore();}
+	void wheelEvent(QWheelEvent *evt) {
+		if (QApplication::keyboardModifiers() != Qt::ControlModifier)
+			QScrollArea::wheelEvent(evt);
+	}
 };
 
 /**
-- 
2.25.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-25 14:05 [PATCH 0/1] kernel-shark v1 changed Yordan Karadzhov (VMware)
2021-01-25 14:05 ` [PATCH 1/1] kernel-shark: Use mouse wheel to scroll the graphs Yordan Karadzhov (VMware)

Linux-Trace-Devel Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-trace-devel/0 linux-trace-devel/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-trace-devel linux-trace-devel/ https://lore.kernel.org/linux-trace-devel \
		linux-trace-devel@vger.kernel.org
	public-inbox-index linux-trace-devel

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-trace-devel


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git