<div dir="ltr">You should use 'status' property, not 'state'.<div><br></div><div><a href="https://sailfishos.org/sailfish-silica/qml-sailfishsilica-cover.html#status-prop">https://sailfishos.org/sailfish-silica/qml-sailfishsilica-cover.html#status-prop</a><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Oct 14, 2014 at 11:28 PM, Peter Pykäläinen <span dir="ltr"><<a href="mailto:peter.pykalainen@gmail.com" target="_blank">peter.pykalainen@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Hi,<br><br></div>any idea why the CoverBackgrounds onStateChanged does not fire in this code sample:<br><br><span style="color:rgb(128,0,128)">CoverBackground</span><span style="color:rgb(192,192,192)"> </span>{<br><span style="color:rgb(128,0,0)">onStateChanged</span>:<span style="color:rgb(192,192,192)"> </span>{
<pre style="margin:0px;text-indent:0px"><span style="color:rgb(192,192,192)"> </span><span style="font-style:italic;color:rgb(0,85,175)">console</span>.debug(<span style="color:rgb(0,128,0)">"--></span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">Cover</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">state</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">=</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">"</span><span style="color:rgb(192,192,192)"> </span>+<span style="color:rgb(192,192,192)"> </span><span style="font-style:italic;color:rgb(0,0,0)">state</span>);</pre>
<pre style="margin:0px;text-indent:0px"><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(128,128,0)">if</span><span style="color:rgb(192,192,192)"> </span>(<span style="font-style:italic;color:rgb(0,0,0)">state</span><span style="color:rgb(192,192,192)"> </span>===<span style="color:rgb(192,192,192)"> </span>Cover.Active)</pre>
<pre style="margin:0px;text-indent:0px"><span style="color:rgb(192,192,192)"> </span><span style="font-style:italic;color:rgb(0,85,175)">console</span>.debug(<span style="color:rgb(0,128,0)">"--></span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">Do</span><span style="color:rgb(192,192,192)"> </span><span style="color:rgb(0,128,0)">stuff!!!"</span>);</pre>
<pre style="margin:0px;text-indent:0px"><span style="color:rgb(192,192,192)"> </span>}</pre><br clear="all"><div><div><div>If I create a timer with running: state===Cover.Active the timer runs when the cover is active and stops when it's not.<br><br>I'd really like to update some stuff on my cover everytime it comes visible.<span class="HOEnZb"><font color="#888888"><br><br>// Peter Pykäläinen</font></span></div>
</div></div></div>
<br>_______________________________________________<br>
SailfishOS.org Devel mailing list<br>
To unsubscribe, please send a mail to <a href="mailto:devel-unsubscribe@lists.sailfishos.org">devel-unsubscribe@lists.sailfishos.org</a><br></blockquote></div><br><br clear="all"><div><br></div>-- <br>Semuonov Basil<br>--- Line of cut --- Linux everywhere...
</div>