Title: [127411] trunk/Tools
Revision
127411
Author
[email protected]
Date
2012-09-03 01:50:35 -0700 (Mon, 03 Sep 2012)

Log Message

[EFL] Fix resizing issues related to URL bar in Minibrowser / EWebLauncher
https://bugs.webkit.org/show_bug.cgi?id=95670

Patch by Christophe Dumez <[email protected]> on 2012-09-03
Reviewed by Kenneth Rohde Christiansen.

Fix layout issues related to the URL bar in Minibrowser
and EWebLauncher when the window is resized.

The URL bar was not resized accordingly and the Web
page was moved behing the URL bar, hiding part of it.

* EWebLauncher/main.c:
(on_ecore_evas_resize):
(closeWindow):
* EWebLauncher/url_bar.c:
(url_bar_width_set):
(url_bar_add):
* EWebLauncher/url_bar.h:
* MiniBrowser/efl/main.c:
(on_ecore_evas_resize):
(main):

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (127410 => 127411)


--- trunk/Tools/ChangeLog	2012-09-03 08:39:57 UTC (rev 127410)
+++ trunk/Tools/ChangeLog	2012-09-03 08:50:35 UTC (rev 127411)
@@ -1,3 +1,27 @@
+2012-09-03  Christophe Dumez  <[email protected]>
+
+        [EFL] Fix resizing issues related to URL bar in Minibrowser / EWebLauncher
+        https://bugs.webkit.org/show_bug.cgi?id=95670
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        Fix layout issues related to the URL bar in Minibrowser
+        and EWebLauncher when the window is resized.
+
+        The URL bar was not resized accordingly and the Web
+        page was moved behing the URL bar, hiding part of it.
+
+        * EWebLauncher/main.c:
+        (on_ecore_evas_resize):
+        (closeWindow):
+        * EWebLauncher/url_bar.c:
+        (url_bar_width_set):
+        (url_bar_add):
+        * EWebLauncher/url_bar.h:
+        * MiniBrowser/efl/main.c:
+        (on_ecore_evas_resize):
+        (main):
+
 2012-09-01  Xianzhu Wang  <[email protected]>
 
         [Chromium-Android] Remove hard-coded skipped directories in chromium_android.py

Modified: trunk/Tools/EWebLauncher/main.c (127410 => 127411)


--- trunk/Tools/EWebLauncher/main.c	2012-09-03 08:39:57 UTC (rev 127410)
+++ trunk/Tools/EWebLauncher/main.c	2012-09-03 08:50:35 UTC (rev 127411)
@@ -155,6 +155,21 @@
 static void closeWindow(Ecore_Evas *ee);
 static int browserCreate(const char *url, const char *theme, const char *userAgent, Eina_Rectangle geometry, const char *engine, const char *backingStore, unsigned char isFlattening, unsigned char isFullscreen, const char *databasePath);
 
+static ELauncher *
+find_app_from_ee(Ecore_Evas *ee)
+{
+    Eina_List *l;
+    void *data;
+
+    EINA_LIST_FOREACH(windows, l, data)
+    {
+        ELauncher *app = (ELauncher *) data;
+        if (app->ee == ee)
+            return app;
+    }
+    return NULL;
+}
+
 static void
 print_history(Eina_List *list)
 {
@@ -215,19 +230,24 @@
 static void
 on_ecore_evas_resize(Ecore_Evas *ee)
 {
+    ELauncher *app;
     Evas_Object *webview;
     Evas_Object *bg;
     int w, h;
 
     ecore_evas_geometry_get(ee, NULL, NULL, &w, &h);
 
+    /* Resize URL bar */
+    app = find_app_from_ee(ee);
+    url_bar_width_set(app->url_bar, w);
+
     bg = evas_object_name_find(ecore_evas_get(ee), "bg");
     evas_object_move(bg, 0, 0);
     evas_object_resize(bg, w, h);
 
     webview = evas_object_name_find(ecore_evas_get(ee), "browser");
-    evas_object_move(webview, 10, 10);
-    evas_object_resize(webview, w - 20, h - 20);
+    evas_object_move(webview, 0, URL_BAR_HEIGHT);
+    evas_object_resize(webview, w, h - URL_BAR_HEIGHT);
 }
 
 static void
@@ -743,15 +763,11 @@
 static void
 closeWindow(Ecore_Evas *ee)
 {
-    Eina_List *l;
-    void *app;
-    EINA_LIST_FOREACH(windows, l, app)
-    {
-        if (((ELauncher*) app)->ee == ee)
-            break;
-    }
+    ELauncher *app;
+
+    app = find_app_from_ee(ee);
     windows = eina_list_remove(windows, app);
-    url_bar_del(((ELauncher *)app)->url_bar);
+    url_bar_del(app->url_bar);
     browserDestroy(ee);
     free(app);
 }

Modified: trunk/Tools/EWebLauncher/url_bar.c (127410 => 127411)


--- trunk/Tools/EWebLauncher/url_bar.c	2012-09-03 08:39:57 UTC (rev 127410)
+++ trunk/Tools/EWebLauncher/url_bar.c	2012-09-03 08:50:35 UTC (rev 127411)
@@ -26,6 +26,7 @@
 #include "url_bar.h"
 
 #include <Edje.h>
+#include <Ecore_Evas.h>
 #include <Ecore_File.h>
 
 #define PADDING_SIZE 5
@@ -79,6 +80,16 @@
     edje_object_signal_emit(urlBar->entry, "entry,action,unfocus", "entry");
 }
 
+void
+url_bar_width_set(Url_Bar *urlBar, int width)
+{
+    evas_object_move(urlBar->area, 0, 0);
+    evas_object_resize(urlBar->area, width, URL_BAR_HEIGHT);
+
+    evas_object_move(urlBar->entry, PADDING_SIZE, PADDING_SIZE);
+    evas_object_resize(urlBar->entry, width - PADDING_SIZE * 2, URL_BAR_HEIGHT - PADDING_SIZE * 2);
+}
+
 Url_Bar *
 url_bar_add(Evas_Object *webView, int width)
 {
@@ -94,9 +105,6 @@
     url_bar->area = evas_object_rectangle_add(evas);
     evas_object_name_set(url_bar->area, "url_barArea");
     evas_object_color_set(url_bar->area, 255, 255, 255, 255);
-    evas_object_move(url_bar->area, 0, 0);
-    evas_object_resize(url_bar->area, width, URL_BAR_HEIGHT);
-    evas_object_show(url_bar->area);
 
     url_bar->entry = edje_object_add(evas);
     Eina_Bool ret = edje_object_file_set(url_bar->entry, THEME_DIR"/entry.edj", "control/entry/base/default");
@@ -108,9 +116,12 @@
     }
 
     edje_object_part_text_set(url_bar->entry, "url.text", "");
-    evas_object_move(url_bar->entry, PADDING_SIZE, PADDING_SIZE);
-    evas_object_resize(url_bar->entry, width - PADDING_SIZE * 2, URL_BAR_HEIGHT - PADDING_SIZE * 2);
+
+    /* Set URL bar dimensions and show it */
+    url_bar_width_set(url_bar, width);
+    evas_object_show(url_bar->area);
     evas_object_show(url_bar->entry);
+
     evas_object_event_callback_add(url_bar->entry, EVAS_CALLBACK_MOUSE_DOWN, on_urlbar_mouse_down, url_bar);
     evas_object_event_callback_add(url_bar->entry, EVAS_CALLBACK_KEY_DOWN, on_urlbar_key_down, url_bar);
     evas_object_event_callback_add(url_bar->entry, EVAS_CALLBACK_FOCUS_OUT, on_urlbar_focus_out, url_bar);

Modified: trunk/Tools/EWebLauncher/url_bar.h (127410 => 127411)


--- trunk/Tools/EWebLauncher/url_bar.h	2012-09-03 08:39:57 UTC (rev 127410)
+++ trunk/Tools/EWebLauncher/url_bar.h	2012-09-03 08:50:35 UTC (rev 127411)
@@ -43,6 +43,7 @@
 Url_Bar *url_bar_add(Evas_Object* webview, int width);
 void url_bar_del(Url_Bar *urlBar);
 void url_bar_url_set(Url_Bar *urlBar, const char *url);
+void url_bar_width_set(Url_Bar *urlBar, int width);
 
 #ifdef __cplusplus
 }

Modified: trunk/Tools/MiniBrowser/efl/main.c (127410 => 127411)


--- trunk/Tools/MiniBrowser/efl/main.c	2012-09-03 08:39:57 UTC (rev 127410)
+++ trunk/Tools/MiniBrowser/efl/main.c	2012-09-03 08:50:35 UTC (rev 127411)
@@ -45,6 +45,8 @@
     Url_Bar *url_bar;
 } MiniBrowser;
 
+MiniBrowser *browser;
+
 static const Ecore_Getopt options = {
     "MiniBrowser",
     "%prog [options] [url]",
@@ -87,13 +89,16 @@
 
     ecore_evas_geometry_get(ee, NULL, NULL, &w, &h);
 
+    /* Resize URL bar */
+    url_bar_width_set(browser->url_bar, w);
+
     bg = evas_object_name_find(ecore_evas_get(ee), "bg");
     evas_object_move(bg, 0, 0);
     evas_object_resize(bg, w, h);
 
     webview = evas_object_name_find(ecore_evas_get(ee), "browser");
-    evas_object_move(webview, 0, 0);
-    evas_object_resize(webview, w, h);
+    evas_object_move(webview, 0, URL_BAR_HEIGHT);
+    evas_object_resize(webview, w, h - URL_BAR_HEIGHT);
 }
 
 static void
@@ -283,7 +288,7 @@
     else
         url = ""
 
-    MiniBrowser *browser = browserCreate(url, engine);
+    browser = browserCreate(url, engine);
     if (!browser)
         return quit(EINA_FALSE, "ERROR: could not create browser.\n");
 
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to