[SailfishDevel] The UI dims after removing an item from GridView

Marcin Mielniczuk marmistrzmar at gmail.com
Tue Aug 2 14:42:27 UTC 2016


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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.sailfishos.org/pipermail/devel/attachments/20160802/cb04b56e/attachment.html>


More information about the Devel mailing list