On Sunday 12 August 2012 12:51:19 Marco Martin wrote: > On Saturday 11 August 2012, Gregor Tätzner wrote: > > On Friday 10 August 2012 19:20:46 Marco Martin wrote: > > > On Friday 10 August 2012, Gregor Tätzner wrote: > > > > I need a nice context menu for kickoff qml. Is someone working on > > > > this? > > > > There is a ContextMenu.qml file in plasmacomponents, but it's > > > > kinda...empty. > > > > > > because it's implemented in c++. > > > > > > it will create a native qmenu, so should be fine for the use case (items > > > context menu?) > > > > > > ContextMenu { > > > > > > visualParent: contentMenuButton > > > MenuItem { > > > > > > text: "bah" > > > icon: QIcon("iconname") > > > onClicked: foo() > > > > > > } > > > > > > } > > > > Great, working fine so far. But how can I trigger this contextMenu in a > > plasmoid by a right click? > > > > onClicked: { > > > > if (mouse.button == Qt.RightButton) > > > > ... > > > > doesn't work because the plasmoid settings menu catches the right button. > > Can I overwrite that? > > see > http://qt-project.org/doc/qt-4.8/qml-mousearea.html#acceptedButtons-prop > > you need to add the rightbutton to the accepted buttons of the mousearea. > > the plasmoid right menu should trigger only if no of the child element > manages the right mouse click event on its own
excellent :) One last issue: What would be the best approach to align the context menu popup to the mouse pointer? As it stands now the menu pops below the visualParent of the ContextMenu (in my case a list entry) Greg
signature.asc
Description: This is a digitally signed message part.
_______________________________________________ Plasma-devel mailing list Plasma-devel@kde.org https://mail.kde.org/mailman/listinfo/plasma-devel