Hi,

I created a SilicaGridView with a ContextMenu (placed in a ColumnLayout):

SilicaGridView {
    id: myView

    Layout.preferredWidth: parent.width
    Layout.fillHeight: true

    model: myModel

    cellWidth: width / gridDimension // say, gridDimension = 2
    cellHeight: height / gridDimension

    delegate: BackgroundItem {

        id: bgItem
        width: myView.cellWidth
        height: myView.cellHeight

        ContextMenu {
            id: contextMenu
            parent: bgItem
            anchors {
                left: bgItem.left
                right: bgItem.right
                bottom: bgItem.bottom
            }

            MenuItem {
                text: "Remove"
                onClicked: myModel.remove(model.index)
            }
        }

        onPressAndHold: contextMenu.show(this)

        VisualElement {
            /* ... */
        }
    }
}

Then I tried using it. I pressed and held the BackgroundItem. The menu appeared. I stopped pressing the mouse. The screen dimmed. I decided not to remove. The screen undimmed. I entered the menu again. The screen dimmed. I removed the element: the screen did *not* undim.

What have I done wrong?

--
Marcin

_______________________________________________
SailfishOS.org Devel mailing list
To unsubscribe, please send a mail to devel-unsubscr...@lists.sailfishos.org

Reply via email to