[SailfishDevel] Way to determine the height of a cover action?

Joona Petrell joona.petrell at jolla.com
Mon Oct 24 18:42:59 UTC 2016


Hi,

Excellent question. Unfortunately and a bit surprisingly (sorry!) no such API exists yet. We noticed that also recently, in the second upcoming release after the current public (Sailfish OS 2.0.4) we'll introduce Cover.coverActionArea API, which is an Item that can be anchored to or you can bind to the height of the item.

Cover { Component.onCompleted: console.log("Cover action area height is", coverActionArea.height) }

In the mean time you can calculate the cover action height with following code (not supported in the long run, replace with the proper API once available):

property real scale: width / Theme.coverSizeLarge.width
property int coverActionHeight: Math.min(scale*Theme.itemSizeSmall, width/2)

Br,

Joona

________________________________________
From: Devel [devel-bounces at lists.sailfishos.org] on behalf of micu [micuintus at gmx.de]
Sent: 24 October 2016 17:27
To: Sailfish OS Developers
Subject: [SailfishDevel] Way to determine the height of a cover action?

Dear fellow sailors,

My name is micu and I'd like to say hello to all of you.

Currently I am working* on a Sailfish version

    <https://github.com/micuintus/harbour-Berlin-vegan>

of the Berlin Vegan Guide
(I took also part in developing the new 2.x Android version of the app):

    <http://www.berlin-vegan.de/bv-guide/>

I noticed that my current application cover doesn't look too nice with a cover
action on top of some text. So I wonder whether it is possible to ascertain
the height of the cover action area in the bottom part of the cover?

I discovered that the cover proportions are a little bit different for the two
possible cover sizes. I also looked at the QML file for the call list, but it
obviously does not anchor its text area to the cover action area, but instead
simply limits its list to five items.

Does anyone by any chance have an idea? That would be really helpful.

Kind regards,
micu

-------------------
* In case somebody is interested in helping with the development of this app,
of course I'd be more than happy if you join.

Furthermore, if you take a glance at the code and some ideas pop up in your
head on how to improve the code, I'd love to hear your suggestions. My
Sailfish and QML experience is still fresh and I would like to learn more
about QML and Sailfish best practices.
--
OpenPGP / GnuPG:        0xE4CB4E80
Fingerprint:            1A15 A480 1F8B 07F6 9D12 3426 CEFE 7455 E4CB 4E80

<<</>>

http://www.micuintus.de
_______________________________________________
SailfishOS.org Devel mailing list
To unsubscribe, please send a mail to devel-unsubscribe at lists.sailfishos.org


More information about the Devel mailing list