Backport: elm/framespace: Get the framespace from the theme.
authorRafael Antognolli <rafael.antognolli@intel.com>
Tue, 21 May 2013 19:43:09 +0000 (16:43 -0300)
committerRafael Antognolli <rafael.antognolli@intel.com>
Thu, 13 Jun 2013 22:21:51 +0000 (19:21 -0300)
Additionally, if the frame object can't be created (no theme group
available), do not use it. This will enable us to have a borderless
elm theme.

ChangeLog
data/themes/widgets/border.edc
src/lib/elm_win.c

index 4f412ef37ed8dda59c207f56be5bafea2dd8a9df..38627141ed79359fcf193d2c6c5ffa62d7a3c517 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
 
 2013-06-11  Daniel Willmann
         * Make elm_tooltip more robust if not run inside X
+
+2013-06-13  Rafael Antognolli
+        * Get the framespace from the theme.
index f979a04ffb4f71b7776d3a2ec1df52d41e4802c0..35c4d9494cb98d1ab5bba88df15214c3770bcbd3 100644 (file)
@@ -24,7 +24,10 @@ color_classes {
 
 group {
    name: "elm/border/base/default";
-   data.item: "focus_highlight" "off";
+   data {
+      item: "focus_highlight" "off";
+      item: "framespace" "0 22 0 26";
+   }
    images {
       image: "bd_top.png" COMP;
       image: "bd_top_hilight.png" COMP;
index d46bacebd1462c2797afca6b1b993299f76b14b2..80a30354ba78e7ac7f023fd2e6c7711c7e6c481b 100644 (file)
@@ -2101,11 +2101,22 @@ static void
 _elm_win_frame_add(Elm_Win_Smart_Data *sd,
                    const char *style)
 {
-   evas_output_framespace_set(sd->evas, 0, 22, 0, 26);
+   const char *framespacestr;
+   int fx = 0, fy = 0, fw = 0, fh = 0;
 
    sd->frame_obj = edje_object_add(sd->evas);
-   elm_widget_theme_object_set
-     (ELM_WIDGET_DATA(sd)->obj, sd->frame_obj, "border", "base", style);
+   if (!elm_widget_theme_object_set
+       (ELM_WIDGET_DATA(sd)->obj, sd->frame_obj, "border", "base", style))
+     {
+        evas_object_del(sd->frame_obj);
+        sd->frame_obj = NULL;
+        return;
+     }
+
+   framespacestr = edje_object_data_get(sd->frame_obj, "framespace");
+   if (framespacestr)
+       sscanf(framespacestr, "%d %d %d %d", &fx, &fy, &fw, &fh);
+   evas_output_framespace_set(sd->evas, fx, fy, fw, fh);
 
    evas_object_is_frame_object_set(sd->frame_obj, EINA_TRUE);
    evas_object_move(sd->frame_obj, 0, 0);
@@ -3146,7 +3157,8 @@ elm_win_fullscreen_set(Evas_Object *obj,
                  ENGINE_COMPARE(ELM_WAYLAND_EGL))
                _elm_win_frame_add(sd, "default");
 
-             evas_object_show(sd->frame_obj);
+             if (sd->frame_obj)
+               evas_object_show(sd->frame_obj);
           }
 
         TRAP(sd, fullscreen_set, fullscreen);