Title: [206429] trunk/Tools
Revision
206429
Author
gyuyoung....@webkit.org
Date
2016-09-27 04:46:41 -0700 (Tue, 27 Sep 2016)

Log Message

[EFL] Locate color picker popup to center of window
https://bugs.webkit.org/show_bug.cgi?id=162540

Reviewed by Michael Catanzaro.

Color picker popup hasn't located in a center of main window, because
elm_win_center() function doesn't work correctly. It looks a bug.

To fix the problem, this patch uses evas_object_geometry_set() instead.

* MiniBrowser/efl/main.c:
(_color_picker_request_cb):

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (206428 => 206429)


--- trunk/Tools/ChangeLog	2016-09-27 11:24:46 UTC (rev 206428)
+++ trunk/Tools/ChangeLog	2016-09-27 11:46:41 UTC (rev 206429)
@@ -1,3 +1,18 @@
+2016-09-27  Gyuyoung Kim  <gyuyoung....@webkit.org>
+
+        [EFL] Locate color picker popup to center of window
+        https://bugs.webkit.org/show_bug.cgi?id=162540
+
+        Reviewed by Michael Catanzaro.
+
+        Color picker popup hasn't located in a center of main window, because
+        elm_win_center() function doesn't work correctly. It looks a bug.
+
+        To fix the problem, this patch uses evas_object_geometry_set() instead.
+
+        * MiniBrowser/efl/main.c:
+        (_color_picker_request_cb):
+
 2016-09-27  Michael Catanzaro  <mcatanz...@igalia.com>
 
         [GTK] Disable ACCELERATED_2D_CANVAS when using build-webkit

Modified: trunk/Tools/MiniBrowser/efl/main.c (206428 => 206429)


--- trunk/Tools/MiniBrowser/efl/main.c	2016-09-27 11:24:46 UTC (rev 206428)
+++ trunk/Tools/MiniBrowser/efl/main.c	2016-09-27 11:46:41 UTC (rev 206429)
@@ -60,6 +60,8 @@
 static Eina_Bool longpress_enabled = EINA_FALSE;
 static int window_width = 1000;
 static int window_height = 800;
+static int color_picker_width = 350;
+static int color_picker_height = 500;
 static int search_flags = EWK_FIND_OPTIONS_SHOW_HIGHLIGHT | EWK_FIND_OPTIONS_WRAP_AROUND | EWK_FIND_OPTIONS_CASE_INSENSITIVE;
 /* Default value of device_pixel_ratio is '0' so that we don't set custom device
  * scale factor unless it's required by the User. */
@@ -874,9 +876,13 @@
 
    evas_object_smart_callback_add(file_selector, "done", _fileselector_done_cb, fs_data);
 
-   evas_object_resize(elm_window, 400, 400);
-   elm_win_center(elm_window, EINA_TRUE, EINA_TRUE);
-   evas_object_show(elm_window);
+   int x, y, width, height;
+   evas_object_geometry_get(window->elm_window, &x, &y, &width, &height);
+
+   int picker_x = x + width / 2 - color_picker_width / 2;
+   int picker_y = y + height / 2 - color_picker_height / 2;
+   evas_object_geometry_set(window->color_selector.elm_selector_window, picker_x, picker_y,
+     color_picker_width, color_picker_height);
 }
 
 static void
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to