Dear EFL developers, 

Here is one feature for elc_ctxpopup
- elm_ctxpopup_background_dimmed_disabled_set
- elm_ctxpopup_background_dimmed_disabled_get

Please check then apply it.

Thank you very much ! 


Best Regards, 
Hermet 
Index: src/lib/elc_ctxpopup.c
===================================================================
--- src/lib/elc_ctxpopup.c      (revision 56080)
+++ src/lib/elc_ctxpopup.c      (working copy)
@@ -45,6 +45,7 @@
    Eina_Bool horizontal:1;
    Eina_Bool visible:1;
    Eina_Bool finished:1;
+   Eina_Bool bg_dimmed_disabled:1;
 };
 
 static const char *widtype = NULL;
@@ -731,12 +732,12 @@
 
    wd->visible = EINA_TRUE;
 
-   evas_object_show(wd->bg);
+   if (!wd->bg_dimmed_disabled)
+      edje_object_signal_emit(wd->bg, "elm,state,show", "elm");
+
    evas_object_show(wd->base);
    evas_object_show(wd->arrow);
 
-   edje_object_signal_emit(wd->bg, "elm,state,show", "elm");
-
    _sizing_eval(obj);
 }
 
@@ -748,7 +749,9 @@
    if (!wd)
       return;
 
-   evas_object_hide(wd->bg);
+   if (!wd->bg_dimmed_disabled)
+      edje_object_signal_emit(wd->bg, "elm,state,hide", "elm");
+
    evas_object_hide(wd->arrow);
    evas_object_hide(wd->base);
 
@@ -971,6 +974,7 @@
    evas_object_resize(wd->bg, w, h);
    edje_object_signal_callback_add(wd->bg, "elm,action,click", "",
                                    _bg_clicked_cb, obj);
+   evas_object_show(wd->bg);
 
    //Base
    wd->base = edje_object_add(e);
@@ -1561,3 +1565,61 @@
    if (fourth)
       *fourth = wd->dir_priority[3];
 }
+
+/**
+ * Enable/disable the dimmed background of a ctxpopup.
+ * When the background is disabled, 
+ * background dimmed effect for the ctxpopup does not work anymore.
+ * Moreover, user could not recieve a callback for the "dismissed" signal 
neither.
+ *
+ * @param obj Ctxpopup object
+ * @param disabled @c EINA_TRUE to disable it, @c EINA_FALSE to enable it
+ *
+ * @ingroup Ctxpopup
+ */
+EAPI void 
+elm_ctxpopup_background_dimmed_disabled_set(Evas_Object *obj, Eina_Bool 
disabled)
+{
+   ELM_CHECK_WIDTYPE(obj, widtype);
+   Widget_Data *wd;
+
+   wd = elm_widget_data_get(obj);
+   if (!wd)
+      return;
+
+   if (wd->bg_dimmed_disabled == disabled) 
+      return;
+
+   wd->bg_dimmed_disabled = !!disabled;
+
+   if(!wd->visible) return;
+
+   if (disabled)
+      edje_object_signal_emit(wd->bg, "elm,state,hide", "elm");
+   else
+      edje_object_signal_emit(wd->bg, "elm,state,show", "elm");
+}
+
+/**
+ * Get the value of background dimmed status.
+ *
+ * @param obj Ctxpopup object
+ *
+ * @return EINA_TRUE, when it is disabled. If @p obj is NULL
+ * EINA_FALSE is returned
+ *
+ * @ingroup Ctxpopup
+ */
+EAPI Eina_Bool 
+elm_ctxpopup_background_dimmed_disabled_get(const Evas_Object *obj)
+{
+   ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE;
+   Widget_Data *wd;
+
+   wd = elm_widget_data_get(obj);
+   if (!wd)
+      return;
+
+   return wd->bg_dimmed_disabled;
+}
+
Index: src/lib/Elementary.h.in
===================================================================
--- src/lib/Elementary.h.in     (revision 56080)
+++ src/lib/Elementary.h.in     (working copy)
@@ -2449,10 +2449,12 @@
    EAPI void          elm_ctxpopup_item_del(Elm_Ctxpopup_Item *item) 
EINA_ARG_NONNULL(1);
    EAPI void          elm_ctxpopup_item_disabled_set(Elm_Ctxpopup_Item *item, 
Eina_Bool disabled) EINA_ARG_NONNULL(1);
    EAPI Eina_Bool     elm_ctxpopup_item_disabled_get(const Elm_Ctxpopup_Item 
*item) EINA_ARG_NONNULL(1);
-   EAPI void         elm_ctxpopup_content_set(Evas_Object *obj, Evas_Object 
*content) EINA_ARG_NONNULL(1, 2);
+   EAPI void          elm_ctxpopup_content_set(Evas_Object *obj, Evas_Object 
*content) EINA_ARG_NONNULL(1, 2);
    EAPI Evas_Object  *elm_ctxpopup_content_unset(Evas_Object *obj) 
EINA_ARG_NONNULL(1);
-   EAPI void         elm_ctxpopup_direction_priority_set(Evas_Object *obj, 
Elm_Ctxpopup_Direction first, Elm_Ctxpopup_Direction second, 
Elm_Ctxpopup_Direction third, Elm_Ctxpopup_Direction fourth) 
EINA_ARG_NONNULL(1);
-   EAPI void         elm_ctxpopup_direction_priority_get(Evas_Object *obj, 
Elm_Ctxpopup_Direction *first, Elm_Ctxpopup_Direction *second, 
Elm_Ctxpopup_Direction *third, Elm_Ctxpopup_Direction *fourth) 
EINA_ARG_NONNULL(1);
+   EAPI void          elm_ctxpopup_direction_priority_set(Evas_Object *obj, 
Elm_Ctxpopup_Direction first, Elm_Ctxpopup_Direction second, 
Elm_Ctxpopup_Direction third, Elm_Ctxpopup_Direction fourth) 
EINA_ARG_NONNULL(1);
+   EAPI void          elm_ctxpopup_direction_priority_get(Evas_Object *obj, 
Elm_Ctxpopup_Direction *first, Elm_Ctxpopup_Direction *second, 
Elm_Ctxpopup_Direction *third, Elm_Ctxpopup_Direction *fourth) 
EINA_ARG_NONNULL(1);
+   EAPI void          elm_ctxpopup_background_dimmed_disabled_set(Evas_Object 
*obj, Eina_Bool disabled) EINA_ARG_NONNULL(1);
+   EAPI Eina_Bool     elm_ctxpopup_background_dimmed_disabled_get(const 
Evas_Object *obj) EINA_ARG_NONNULL(1);
    /* smart callbacks called:
     * "dismissed" - the ctxpopup was dismissed
     */
Index: data/themes/default.edc
===================================================================
--- data/themes/default.edc     (revision 56080)
+++ data/themes/default.edc     (working copy)
@@ -7803,36 +7803,40 @@
 ///////////////////////////////////////////////////////////////////////////////
    group { name: "elm/ctxpopup/bg/default";
       parts {
-         part { name: "ctxpopup_bg";
+         part { name: "bg";
             type: RECT;
             mouse_events: 1;
             description { state: "default" 0.0;
                color: 0 0 0 0;
+               visible: 0;
             }
             description { state: "visible" 0.0;
                inherit: "default" 0.0;
                color: 0 0 0 64;
+               visible: 1;
             }
          }
       }
       programs {
          program { name: "clicked_event";
             signal: "mouse,clicked,1";
-            source: "ctxpopup_bg";
+            source: "bg";
             action: SIGNAL_EMIT "elm,action,click" "";
          }
          program { name: "show";
             signal: "elm,state,show";
             source: "elm";
             action: STATE_SET "visible" 0.0;
-            target: "ctxpopup_bg";
+            target: "bg";
+            transition: "DECELERATE" 0.25;
          }
          program { name: "hide";
             signal: "elm,state,hide";
             source: "elm";
             action: STATE_SET "default" 0.0;
-            target: "ctxpopup_bg";
-         }       
+            target: "bg";
+            transition: "DECELERATE" 0.25;
+         }
       }
    }
 ///////////////////////////////////////////////////////////////////////////////
------------------------------------------------------------------------------
Protect Your Site and Customers from Malware Attacks
Learn about various malware tactics and how to avoid them. Understand 
malware threats, the impact they can have on your business, and how you 
can protect your company and customers by using code signing.
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
enlightenment-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to