segment_control: check item disable
authorSubodh Kumar <s7158.kumar@samsung.com>
Wed, 6 Jan 2016 19:26:18 +0000 (11:26 -0800)
committerCedric BAIL <cedric@osg.samsung.com>
Wed, 6 Jan 2016 19:26:24 +0000 (11:26 -0800)
Summary:
Elm segment_control: check item disable

Signed-off by: @adrien

Refer T2883

@fix

Test Plan: NA

Reviewers: cedric

Subscribers: adrien

Projects: #elementary

Differential Revision: https://phab.enlightenment.org/D3531

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
legacy/elementary/src/lib/elm_segment_control.c

index 68d46da..2b6452a 100644 (file)
@@ -202,7 +202,8 @@ _update_list(Elm_Segment_Control_Data *sd)
         else
           edje_object_signal_emit(VIEW(it), "elm,state,segment,normal", "elm");
 
-        if (elm_widget_disabled_get(sd->obj))
+        if (elm_widget_disabled_get(sd->obj)
+            || elm_object_item_disabled_get(eo_it))
           edje_object_signal_emit(VIEW(it), "elm,state,disabled", "elm");
         else
           edje_object_signal_emit(VIEW(it), "elm,state,enabled", "elm");
@@ -309,6 +310,8 @@ _segment_on(Elm_Segment_Control_Item_Data *it)
 
    if (it == sd->selected_item) return;
 
+   if (elm_object_item_disabled_get(EO_OBJ(it))) return;
+
    if (sd->selected_item) _segment_off(sd->selected_item);
 
    edje_object_signal_emit(VIEW(it), "elm,state,segment,selected", "elm");