You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@royale.apache.org by gr...@apache.org on 2021/12/15 00:59:04 UTC

[royale-asjs] 02/03: Fixes to TitleWindow for display of PanelTitleBar content

This is an automated email from the ASF dual-hosted git repository.

gregdove pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git

commit 1c8cda4d2aa0fe53df7ed72cb0c68f9e6b7878d3
Author: greg-dove <gr...@gmail.com>
AuthorDate: Wed Dec 15 13:53:55 2021 +1300

    Fixes to TitleWindow for display of PanelTitleBar content
---
 .../projects/MXRoyale/src/main/resources/defaults.css      |  9 +++++++++
 .../MXRoyale/src/main/royale/mx/containers/Panel.as        |  9 +++++----
 .../MXRoyale/src/main/royale/mx/containers/TitleWindow.as  | 14 ++++++++++----
 3 files changed, 24 insertions(+), 8 deletions(-)

diff --git a/frameworks/projects/MXRoyale/src/main/resources/defaults.css b/frameworks/projects/MXRoyale/src/main/resources/defaults.css
index 4ac02f9..2f40eb6 100644
--- a/frameworks/projects/MXRoyale/src/main/resources/defaults.css
+++ b/frameworks/projects/MXRoyale/src/main/resources/defaults.css
@@ -492,6 +492,15 @@ PanelTitleBar
 	padding-left: 1px;
 	padding-right: 1px;
 	border-bottom: 1px solid #333333;
+	display: flex /* added this because I don't see the layout bead working here, @todo investigate*/
+}
+
+PanelTitleBar .CloseButton {
+	position: absolute;
+	right: 5px;
+	top: 5px;
+	width: 16px;
+	height: 16px;
 }
 
 pop|PopUpManagerModal
diff --git a/frameworks/projects/MXRoyale/src/main/royale/mx/containers/Panel.as b/frameworks/projects/MXRoyale/src/main/royale/mx/containers/Panel.as
index 218a01c..9743163 100644
--- a/frameworks/projects/MXRoyale/src/main/royale/mx/containers/Panel.as
+++ b/frameworks/projects/MXRoyale/src/main/royale/mx/containers/Panel.as
@@ -1120,7 +1120,7 @@ public class Panel extends Container
      *  @private
      *  Storage for the titleIcon property.
      */ 
-    private var _titleIcon:Class;
+    private var _titleIcon:Object;
     
     /**
      *  @private
@@ -1128,7 +1128,7 @@ public class Panel extends Container
     private var _titleIconChanged:Boolean = false;
 
     [Bindable("titleIconChanged")]
-    [Inspectable(category="General", defaultValue="", format="EmbeddedFile")]
+ //   [Inspectable(category="General", defaultValue="", format="EmbeddedFile")]
 
     /**
      *  The icon displayed in the title bar.
@@ -1140,7 +1140,7 @@ public class Panel extends Container
      *  @playerversion AIR 1.1
      *  @productversion Flex 3
      */
-    public function get titleIcon():Class
+    public function get titleIcon():Object
     {
         return _titleIcon;
     }
@@ -1148,8 +1148,9 @@ public class Panel extends Container
     /**
      *  @private
      */
-    public function set titleIcon(value:Class):void
+    public function set titleIcon(value:Object):void
     {
+        //@todo deal with string (url) for Royale instead of Class
         _titleIcon = value;
         _titleIconChanged = true;
         
diff --git a/frameworks/projects/MXRoyale/src/main/royale/mx/containers/TitleWindow.as b/frameworks/projects/MXRoyale/src/main/royale/mx/containers/TitleWindow.as
index 79e13b3..af7572f 100644
--- a/frameworks/projects/MXRoyale/src/main/royale/mx/containers/TitleWindow.as
+++ b/frameworks/projects/MXRoyale/src/main/royale/mx/containers/TitleWindow.as
@@ -23,6 +23,7 @@ package mx.containers
 	import org.apache.royale.events.CloseEvent;
 	import org.apache.royale.html.beads.DragBead;
 	import org.apache.royale.events.IEventDispatcher;
+    import org.apache.royale.core.IPanelModel;
 	import mx.core.UIComponent;
 	import mx.containers.beads.PanelView;
 /*
@@ -275,11 +276,13 @@ public class TitleWindow extends Panel
      *  @playerversion AIR 1.1
      *  @productversion Royale 0.9.3
      */
-    private var _showCloseButton:Boolean = false;
-	
     public function get showCloseButton():Boolean
     {
-        return _showCloseButton;
+        var model:IPanelModel = this.model as IPanelModel;
+        if (model) {
+            return model.showCloseButton;
+        }
+        return false;
     }
 
     /**
@@ -287,7 +290,10 @@ public class TitleWindow extends Panel
      */
     public function set showCloseButton(value:Boolean):void
     {
-        _showCloseButton = value;
+        var model:IPanelModel = this.model as IPanelModel;
+        if (model) {
+            model.showCloseButton = value;
+        }
     }
 
     override public function addedToParent():void