<html dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" id="owaParaStyle">P {margin-top:0;margin-bottom:0;}</style>
</head>
<body fpstyle="1" ocsi="0">
<div style="direction: ltr;font-family: Tahoma;color: #000000;font-size: 10pt;">
<div>Hi,</div>
<div><br>
</div>
<div>> I have a single item I am displaying to<br>
> which I am adding a context menu and semantically it just seemed weird<br>
> that I would have to put that inside of a ListItem</div>
<div><br>
</div>
<div>Unfortunately Silica doesn't have convenience API for adding a context menu to any item as it needs to make sure the surrounding view layout makes room for the opening menu and that the menu is positioned correctly in relation to display. So far adding
 menus for anything other than a list item has been a unnecessarily painful.<br>
</div>
<br>
<div>We now finally got around developing GridItem, which provides menus and remorses like ListItem, but takes care of the different positioning rules of a grid. GridItem works with Grid and SilicaGridView. We are targeting to get the new component out with
 3.2.1.<br>
</div>
<div><br>
</div>
<div>Note GridItem does not work in vanilla GridView, we need to do some adjustments to workaround GridView limitation that assumes each grid delegate has the same dimensions. I hope some day Qt gains more sophisticated views, which allow aggregating content
 from multiple models, supports dynamically sized grid items, more natural stacking flows, and so on.</div>
<div><br>
</div>
<div>Br,</div>
<div><br>
</div>
<div>Joona Petrell<br>
</div>
<br>
<div style="font-family: Times New Roman; color: #000000; font-size: 16px">
<hr tabindex="-1">
<div id="divRpF296975" style="direction: ltr;"><font size="2" face="Tahoma" color="#000000"><b>From:</b> Devel [devel-bounces@lists.sailfishos.org] on behalf of E.S. Rosenberg [es.rosenberg+sailfishos.org@gmail.com]<br>
<b>Sent:</b> 13 October 2019 00:52<br>
<b>To:</b> Sailfish OS Developers<br>
<b>Subject:</b> Re: [SailfishDevel] Silica QML objects that can have a menu property<br>
</font><br>
</div>
<div></div>
<div>
<div dir="ltr">
<div>Hi Thomas,</div>
<div><br>
</div>
<div>Thanks for your long answer and the many references, I guess my main point was a bit nit-picking in the sense that Semantically/Linguistically it does not seem to make sense to me to use a ListItem (yes it works, but if you were to tell anyone that is
 what you need to use I think they would also say "huh?")</div>
<div><br>
</div>
<div>Container and Item and are not documented here: <a href="https://sailfishos.org/develop/docs/silica/sailfish-silica-all.html/" target="_blank" rel="noopener noreferrer">
https://sailfishos.org/develop/docs/silica/sailfish-silica-all.html/</a></div>
<div>To me using Item or Container for this would make most sense actually.</div>
<div><br>
</div>
<div>Thanks again for your time,</div>
<div>Eli<br>
</div>
</div>
<br>
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">Op vr 11 okt. 2019 om 16:16 schreef Thomas Tanghus <<a href="mailto:thomas@tanghus.net" target="_blank" rel="noopener noreferrer">thomas@tanghus.net</a>>:<br>
</div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex; border-left:1px solid rgb(204,204,204); padding-left:1ex">
On torsdag den 10. oktober 2019 06.30.33 CEST E.S. Rosenberg wrote:<br>
> Hi all,<br>
> My question may be very simple - is ListItem the only type of object that<br>
> may display a text on a page that can have a "menu" property? I went over<br>
> the Silica reference quickly and I didn't find any other similar items.<br>
> <br>
> The reason I ask this is that I have a single item I am displaying to<br>
> which I am adding a context menu and semantically it just seemed weird<br>
> that I would have to put that inside of a ListItem to be able to add a<br>
> menu: ContextMenu property.<br>
> <br>
> Or did I miss some other object that does support this property?<br>
<br>
You can set the 'container' property to the parent of the menu as done in:<br>
<a href="https://github.com/tanghus/kitchen-timer-qml/blob/master/qml/pages/TimerPage.qml#L220" rel="noreferrer" target="_blank">https://github.com/tanghus/kitchen-timer-qml/blob/master/qml/pages/TimerPage.qml#L220</a><br>
<br>
There it's a BackgroundItem:<br>
<a href="https://github.com/tanghus/kitchen-timer-qml/blob/master/qml/pages/TimerPage.qml#L124" rel="noreferrer" target="_blank">https://github.com/tanghus/kitchen-timer-qml/blob/master/qml/pages/TimerPage.qml#L124</a><br>
<br>
Or did I misunderstand you?<br>
<br>
-- <br>
<br>
<br>
/Thomas_______________________________________________<br>
SailfishOS.org Devel mailing list<br>
To unsubscribe, please send a mail to <a href="mailto:devel-unsubscribe@lists.sailfishos.org" target="_blank" rel="noopener noreferrer">
devel-unsubscribe@lists.sailfishos.org</a></blockquote>
</div>
</div>
</div>
</div>
</body>
</html>