[SailfishDevel] Does BackgroundItem not accept all elements?
Mikko Leppänen
mleppan23 at gmail.com
Wed Jan 22 12:40:37 UTC 2014
Hi,
Okay, you could try defining a width and height directly for the background
item:
BackgroundItem {
id: background
width: parent.width
height: background_content.childrenRect.height
...
}
/Mikko
2014/1/22 Google Mail <m.gabrielboehme at googlemail.com>
>
> This makes the Separator line just thicker, but do not help. I have the
> same problems also with Image - with explicitly set height or not. Or
> Column with nested Row.
>
> For now I created my own delegate, don't know what's wrong, but maybe some
> elements are not recognised as children?!
>
> Gabriel.
> *Von: *Mikko Leppänen
> *Gesendet: *Mittwoch, 22. Januar 2014 13:15
> *An: *Sailfish OS Developers
> *Antwort an: *Sailfish OS Developers
> *Betreff: *Re: [SailfishDevel] Does BackgroundItem not accept all
> elements?
>
> Hi,
>
> Define some height for the separator item.
>
> /Mikko
>
>
> 2014/1/22 Gabriel Böhme <m.gabrielboehme at googlemail.com>
>
>> Hi sailors,
>>
>> I have a ListView and want to create a delegate for it. So I use the
>> BackgroundItem as Silica Documentation recommend, but it seems, that the
>> BackgroundItem is not accepting all elements.
>>
>> Easy example:
>>
>> BackgroundItem {
>> id: background
>>
>> highlightedColor: Theme.secondaryHighlightColor
>>
>> onClicked: {
>> console.log("clicked: "+index)
>> }
>>
>> Column {
>> id: background_content
>>
>> spacing: Theme.paddingSmall
>> width: parent.width
>>
>> TextEdit {
>> text: tmdb_title
>> color: Theme.highlightColor
>> font.pixelSize: Theme.fontSizeMedium
>> wrapMode: TextEdit.Wrap
>> readOnly: true
>> }
>> Label {
>> text: "Released: "+tmdb_release_date
>> color: Theme.primaryColor
>> font.pixelSize: Theme.fontSizeMedium
>> }
>> Separator {
>> width: parent.width
>> color: Theme.highlightColor
>> }
>> }
>>
>> In this case the BackgroundItem just accepts the TextEdit and the Label,
>> but not the Separator. Which can be seen by clicking it. Setting the
>> contentHeight, does not change this behavior, it's just results in not
>> showing the highlighted color anymore.
>>
>> Do I miss something? Whats wrong here?
>>
>> Thanks, Gabriel.
>>
>>
>>
>> _______________________________________________
>> SailfishOS.org Devel mailing list
>>
>
>
>
>
> _______________________________________________
> SailfishOS.org Devel mailing list
> _______________________________________________
> SailfishOS.org Devel mailing list
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.sailfishos.org/pipermail/devel/attachments/20140122/bb792dda/attachment.html>
More information about the Devel
mailing list