You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@royale.apache.org by ca...@apache.org on 2018/03/29 19:57:43 UTC

[royale-asjs] branch feature/jewel-ui-set updated: some styles for alert

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

carlosrovira pushed a commit to branch feature/jewel-ui-set
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git


The following commit(s) were added to refs/heads/feature/jewel-ui-set by this push:
     new 1da1d8f  some styles for alert
1da1d8f is described below

commit 1da1d8f472ef2d14cedeadf67d7a8c3896408ea9
Author: Carlos Rovira <ca...@apache.org>
AuthorDate: Thu Mar 29 21:57:38 2018 +0200

    some styles for alert
---
 .../src/main/royale/ButtonPlayGround.mxml            |  9 +++++----
 .../projects/Jewel/src/main/resources/defaults.css   | 10 ++++++----
 .../org/apache/royale/jewel/beads/views/AlertView.as |  2 ++
 .../Jewel/src/main/sass/components/_alert.sass       | 20 +++++++++++---------
 4 files changed, 24 insertions(+), 17 deletions(-)

diff --git a/examples/royale/JewelExample/src/main/royale/ButtonPlayGround.mxml b/examples/royale/JewelExample/src/main/royale/ButtonPlayGround.mxml
index 6210078..41c6545 100644
--- a/examples/royale/JewelExample/src/main/royale/ButtonPlayGround.mxml
+++ b/examples/royale/JewelExample/src/main/royale/ButtonPlayGround.mxml
@@ -31,13 +31,14 @@ limitations under the License.
 			{
 				var alert:Alert = Alert.show("Are you sure ?", this, "Alert Title", Alert.OK | Alert.CANCEL);
 				//alert.height = 150;
-				//alert.addEventListener("close", onShowAlertAction);
+				alert.addEventListener("close", onShowAlertAction);
 			}
 			
-			/*private function onShowAlertAction(event:CloseEvent):void
+			private function onShowAlertAction(event:CloseEvent):void
 			{
-				alertStatus.text = "Alert status: " + event.detail;
-			}*/
+				trace("Hi!");
+				//alertStatus.text = "Alert status: " + event.detail;
+			}
 		]]>
 	</fx:Script>
 
diff --git a/frameworks/projects/Jewel/src/main/resources/defaults.css b/frameworks/projects/Jewel/src/main/resources/defaults.css
index 3e86f3f..b494eea 100644
--- a/frameworks/projects/Jewel/src/main/resources/defaults.css
+++ b/frameworks/projects/Jewel/src/main/resources/defaults.css
@@ -33,12 +33,13 @@
 .jewel.alert {
   position: fixed;
   z-index: 1;
-  left: 0;
-  right: 0;
-  top: 12%;
+  top: 50%;
+  left: 50%;
+  transform: translate(-50%, -50%);
   min-width: 400px;
   min-height: 210px;
-  overflow: auto;
+  max-width: 100%;
+  max-height: 100%;
   box-shadow: 0px 6px 60px -10px rgba(112, 112, 112, 0.7);
   background-color: #FFFFFF;
   border: 0px solid;
@@ -58,6 +59,7 @@
 }
 .jewel.alert .Group {
   padding: 10px 20px 20px 20px;
+  overflow: auto;
 }
 .jewel.alert .Group .jewel.label {
   font-size: 1.5em;
diff --git a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/views/AlertView.as b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/views/AlertView.as
index 8719a27..93f3eaf 100644
--- a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/views/AlertView.as
+++ b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/views/AlertView.as
@@ -175,6 +175,7 @@ package org.apache.royale.jewel.beads.views
             if( flags & Alert.OK )
             {
                 okButton = new TextButton();
+				okButton.primary = true;
                 okButton.text = alertModel.okLabel;
                 okButton.addEventListener("click",handleOK);
 
@@ -193,6 +194,7 @@ package org.apache.royale.jewel.beads.views
             if( flags & Alert.YES )
             {
                 yesButton = new TextButton();
+				yesButton.primary = true;
                 yesButton.text = alertModel.yesLabel;
                 yesButton.addEventListener("click",handleYes);
 
diff --git a/frameworks/projects/Jewel/src/main/sass/components/_alert.sass b/frameworks/projects/Jewel/src/main/sass/components/_alert.sass
index 158303a..5fc8248 100644
--- a/frameworks/projects/Jewel/src/main/sass/components/_alert.sass
+++ b/frameworks/projects/Jewel/src/main/sass/components/_alert.sass
@@ -20,18 +20,19 @@
 .jewel.alert
     position: fixed //avoid move with scroll 
     z-index: 1 // above rest of content
-    left: 0
-    right: 0
-    top: 12%
+    top: 50%
+    left: 50%
+    transform: translate(-50%, -50%)
     min-width: 400px
     min-height: 210px
-    overflow: auto  // if needed show let scroll
+    max-width: 100%
+    max-height: 100%
+    z-index: 1000
 
-    box-shadow: 0px 6px 60px -10px rgba(112,112,112,0.7)
-
-    background-color: #FFFFFF
-    border: 0px solid
-    border-radius: 10px
+    // box-shadow: 0px 6px 60px -10px rgba(112,112,112,0.7)
+    // background-color: #FFFFFF
+    // border: 0px solid
+    // border-radius: 10px
 
     .jewel.titlebar
         padding: 20px 20px 0px 20px
@@ -48,6 +49,7 @@
     
     .Group
         padding: 10px 20px 20px 20px
+        overflow: auto  // if needed show let scroll
 
         .jewel.label
             font:

-- 
To stop receiving notification emails like this one, please contact
carlosrovira@apache.org.