[SailfishDevel] ContextMenu used with multiple Views on one Page
christopher.lamb at thurweb.ch
christopher.lamb at thurweb.ch
Sun Jun 23 10:26:31 UTC 2013
Hi All
I am struggling to get a Silica ContextNenu working from a view.
I have taken the ComponentsGallery MenuPage as a reference example.
When an entry on the view is PressAndHold(ed) a ContextMenu "drops
down" below the selected item.
In most cases this causes the items below those selected to slide
down. Towards the bottom of the screen it causes items above to slide
up (so there is room to paint the ContextMenu).
In my app I have a column of 4 Views in a parent child relationship.
Clicking on an item in View 1 causes Views 2, 3, and 4 to repopulate.
Clicking on an item in View 2 causes Views 3 and 4 to repopulate. (See
MC_MainPage1.jp2).
When a item is clicked, I "expand* the delegate and the view holding
the item to create space for the ContextMenu (which may be taller than
the View in its normal state). Lower Views slide down accordingly.
(See MC_MainPage2.jp2). So far so good.
However when a I add the ContextMenu, things go a little haywire, as
can be seen in MC_MainPage3.jp2. Rather than sliding lower ListItems
down, the ContextMenu slides higher ListIems up, and sits itself at
the top of the View / screen.
Any ideas of what is going on?
I suspect that my use case may be a little too exotic for the standard
ContextMenu: I am on the brink of implementing my own custom
equivalent, but thought I would seek the wise council of others before
doing so.
My code can be found here:
https://github.com/sailfishapps/landed/tree/master/landedsettings21/qml/landedsettings21
The .qmls related to this issue are:
MainPage
https://github.com/sailfishapps/landed/blob/master/landedsettings21/qml/landedsettings21/MainPage.qml
LandedMVD (my generic Model View Delegate Control, used 4 times by MainPage)
https://github.com/sailfishapps/landed/blob/master/landedsettings21/qml/landedsettings21/LandedMVD.qml
ViewDelegate (the delegate used by MainPage/LandedMVD)
https://github.com/sailfishapps/landed/blob/master/landedsettings21/qml/landedsettings21/ViewDelegate.qml
Chris
-------------- next part --------------
A non-text attachment was scrubbed...
Name: MC_MainPage1.jp2
Type: image/jp2
Size: 96370 bytes
Desc: not available
URL: <https://lists.sailfishos.org/pipermail/devel/attachments/20130623/6759c015/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: MC_MainPage2.jp2
Type: image/jp2
Size: 96336 bytes
Desc: not available
URL: <https://lists.sailfishos.org/pipermail/devel/attachments/20130623/6759c015/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: MC_MainPage3.jp2
Type: image/jp2
Size: 96387 bytes
Desc: not available
URL: <https://lists.sailfishos.org/pipermail/devel/attachments/20130623/6759c015/attachment-0002.bin>
More information about the Devel
mailing list