elm_panel: show/hide panel according to hidden status
authorJaeun Choi <jaeun12.choi@samsung.com>
Mon, 21 Jan 2019 09:55:10 +0000 (18:55 +0900)
committerJunsuChoi <jsuya.choi@samsung.com>
Thu, 24 Jan 2019 05:20:18 +0000 (14:20 +0900)
when panel becomes non-scrollable by elm_panel_scrollable_set() function,
the panel needs to be shown/hidden according to the hidden status.
this patch implements it.

data/elementary/themes/edc/elm/panel.edc
src/lib/elementary/elm_panel.c

index 02dbdad..3f34c7c 100644 (file)
@@ -542,6 +542,21 @@ group { name: "elm/panel/left/default";
          }
       }
       program {
+         signal: "elm,action,show,no_animate"; source: "elm";
+         action: STATE_SET "default" 0.0;
+         target: "elm.swallow.event";
+         target: "base";
+      }
+      program {
+         signal: "elm,action,show,no_animate"; source: "elm";
+         script {
+            if (get_int(is_rtl) == 0)
+              set_state(PART:"icn", "default", 0.0);
+            else
+              set_state(PART:"icn", "hidden", 0.0);
+         }
+      }
+      program {
          signal: "edje,state,rtl"; 
          source: "edje";
          script {
@@ -612,6 +627,46 @@ group { name: "elm/panel/left/default";
          target: "base";
       }
       program {
+         signal: "elm,action,hide,no_animate"; source: "elm";
+         action: STATE_SET "hidden" 0.0;
+         target: "elm.swallow.event";
+      }
+      program {
+         signal: "elm,action,hide,no_animate"; source: "elm";
+         script {
+            if (get_int(is_rtl) == 0)
+              set_state(PART:"icn", "hidden", 0.0);
+            else
+              set_state(PART:"icn", "default", 0.0);
+         }
+      }
+      program { name: "hide1_no_animate";
+         signal: "elm,action,hide,no_animate"; source: "elm";
+         script {
+            new x, y, w, h;
+            if (get_int(is_rtl) == 0)
+              {
+                 custom_state(PART:"base", "default", 0.0);
+                 set_state_val(PART:"base", STATE_REL1, -1.0, 0.0);
+                 get_geometry(PART:"elm.swallow.event", x, y, w, h);
+                 set_state_val(PART:"base", STATE_REL1_OFFSET, w, 0);
+               }
+            else
+              {
+                 custom_state(PART:"base", "default", 0.0);
+                 set_state_val(PART:"base", STATE_REL1, -1.0, 0.0);
+                 set_state_val(PART:"base", STATE_REL2, -2.0, 1.0);
+                 get_geometry(PART:"elm.swallow.event", x, y, w, h);
+                 set_state_val(PART:"base", STATE_REL2_OFFSET, -w, 0);
+              }
+         }
+         after: "hide2_no_animate";
+      }
+      program { name: "hide2_no_animate";
+         action: STATE_SET "custom" 0.0;
+         target: "base";
+      }
+      program {
          signal: "elm,action,focus_highlight,show"; source: "elm";
          action: STATE_SET "focused" 0.0;
          transition: ACCELERATE 0.2;
index ea25639..44fea69 100644 (file)
@@ -1559,6 +1559,20 @@ _elm_panel_scrollable_set(Eo *obj, Elm_Panel_Data *sd, Eina_Bool scrollable)
 
         _orient_set_do(obj);
 
+        if (sd->hidden)
+          {
+             elm_layout_signal_emit(obj, "elm,action,hide,no_animate", "elm");
+             evas_object_repeat_events_set(obj, EINA_TRUE);
+          }
+        else
+          {
+             elm_layout_signal_emit(obj, "elm,action,show,no_animate", "elm");
+             evas_object_repeat_events_set(obj, EINA_FALSE);
+          }
+
+        elm_widget_tree_unfocusable_set(obj, sd->hidden);
+        edje_object_message_signal_process(sd->panel_edje);
+
         evas_object_hide(sd->scr_ly);
         elm_layout_content_unset(sd->scr_ly, "elm.swallow.content");
         // TIZEN_ONLY(20171109): show and hide necessary object when scrollable is set