Patch Messaging Landscape Orientation

From WebOS Internals
Revision as of 20:23, 1 September 2009 by Fritos1406 (talk | contribs)
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

Landscape Orientation in Messagin app:

first file we should edit is /usr/palm/applications/com.palm.app.messaging/app/controllers/compose-assistant.js around line 390 u will see this:

  var ComposeAssistant = Class.create({
   }
 	this.setCharacterCounterMaxLength();
   },

add this code right under it

	orientationChanged: function(orientation) {
		if (orientation === "left" || orientation === "right") {
			this.controller.sceneElement.addClassName('landscape');
		} else {
			this.controller.sceneElement.removeClassName('landscape');
		}
	},

once you are done it should look like this:

var ComposeAssistant = Class.create({
     }
 	this.setCharacterCounterMaxLength();
   },
	
	orientationChanged: function(orientation) {
		if (orientation === "left" || orientation === "right") {
			this.controller.sceneElement.addClassName('landscape');
		} else {
			this.controller.sceneElement.removeClassName('landscape');
		}
	},
   
   cleanup: function() {
     var that = this;

now save and exit. new file we should edit is /usr/palm/applications/com.palm.app.messaging/app/controllers/listview-assistant.js around line 212 under var ListviewAssistant = Class.create(App e in the line:

this.controller.setupWidget(Mojo.Menu.commandMenu, {}, this.cmdMenuModel);<pre>
edit it so that it looks like this then right under it add:
<pre>this.controller.setupWidget(Mojo.Menu.commandMenu, undefined, this.cmdMenuModel);			
	// enable free orientation
	this.controller.window.PalmSystem.setWindowOrientation("free");

should look like:

var ListviewAssistant = Class.create(App
 		items:this.commandMenuModel 
     };  
 	
   this.controller.setupWidget(Mojo.Menu.commandMenu, undefined, this.cmdMenuModel);	
			
	// enable free orientation
	this.controller.window.PalmSystem.setWindowOrientation("free");
 	this.filterField = this.controller.get('filterField');
 	this.buddyListHeader = this.controller.get('buddyListHeader');
     this.controller.setupWidget('filterField',{filterFieldName:'filterFieldElement'},this.filterField);

then around line 409 above handleCommand: function(event) { add :

+		
		orientationChanged: function(orientation) {
		if (orientation === "left" || orientation === "right") {
			this.controller.sceneElement.addClassName('landscape');
		} else {
			this.controller.sceneElement.removeClassName('landscape');
		}
	},

this is how it should look like:

 			}			
 		}
 	},
		orientationChanged: function(orientation) {
		if (orientation === "left" || orientation === "right") {
			this.controller.sceneElement.addClassName('landscape');
		} else {
			this.controller.sceneElement.removeClassName('landscape');
		}
	},
 
 	handleCommand: function(event) {
     	// handle menu button command events