2002/07/16 01:27:39
authormegacz <megacz@xwt.org>
Fri, 30 Jan 2004 06:49:04 +0000 (06:49 +0000)
committermegacz <megacz@xwt.org>
Fri, 30 Jan 2004 06:49:04 +0000 (06:49 +0000)
darcs-hash:20040130064904-2ba56-a64e050df9ab9dda0572881ad0be78a1d72d420f.gz

src/org/xwt/builtin/progress.png [new file with mode: 0644]
src/org/xwt/builtin/splash.xwt

diff --git a/src/org/xwt/builtin/progress.png b/src/org/xwt/builtin/progress.png
new file mode 100644 (file)
index 0000000..d8eb593
--- /dev/null
@@ -0,0 +1,5 @@
+\89PNG\r
+\1a
+
+
+\b\ 6
index aba4a34..3d2f595 100644 (file)
@@ -2,8 +2,8 @@
 
     <template thisbox="window" orient="vertical">
 
-        width = $inner.width;
-        height = $inner.height;
+        minwidth = maxwidth = $inner.width;
+        minheight = maxheight = $inner.height;
         x = (xwt.screenWidth - width) / 2;
         y = (xwt.screenHeight - height) / 2;
 
             xwt.loadArchive(origin, function(num, den) {
                     $left.flex = 50 * (num / den);
                     $right.flex = 50 + 50 * (1.0 - num /den);
-                    $status.text = "Downloading: " + xwt.math.ceil(num * 100 / den) + "% [" + num + " bytes]";
+                    var pct = xwt.math.ceil(num * 100 / den);
+                    if (1024 > num) {
+                        num = "" + num + " bytes";
+                    } else if (1024 * 1024 > num) {
+                        num = "" + xwt.math.ceil(num / 1024) + "kb";
+                    } else {
+                        num = "" + xwt.math.ceil(num / (1024 * 1024)) + "Mb";
+                    }
+                    $status.text = "Downloading: " + pct + "% [" + num + "]";
                 });
 
             xwt.newBox("main", function(num, den) {
                     $left.flex = 50 + 50 * (num / den);
                     $right.flex = 50 * (1.0 - num / den);
+                    if ($right.flex == 0) $right.width = 0;
                     $status.text = "Initializing: " + xwt.math.ceil(num * 100 / den) + "%";
-                    xwt.yield();
                 });
 
             thisbox = null;
         <box absolute="true" sizetoimage="true" id="inner" image="org.xwt.builtin.lithium"/>
 
         <box/>
-        <box text="Downloading user interface..." vshrink="true" hpad="20" vpad="3" id="status" textcolor="white"/>
-
-        <box vpad="5" hpad="30" height="20">
-            <box color="red" flex="0.0" id="left"/>
-            <box flex="100.0" id="right" color="blue"/>
+        <box text="Downloading user interface..." vshrink="true" hpad="30" vpad="3" id="status" textcolor="white"/>
+        <box hpad="4" height="10">
+            <box width="25"/>
+            <box flex="0.0" image="org.xwt.builtin.progress" tile="true" id="left"/>
+            <box flex="100.0" id="right"/>
         </box>
+        <box height="5"/>
 
     </template>