         else // titleAlign is center
         {
             var tf:TextFormat = new TextFormat();
-            tf.align = TextFormatAlign.CENTER;
+            tf.align = TextFormatAlign.LEFT;
             titleTextField.setTextFormat(tf);
 
+            var titleX:Number;
+            var textWidth:Number = titleTextField.getLineMetrics( 0 ).width;
+            titleTextField.truncateToFit();
+            
             if (buttonAlign == "left")
+            {
+                titleTextField.setActualSize(
+                    width - rightOffset - buttonsX - 2,
+                    measureChromeText(titleTextField).height +
+                    UITextField.TEXT_HEIGHT_PADDING);
+
+                titleX = Math.max(buttonsX, (width - leftOffset - rightOffset - textWidth)/2);
+                
+                titleTextField.move(titleX,
+                    (height - (measureChromeText(titleTextField).height +
+                    UITextField.TEXT_HEIGHT_PADDING))/2);
+            }
+            else
             {
                 titleTextField.setActualSize(
                     width - leftOffset - rightOffset -
-                    Math.max((closeButton.x + closeButton.measuredWidth),
-                    (minimizeButton.x + minimizeButton.measuredWidth),
-                    (maximizeButton.x + maximizeButton.measuredWidth)) - 2,
+                    (width - buttonsX) - 2,
                     measureChromeText(titleTextField).height +
                     UITextField.TEXT_HEIGHT_PADDING);
 
+                titleX = Math.max(0, Math.min(buttonsX - textWidth - 2, (width - leftOffset - rightOffset - textWidth)/2));
+                
                 titleTextField.move(
-                    Math.max((closeButton.x + closeButton.measuredWidth),
-                    (minimizeButton.x + minimizeButton.measuredWidth),
-                    (maximizeButton.x + maximizeButton.measuredWidth)),
+                    titleX,
                     (height - (measureChromeText(titleTextField).height +
                     UITextField.TEXT_HEIGHT_PADDING))/2);
-
-                titleTextField.truncateToFit();
-            }
-            else
-            {
-                titleTextField.setActualSize(
-                    width - leftOffset - rightOffset -
-                    (width - Math.min(closeButton.x,
-                    minimizeButton.x, maximizeButton.x)) - 2,
-                    measureChromeText(titleTextField).height +
-                    UITextField.TEXT_HEIGHT_PADDING);
-
-                titleTextField.move(
-                    leftOffset,
-                    (height - (measureChromeText(titleTextField).height +
-                    UITextField.TEXT_HEIGHT_PADDING))/2);
-
-                titleTextField.truncateToFit();
             }
         }
     }

            else
            {
                titleTextField.setActualSize(
                    Math.max(0, Math.min(
                    width - leftOffset - rightOffset,
                    minimizeButton.x )) - 2,
                    measureChromeText(titleTextField).height +
                    UITextField.TEXT_HEIGHT_PADDING);


import flash.display.NativeWindowDisplayState;
import flash.events.Event;
import flash.events.MouseEvent;
import flash.geom.Rectangle;
import flash.system.Capabilities;
import flash.text.TextFormat;
import flash.text.TextFormatAlign;

import mx.controls.Button;
import mx.core.IFlexDisplayObject;
import mx.core.IUITextField;
import mx.core.IWindow;
import mx.core.UIComponent;
import mx.core.UITextField;
import mx.core.mx_internal;
import mx.styles.ISimpleStyleClient;
import mx.styles.IStyleClient;

use namespace mx_internal;

