[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-panel-devel
Subject: Re: How to retrieve location from plasmoid
From: Marco Martin <notmart () gmail ! com>
Date: 2011-08-23 10:39:05
Message-ID: 201108231239.05315.notmart () gmail ! com
[Download RAW message or body]
On Tuesday 23 August 2011, Onur-Hayri Bakici wrote:
> A little example of what I did.
> Item {
>
> PlasmaWidgets.PushButton {
> id: btn
> text: "press me"
> onClicked: {
> dialog.visible = true;
> }
> }
>
> PlasmaCore.Dialog {
> id: dialog
> Component.onCompleted: {
> setAttribute(Qt.WA_X11NetWmWindowTypeDock, true);
> var pos = popupPosition(parent); // or popupPosition(btn)?
> print("QPoint: " + pos.x + "," + pos.y);
> }
> }
> }
better using btn..
anyways, you should position it on every mouse click, before showing it, so in
onClicked: {
var pos = popupPosition(btn);
dialog.x = pos.x
dialog.y = pos.y
dialog.visible = true;
}
also, exactly why you are making it a dock?
--
Marco Martin
_______________________________________________
Plasma-devel mailing list
Plasma-devel@kde.org
https://mail.kde.org/mailman/listinfo/plasma-devel
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic