On Fri, Aug 21, 2009 at 14:15, Graham Cobb<[email protected]> wrote:
> On Friday 21 August 2009 13:53:01 Cornelius Hald wrote:
>> Sorry for being so slow, but I really don't get it :(
>
> You're not the only one! Doesn't make any sense to me either.
My interpretation:
* You set HILDON_PORTRAIT_MODE_SUPPORT _if_ the device is portrait
_before_ you open a window.
* You pick up events (DBus or size-changed depending on whether
you need orientation or just aspect) and then explicitly
set HILDON_PORTRAIT_MODE_REQUEST.
Presumably your code, once you refactor common stuff will be something like:
-------->8--------
function void startApplication() {
setPortraitFlagsIfAppropriate(window);
window.addListener('size-change') {
setPortraitFlagsIfAppropriate(window)
}
open(window);
}
function void setPortraitFlagsIfAppropriate(window) {
if (isPortrait())
window.set(HILDON_PORTRAIT_SUPPORT | HILDON_PORTRAIT_REQUEST)
else
window.unset(HILDON_PORTRAIT_SUPPORT | HILDON_PORTRAIT_REQUEST)
}
--------8<--------
Hope that helps,
Andrew
--
Andrew Flegg -- mailto:[email protected] | http://www.bleb.org/
Maemo Community Council chair
_______________________________________________
maemo-developers mailing list
[email protected]
https://lists.maemo.org/mailman/listinfo/maemo-developers