linux-trace-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: Yordan Karadzhov <ykaradzhov@vmware.com>
Cc: "linux-trace-devel@vger.kernel.org" <linux-trace-devel@vger.kernel.org>
Subject: Re: [PATCH 1/2] kernel-shark-qt: Correct the coordinates of the Quick Context Menu
Date: Fri, 30 Nov 2018 10:58:29 -0500	[thread overview]
Message-ID: <20181130105829.6d77fa15@gandalf.local.home> (raw)
In-Reply-To: <20181130153749.4419-1-ykaradzhov@vmware.com>

On Fri, 30 Nov 2018 15:38:11 +0000
Yordan Karadzhov <ykaradzhov@vmware.com> wrote:

> The "Y" coordinate of the Quick Context Menu has to be corrected in
> the case when the menu gets opened from the Graph widget. This is
> needed because the Graph widget is nested inside a scroll area and
> we have to take into account the offset of the vertical scrollbar.
> 
> Signed-off-by: Yordan Karadzhov <ykaradzhov@vmware.com>

Thanks!

I applied both patches.

-- Steve

> ---
>  kernel-shark-qt/src/KsTraceGraph.cpp | 8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
> 
> diff --git a/kernel-shark-qt/src/KsTraceGraph.cpp b/kernel-shark-qt/src/KsTraceGraph.cpp
> index 0b5a8b1..858930c 100644
> --- a/kernel-shark-qt/src/KsTraceGraph.cpp
> +++ b/kernel-shark-qt/src/KsTraceGraph.cpp
> @@ -782,6 +782,12 @@ void KsTraceGraph::_onCustomContextMenu(const QPoint &point)
>  		connect(menu,	&KsQuickMarkerMenu::deselect,
>  			this,	&KsTraceGraph::deselect);
>  
> -		menu->exec(mapToGlobal(point));
> +		QPoint global = mapToGlobal(point);
> +		/*
> +		 * The global coordinates have to be corrected for the offset
> +		 * of the vertical scrollbar.
> +		 */
> +		global.ry() -= _scrollArea.verticalScrollBar()->value();
> +		menu->exec(global);
>  	}
>  }

      parent reply	other threads:[~2018-12-01  3:08 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-30 15:38 [PATCH 1/2] kernel-shark-qt: Correct the coordinates of the Quick Context Menu Yordan Karadzhov
2018-11-30 15:38 ` [PATCH 2/2] kernel-shark-qt: Add better handling of the search iterator Yordan Karadzhov
2018-11-30 15:58 ` Steven Rostedt [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181130105829.6d77fa15@gandalf.local.home \
    --to=rostedt@goodmis.org \
    --cc=linux-trace-devel@vger.kernel.org \
    --cc=ykaradzhov@vmware.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).