ecere/Android: Orientation change fixes; Status bar size tweaks
authorJerome St-Louis <jerome@ecere.com>
Wed, 27 Feb 2013 12:21:02 +0000 (07:21 -0500)
committerJerome St-Louis <jerome@ecere.com>
Wed, 27 Feb 2013 12:21:02 +0000 (07:21 -0500)
ecere/ecere.epj
ecere/src/gfx/drivers/OpenGLDisplayDriver.ec
ecere/src/gui/Window.ec
ecere/src/gui/controls/StatusBar.ec
ecere/src/gui/drivers/AndroidInterface.ec

index af8121d..2e6b381 100644 (file)
       {
          "Name" : "Android",
          "Options" : {
-            "Debug" : true,
-            "Optimization" : "None",
+            "Optimization" : "Speed",
             "PreprocessorDefinitions" : [
                "ECERE_NOFONTCONFIG",
                "_DEBUG"
                "../deps/freetype-2.3.12/include",
                "../deps/glext"
             ],
-            "FastMath" : false
+            "FastMath" : true
          },
          "Platforms" : [
             {
index 35bb45f..3f14600 100644 (file)
@@ -508,6 +508,8 @@ static bool egl_init_display(ANativeWindow* window)
    glViewport(0,0,w,h);
    glLoadIdentity();
    glOrtho(0,w,h,0,0.0,1.0);
+
+   currentVertexBuffer = 0;
    return true;
 }  
 
index 9339fee..8fba1a4 100644 (file)
@@ -39,8 +39,13 @@ import "WindowList"
 import "i18n"
 
 // Had to define this here for native decorations support, because the menu bar is part of total decoration's size, but not part of the system decorations
+#ifdef __ANDROID__
+define skinMenuHeight = 40;
+define statusBarHeight = 30;
+#else
 define skinMenuHeight = 25;
 define statusBarHeight = 18;
+#endif
 
 default extern int __ecereVMethodID___ecereNameSpace__ecere__gui__Window_OnKeyDown;
 
index fc970d9..64bc6c8 100644 (file)
@@ -72,7 +72,7 @@ private:
 
    bool OnResizing(int * w, int * h)
    {
-      *h = Max(*h, 18);
+      *h = Max(*h, statusBarHeight);
       if(!*w) *w = 80;
       return true;
    }
@@ -81,7 +81,7 @@ private:
    {
       StatusField field;
       int position = Max(clientSize.w, MIN_INFO_WIDTH + width)-1-2;
-      Box clip { 2, 2, MIN_INFO_WIDTH, 17 };
+      Box clip { 2, 2, MIN_INFO_WIDTH, statusBarHeight-1 };
       Window parent = this.parent;
 
       if(!guiApp.textMode)
@@ -94,7 +94,7 @@ private:
          surface.SetBackground(white);
          if(!guiApp.textMode)
          {
-            surface.ThinBevel(true, x - 2, 2, field.width + 4, 16);
+            surface.ThinBevel(true, x - 2, 2, field.width + 4, statusBarHeight-2);
             surface.SetForeground(field.colorSet ? field.color : foreground);
          }
          else
@@ -106,7 +106,7 @@ private:
          }
          if(field.text)
          {
-            Box clip { x, 2, x + field.width - 1, 17 };
+            Box clip { x, 2, x + field.width - 1, statusBarHeight-1 };
             int tw;
             surface.Clip(clip);
             surface.TextExtent(field.text, strlen(field.text), &tw, null);
index e75c8a0..1f7d07e 100644 (file)
@@ -594,6 +594,19 @@ class AndroidInterface : Interface
             }
          }
          */
+         if(gotInit)
+         {
+            int w = ANativeWindow_getWidth(androidActivity.window);
+            int h = ANativeWindow_getHeight(androidActivity.window);
+            if(desktopW != w || desktopH != h)
+            {
+               guiApp.SetDesktopPosition(0, 0, w, h, true);
+               desktopW = w;
+               desktopH = h;
+               guiApp.desktop.Update(null);
+            }
+         }
+
          eventAvailable = true;
          if(androidActivity.destroyRequested)
          {
@@ -1213,17 +1226,7 @@ class AndroidActivity : AndroidAppGlue
             break;
          case configChanged:
             if(window)
-            {
-               int w = ANativeWindow_getWidth(window);
-               int h = ANativeWindow_getHeight(window);
-               if(desktopW != w || desktopH != h)
-               {
-                  guiApp.SetDesktopPosition(0, 0, w, h, true);
-                  desktopW = w;
-                  desktopH = h;
-               }
-               guiApp.desktop.Update(null);
-            }
+               guiApp.desktop.UpdateDisplay();
             break;
       }
    }