From: Jerome St-Louis Date: Wed, 27 Feb 2013 12:21:02 +0000 (-0500) Subject: ecere/Android: Orientation change fixes; Status bar size tweaks X-Git-Tag: 0.44.04~88 X-Git-Url: http://ecere.com/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=aefb1b9375fe3b180fee2d5eb876caa956d8e7c0;p=sdk ecere/Android: Orientation change fixes; Status bar size tweaks --- diff --git a/ecere/ecere.epj b/ecere/ecere.epj index af8121d..2e6b381 100644 --- a/ecere/ecere.epj +++ b/ecere/ecere.epj @@ -331,8 +331,7 @@ { "Name" : "Android", "Options" : { - "Debug" : true, - "Optimization" : "None", + "Optimization" : "Speed", "PreprocessorDefinitions" : [ "ECERE_NOFONTCONFIG", "_DEBUG" @@ -345,7 +344,7 @@ "../deps/freetype-2.3.12/include", "../deps/glext" ], - "FastMath" : false + "FastMath" : true }, "Platforms" : [ { diff --git a/ecere/src/gfx/drivers/OpenGLDisplayDriver.ec b/ecere/src/gfx/drivers/OpenGLDisplayDriver.ec index 35bb45f..3f14600 100644 --- a/ecere/src/gfx/drivers/OpenGLDisplayDriver.ec +++ b/ecere/src/gfx/drivers/OpenGLDisplayDriver.ec @@ -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; } diff --git a/ecere/src/gui/Window.ec b/ecere/src/gui/Window.ec index 9339fee..8fba1a4 100644 --- a/ecere/src/gui/Window.ec +++ b/ecere/src/gui/Window.ec @@ -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; diff --git a/ecere/src/gui/controls/StatusBar.ec b/ecere/src/gui/controls/StatusBar.ec index fc970d9..64bc6c8 100644 --- a/ecere/src/gui/controls/StatusBar.ec +++ b/ecere/src/gui/controls/StatusBar.ec @@ -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); diff --git a/ecere/src/gui/drivers/AndroidInterface.ec b/ecere/src/gui/drivers/AndroidInterface.ec index e75c8a0..1f7d07e 100644 --- a/ecere/src/gui/drivers/AndroidInterface.ec +++ b/ecere/src/gui/drivers/AndroidInterface.ec @@ -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; } }