forked from enlightenment/efl
Fileselector: Add a wheel spinner that show/spin while EIO is working
SVN revision: 71178
This commit is contained in:
parent
728f4210c2
commit
5872d450d7
|
@ -68,3 +68,7 @@
|
|||
genlist from contracting to min size.
|
||||
* Optimize the case of COMPRESS + homogeneous mode to avoid
|
||||
queue entirely and use existing known item sizes.
|
||||
|
||||
2012-05-16 Dave Andreoli
|
||||
|
||||
* Fileselector: Add a wheel spinner that show/spin while EIO is working
|
||||
|
|
|
@ -7,6 +7,7 @@ Additions:
|
|||
|
||||
* Focus can be moved in all directions by elm_widget_focus_go function.
|
||||
* Reload theme when it change on disk.
|
||||
* Fileselector: Add a wheel spinner that show/spin while EIO is working
|
||||
|
||||
Fixes:
|
||||
|
||||
|
|
|
@ -47,6 +47,29 @@ group { name: "elm/fileselector/base/default";
|
|||
}
|
||||
}
|
||||
}
|
||||
part { name: "elm.spinner.clip";
|
||||
type: RECT;
|
||||
description { state: "default" 0.0;
|
||||
rel1.to: "elm.swallow.spinner";
|
||||
rel2.to: "elm.swallow.spinner";
|
||||
color: 255 255 255 0;
|
||||
}
|
||||
description { state: "visible" 0.0;
|
||||
inherit: "default" 0.0;
|
||||
color: 255 255 255 255;
|
||||
}
|
||||
}
|
||||
part { name: "elm.swallow.spinner";
|
||||
type: SWALLOW;
|
||||
clip_to: "elm.spinner.clip";
|
||||
description { state: "default" 0.0;
|
||||
align: 1.0 0.0;
|
||||
min: 10 10;
|
||||
fixed: 1 1;
|
||||
rel1.relative: 1.0 0.0;
|
||||
rel2.relative: 1.0 0.0;
|
||||
}
|
||||
}
|
||||
part { name: "elm.swallow.files";
|
||||
type: SWALLOW;
|
||||
description { state: "default" 0.0;
|
||||
|
@ -128,6 +151,30 @@ group { name: "elm/fileselector/base/default";
|
|||
}
|
||||
}
|
||||
}
|
||||
programs {
|
||||
program { name: "spinner_show";
|
||||
signal: "elm,action,spinner,show";
|
||||
source: "elm";
|
||||
action: STATE_SET "visible" 0.0;
|
||||
transition: LINEAR 0.2;
|
||||
target: "elm.spinner.clip";
|
||||
}
|
||||
program { name: "spinner_hide";
|
||||
signal: "elm,action,spinner,hide";
|
||||
source: "elm";
|
||||
action: STATE_SET "default" 0.0;
|
||||
transition: LINEAR 0.2 CURRENT;
|
||||
target: "elm.spinner.clip";
|
||||
}
|
||||
program { name: "save_on";
|
||||
signal: "elm,state,save,on";
|
||||
source: "elm";
|
||||
}
|
||||
program { name: "save_off";
|
||||
signal: "elm,state,save,off";
|
||||
source: "elm";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
group { name: "elm/fileselector_entry/base/default";
|
||||
|
|
|
@ -34,6 +34,7 @@ struct _Elm_Fileselector_Smart_Data
|
|||
Evas_Object *files_grid;
|
||||
Evas_Object *up_button;
|
||||
Evas_Object *home_button;
|
||||
Evas_Object *spinner;
|
||||
Evas_Object *ok_button;
|
||||
Evas_Object *cancel_button;
|
||||
|
||||
|
@ -190,6 +191,8 @@ _elm_fileselector_smart_theme(Evas_Object *obj)
|
|||
|
||||
SWALLOW("elm.swallow.up", sd->up_button);
|
||||
SWALLOW("elm.swallow.home", sd->home_button);
|
||||
SWALLOW("elm.swallow.spinner", sd->spinner);
|
||||
elm_object_style_set(sd->spinner, "wheel");
|
||||
|
||||
if (sd->mode == ELM_FILESELECTOR_LIST)
|
||||
{
|
||||
|
@ -469,6 +472,8 @@ _ls_done_cb(void *data, Eio_File *handler __UNUSED__)
|
|||
Listing_Request *lreq = data;
|
||||
|
||||
_signal_first(lreq);
|
||||
elm_progressbar_pulse(lreq->sd->spinner, EINA_FALSE);
|
||||
elm_layout_signal_emit(lreq->obj, "elm,action,spinner,hide", "elm");
|
||||
|
||||
lreq->sd->current = NULL;
|
||||
_listing_request_cleanup(lreq);
|
||||
|
@ -479,6 +484,9 @@ _ls_error_cb(void *data, Eio_File *handler, int error __UNUSED__)
|
|||
{
|
||||
Listing_Request *lreq = data;
|
||||
|
||||
elm_progressbar_pulse(lreq->sd->spinner, EINA_FALSE);
|
||||
elm_layout_signal_emit(lreq->obj, "elm,action,spinner,hide", "elm");
|
||||
|
||||
if (lreq->sd->current == handler)
|
||||
lreq->sd->current = NULL;
|
||||
_listing_request_cleanup(lreq);
|
||||
|
@ -587,6 +595,8 @@ _populate(Evas_Object *obj,
|
|||
|
||||
sd->current = eio_file_stat_ls(path, _ls_filter_cb, _ls_main_cb,
|
||||
_ls_done_cb, _ls_error_cb, lreq);
|
||||
elm_progressbar_pulse(sd->spinner, EINA_TRUE);
|
||||
elm_layout_signal_emit(lreq->obj, "elm,action,spinner,show", "elm");
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -797,7 +807,7 @@ _anchor_clicked(void *data,
|
|||
static void
|
||||
_elm_fileselector_smart_add(Evas_Object *obj)
|
||||
{
|
||||
Evas_Object *ic, *bt, *li, *en, *grid;
|
||||
Evas_Object *ic, *bt, *li, *en, *grid, *pb;
|
||||
unsigned int i;
|
||||
int s;
|
||||
|
||||
|
@ -842,6 +852,11 @@ _elm_fileselector_smart_add(Evas_Object *obj)
|
|||
elm_widget_sub_object_add(obj, bt);
|
||||
priv->home_button = bt;
|
||||
|
||||
// spinner
|
||||
pb = elm_progressbar_add(obj);
|
||||
elm_widget_sub_object_add(obj, pb);
|
||||
priv->spinner = pb;
|
||||
|
||||
for (i = 0; i < ELM_FILE_LAST; ++i)
|
||||
{
|
||||
list_itc[i] = elm_genlist_item_class_new();
|
||||
|
@ -885,7 +900,6 @@ _elm_fileselector_smart_add(Evas_Object *obj)
|
|||
(li, "contract,request", _on_list_contract_req, obj);
|
||||
evas_object_smart_callback_add(li, "expanded", _on_list_expanded, obj);
|
||||
evas_object_smart_callback_add(li, "contracted", _on_list_contracted, obj);
|
||||
|
||||
evas_object_smart_callback_add(grid, "selected", _on_item_selected, obj);
|
||||
|
||||
elm_widget_sub_object_add(obj, li);
|
||||
|
|
Loading…
Reference in New Issue