Fixed a bug where the app halts when running on different screen sizes 73/3273/1 2.0 accepted/2.0/20130405.191924 submit/2.0/20130405.195000
authorJimmy Huang <jimmy.huang@intel.com>
Wed, 3 Apr 2013 17:51:45 +0000 (10:51 -0700)
committerJimmy Huang <jimmy.huang@intel.com>
Wed, 3 Apr 2013 17:51:45 +0000 (10:51 -0700)
The memo app have some hard-coded property that only works for running in
480x800, 600x1024 and 720x1280.  This causes the program to halt when it
runs in different screen resolution or orientations, since it looking those
non-existing properties causes elementary to throw out errors.  This patch
makes it so that all screen sizes will map to the same height property used
so it is more generic and no longer dependent on certain screen width and
height.

Signed-off-by: Jimmy Huang <jimmy.huang@intel.com>
edc/common.edc
edc/doodle_editor.edc
edc/doodle_viewer.edc
edc/text_editor.edc
src/memo_doodle_editor.c
src/memo_doodle_viewer.c
src/memo_text_editor.c

index fbe08f4..320bce0 100644 (file)
@@ -80,6 +80,7 @@ group{
     }
 }
 
+#define IMF_HEIGHT_DEFAULT 550
 #define IMF_HEIGHT_480_800 538
 #define IMF_HEIGHT_600_1024 550
 #define IMF_HEIGHT_720_1280 580
index 614dc15..6065692 100644 (file)
@@ -107,6 +107,7 @@ group{\
     }/* end programs */\
 }
 
+DOODLE_EDITOR("doodle_editor", IMF_HEIGHT_DEFAULT)
 DOODLE_EDITOR("doodle_editor_480_800", IMF_HEIGHT_480_800)
 DOODLE_EDITOR("doodle_editor_600_1024", IMF_HEIGHT_600_1024)
 DOODLE_EDITOR("doodle_editor_720_1280", IMF_HEIGHT_720_1280)
index a9851fb..89d728f 100644 (file)
@@ -64,6 +64,7 @@ group {\
     }/* end programs */\
 }
 
+DOODLE_VIEWER("doodle_viewer", IMF_HEIGHT_DEFAULT)
 DOODLE_VIEWER("doodle_viewer_480_800", IMF_HEIGHT_480_800)
 DOODLE_VIEWER("doodle_viewer_600_1024", IMF_HEIGHT_600_1024)
 DOODLE_VIEWER("doodle_viewer_720_1280", IMF_HEIGHT_720_1280)
index fc14e0f..48592b5 100644 (file)
@@ -62,6 +62,7 @@ group{\
     }/* end programs */\
 }
 
+TEXT_EDITOR("text_editor", IMF_HEIGHT_DEFAULT)
 TEXT_EDITOR("text_editor_480_800", IMF_HEIGHT_480_800)
 TEXT_EDITOR("text_editor_600_1024", IMF_HEIGHT_600_1024)
 TEXT_EDITOR("text_editor_720_1280", IMF_HEIGHT_720_1280)
index e8855ef..c96e283 100644 (file)
@@ -442,10 +442,12 @@ static void _on_text_mode(void *data, Evas_Object *obj, void *event_info)
 
 static void _create_doodle_editor_layout(doodle_editor_t *de, service_h service)
 {
+/*
        int w = 0;
        int h = 0;
        ecore_x_window_size_get(ecore_x_window_root_first_get(), &w, &h);
-       snprintf(de->buf, MEMO_BUFFER_SIZE, "doodle_editor_%d_%d", w, h);
+*/
+       snprintf(de->buf, MEMO_BUFFER_SIZE, "doodle_editor");
        de->body_main = elm_layout_create(de->parent, EDJ_FILE, de->buf);
        de->cb(de->data, "layout", de->body_main);
        /* title */
index f301f49..632a21b 100644 (file)
@@ -153,10 +153,12 @@ static void _input_panel_event_callback(void *data, Ecore_IMF_Context *ctx, int
 
 static void _create_doodle_viewer_layout(doodle_viewer_t *dv, service_h service)
 {
+/*
        int w = 0;
        int h = 0;
        ecore_x_window_size_get(ecore_x_window_root_first_get(), &w, &h);
-       snprintf(dv->buf, MEMO_BUFFER_SIZE, "doodle_viewer_%d_%d", w, h);
+*/
+       snprintf(dv->buf, MEMO_BUFFER_SIZE, "doodle_viewer");
        dv->body_main = elm_layout_create(dv->parent, EDJ_FILE, dv->buf);
        dv->cb(dv->data, "layout", dv->body_main);
 
index 8ee9a6f..99c0cdc 100644 (file)
@@ -336,10 +336,12 @@ static void _on_drawing_mode(void *data, Evas_Object *obj, void *event_info)
 static void _create_text_editor_layout(text_editor_t *te, service_h service)
 {
     MEMO_FUN_BEG();
+/*
     int w = 0;
     int h = 0;
     ecore_x_window_size_get(ecore_x_window_root_first_get(), &w, &h);
-    snprintf(te->buf, MEMO_BUFFER_SIZE, "text_editor_%d_%d", w, h);
+*/
+    snprintf(te->buf, MEMO_BUFFER_SIZE, "text_editor");
     te->body_main = elm_layout_create(te->parent, EDJ_FILE, te->buf);
     te->cb(te->data, "layout", te->body_main);
     /* title */