Patch Messaging Landscape Orientation

From WebOS Internals

Revision as of 10:06, 19 October 2009 by Hopspitfire (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search


Landscape Orientation in Messagin App:


MUST BE IN [root@castle:/#] TO INSTALL

cd /opt/src/modifications
git pull
cd /
quilt import /opt/src/modifications/message-orientation.patch
quilt push -a -f

to apply this patch just copy the above how-to and then you will be done..thats it !!




Manually doing this patch you will have to put the codes in the patch in their corresponding places..


PATCH CODE

Index: /usr/palm/applications/com.palm.app.messaging/app/controllers/chatview-assistant.js
===================================================================
--- .orig/usr/palm/applications/com.palm.app.messaging/app/controllers/chatview-assistant.js
+++ /usr/palm/applications/com.palm.app.messaging/app/controllers/chatview-assistant.js
@@ -97,7 +97,9 @@ var ChatviewAssistant = Class.create({
 	
 	setup: function(){	
 		this.controller.setupWidget(Mojo.Menu.appMenu, this.appMenuAttrs, this.appMenuModel);
-		
+	
+	// enable free orientation
+	this.controller.window.PalmSystem.setWindowOrientation("free");		
 		var messageTextWidgetAttributes = {
 			modelProperty: 'value',
 			hintText: $L('Enter message here...'),
@@ -196,6 +198,14 @@ var ChatviewAssistant = Class.create({
 			this.handleFocus();
 		}		
 	},
+ 
+	orientationChanged: function(orientation) {
+		if (orientation === "left" || orientation === "right") {
+			this.controller.sceneElement.addClassName('landscape');
+		} else {
+			this.controller.sceneElement.removeClassName('landscape');
+		}
+	},
 
 	cleanup: function(){
 		this.chatViewHeaderClickTarget.stopObserving(Mojo.Event.tap, this.handleHeaderTap);
Index: /usr/palm/applications/com.palm.app.messaging/app/controllers/compose-assistant.js
===================================================================
--- .orig/usr/palm/applications/com.palm.app.messaging/app/controllers/compose-assistant.js
+++ /usr/palm/applications/com.palm.app.messaging/app/controllers/compose-assistant.js
@@ -73,7 +73,9 @@ var ComposeAssistant = Class.create({
 
   setup: function() {
     this.controller.setupWidget(Mojo.Menu.appMenu, this.appMenuAttrs, this.appMenuModel);
-
+	
+    // enable free orientation
+	this.controller.window.PalmSystem.setWindowOrientation("free");
 	this.searchList = {
 		"property": "to$A",
 		"includeEmails": false,
@@ -386,6 +388,14 @@ 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;
Index: /usr/palm/applications/com.palm.app.messaging/app/controllers/listview-assistant.js
===================================================================
--- .orig/usr/palm/applications/com.palm.app.messaging/app/controllers/listview-assistant.js
+++ /usr/palm/applications/com.palm.app.messaging/app/controllers/listview-assistant.js
@@ -212,8 +212,10 @@ var ListviewAssistant = Class.create(App
 		items:this.commandMenuModel 
     };  
 	
-    this.controller.setupWidget(Mojo.Menu.commandMenu, {}, this.cmdMenuModel);	
-	
+    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);
@@ -1086,7 +1088,15 @@ var ListviewAssistant = Class.create(App
   loadDebugView: function() {
     this.controller.stageController.pushScene('debug');
   },		  
-	  
+
+  orientationChanged: function(orientation) {
+		if (orientation === "left" || orientation === "right") {
+			this.controller.sceneElement.addClassName('landscape');
+		} else {
+			this.controller.sceneElement.removeClassName('landscape');
+		}
+	},
+  
   cleanup: function() {
 	// save the listview state
 	MessagingMojoService.setIsHistoryViewSelected(this.controller,(this.currentListView == this.Messaging.Views.HISTORY));
Index: /usr/palm/applications/com.palm.app.messaging/stylesheets/messaging.css
===================================================================
--- .orig/usr/palm/applications/com.palm.app.messaging/stylesheets/messaging.css
+++ /usr/palm/applications/com.palm.app.messaging/stylesheets/messaging.css
@@ -642,10 +642,10 @@ img.avatar-overlay {
 }
 
 .their-chat .message-container {
-	width: 255px;
+	width: 85%;
 }
 .my-chat .message-container {
-	width: 280px;
+	width: 95%;
 }
 .chat-entry .chat-balloon {
 	min-height: 26px;
@@ -823,7 +823,7 @@ img.avatar-overlay {
 	position: fixed;
 	bottom:0px;
 	left:0px;
-	width: 320px;
+	width: 100%;
 }
 
 #messageContainer #messageTextWidget {


Credits: FRITOS1406

Personal tools
Google AdSense