[maemo-developers] Howto enable portrait mode support on Fremantle
From: Cornelius Hald hald at icandy.deDate: Fri Aug 21 16:45:12 EEST 2009
- Previous message: Howto enable portrait mode support on Fremantle
- Next message: Howto enable portrait mode support on Fremantle
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Fri, 2009-08-21 at 14:26 +0100, Andrew Flegg wrote:
> 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.
Hmm, the only thing is you can only pick up size-changed events once the
size has changed :) Listening to the DBus events would be possible,
though.
> 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
Thanks for your interpretation. But the fact that an API needs
interpretation at all is quite a bit funny.
I'm getting the feeling that your interpretation is the right one. Still
I hope you're wrong, that would be probably the most cumbersome API I've
ever seen...
Cheers!
Conny
- Previous message: Howto enable portrait mode support on Fremantle
- Next message: Howto enable portrait mode support on Fremantle
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
