*
*/
-#define PROGRESSBAR_STATUS_TEXT_FONT_SIZE_INC 20
+#define PROGRESSBAR_STATUS_TEXT_FONT_SIZE_INC 10
#define PROGRESSBAR_LIST_PROGRESS_STYLE_TEXT_COLOR_INC 0 0 0 255
#define PROGRESSBAR_LIST_PROGRESS_STYLE_STATUS_TEXT_COLOR_INC 224 224 224 255
-#define PROGRESSBAR_LIST_PROGRESS_HEIGHT_INC 8
+#define PROGRESSBAR_LIST_PROGRESS_HEIGHT_INC 4
+
+#define PROGRESSBAR_DEFAULT_HEIGHT_INC 4
+#define PROGRESSBAR_DEFAULT_TEXT_HEIGHT_INC 21
+#define PROGRESSBAR_PENDING_HEIGHT_INC 4
+#define PROGRESSBAR_PENDING_TEXT_HEIGHT_INC 21
+#define PROGRESSBAR_PADDING_HEIGHT_INC 4
+#define PROGRESSBAR_LARGE_SIZE_INC 51 51
+#define PROGRESSBAR_MEDIUM_SIZE_INC 28 28
+#define PROGRESSBAR_SMALL_SIZE_INC 22 22
+
+group { name: "elm/progressbar/horizontal/gallery/default";
+ data.item: "vector_ux" "default";
+ parts {
+ part { name: "access";
+ type: RECT;
+ description { state: "default" 0.0;
+ fixed: 1 1;
+ color: 0 0 0 0;
+ }
+ }
+ part { name: "elm.swallow.bar";
+ type: SWALLOW;
+ description { state: "default" 0.0;
+ visible: 0;
+ }
+ }
+ part { name: "base";
+ type: SPACER;
+ scale: 1;
+ description { state: "default" 0.0;
+ min: 0 PROGRESSBAR_DEFAULT_HEIGHT_INC;
+ }
+ }
+ part { name: "elm.text.top.right";
+ type: TEXT;
+ scale: 1;
+ description { state: "default" 0.0;
+ rel1.relative: 0.0 0.0;
+ rel2.relative: 1.0 0.0;
+ rel1.to: "base";
+ rel2.to: "top_padding";
+ text {
+ min: 0 0;
+ align: 0.0 1.0;
+ font: "Tizen:style=Regular"; size: "12";
+ text_class: "tizen";
+ }
+ align: 0.0 1.0;
+ color: 102 102 102 255;
+ visible: 0;
+ }
+ description { state: "show" 0.0;
+ inherit: "default" 0.0;
+ min: 0 PROGRESSBAR_DEFAULT_TEXT_HEIGHT_INC;
+ text.min: 1 1;
+ visible: 1;
+ }
+ }
+ part { name: "top_padding";
+ type: SPACER;
+ scale: 1;
+ description { state: "default" 0.0;
+ min: 0 PROGRESSBAR_PADDING_HEIGHT_INC;
+ max: -1 PROGRESSBAR_PADDING_HEIGHT_INC;
+ fixed: 0 1;
+ rel1.to: "background";
+ rel2.to: "background";
+ rel1.relative: 0.0 0.0;
+ rel2.relative: 1.0 0.0;
+ align: 0.5 1.0;
+ }
+ }
+ part { name: "background";
+ type: RECT;
+ mouse_events: 0;
+ scale: 1;
+ description { state: "default" 0.0;
+ min: 0 PROGRESSBAR_DEFAULT_HEIGHT_INC;
+ max: -1 PROGRESSBAR_DEFAULT_HEIGHT_INC;
+ fixed: 0 1;
+ color: 145 145 145 179;
+ }
+ }
+ part { name: "tizen_vg_shape1";
+ type: SWALLOW;
+ mouse_events: 0;
+ scale: 1;
+ clip_to: "background";
+ description { state: "default" 0.0;
+ rel1.to: "background";
+ rel2.to: "background";
+ }
+ }
+ part { name: "drag.background";
+ type: SPACER;
+ scale: 1;
+ description { state: "default" 0.0;
+ rel1 {
+ to_x: "background";
+ to_y: "background";
+ relative: 0.0 0.0;
+ }
+ rel2 {
+ to_x: "background";
+ to_y: "background";
+ relative: 1.0 1.0;
+ }
+ }
+ }
+ part { name: "tizen_vg_shape2";
+ type: SWALLOW;
+ scale: 1;
+ clip_to: "tizen_vg_shape2_clipper";
+ description { state: "default" 0.0;
+ rel1.to: "elm.progress.progressbar";
+ rel2.to: "elm.progress.progressbar";
+ }
+ }
+ part { name: "tizen_vg_shape2_clipper";
+ type: RECT;
+ description { state: "default" 0.0;
+ color:61 184 204 77;
+ }
+ }
+ part { name: "tizen_vg_shape3";
+ type: SWALLOW;
+ scale: 1;
+ clip_to: "elm.progress.progressbar";
+ description { state: "default" 0.0;
+ rel1.to: "elm.progress.progressbar";
+ rel2.to: "elm.progress.progressbar";
+ }
+ }
+ part { name: "elm.progress.progressbar";
+ type: RECT;
+ description { state: "default" 0.0;
+ min: 0 0;
+ fixed: 1 1;
+ rel1 {
+ to: "background";
+ relative: 0.0 0.0;
+ }
+ rel2 {
+ to_y: "background";
+ to_x: "elm.cur.progressbar";
+ offset: -1 -1;
+ }
+ color:61 184 204 255;
+ }
+ description { state: "invert" 0.0;
+ inherit: "default" 0.0;
+ rel1 {
+ to_y: "background";
+ to_x: "elm.cur.progressbar";
+ }
+ rel2 {
+ to: "background";
+ relative: 1.0 1.0;
+ }
+ }
+ description { state: "state_begin" 0.0;
+ inherit: "default" 0.0;
+ rel1 {
+ to: "background";
+ relative: 0.0 0.0;
+ }
+ rel2 {
+ to: "background";
+ relative: 0.1 1.0;
+ }
+ }
+ description { state: "state_end" 0.0;
+ inherit: "default" 0.0;
+ rel1 {
+ to: "background";
+ relative: 0.9 0.0;
+ }
+ rel2 {
+ to: "background";
+ relative: 1.0 1.0;
+ }
+ }
+ }
+ part { name: "elm.cur.progressbar";
+ mouse_events: 0;
+ scale: 1;
+ dragable {
+ confine: "drag.background";
+ x: 1 1 1;
+ y: 0 0 0;
+ }
+ description { state: "default" 0.0;
+ min: 0 28;
+ fixed: 1 1;
+ visible: 0;
+ rel1.to: "drag.background";
+ rel2.to: "drag.background";
+ }
+ }
+ part { name: "bottom_padding";
+ type: SPACER;
+ scale: 1;
+ description { state: "default" 0.0;
+ min: 0 PROGRESSBAR_PADDING_HEIGHT_INC;
+ max: -1 PROGRESSBAR_PADDING_HEIGHT_INC;
+ fixed: 0 1;
+ rel1.to: "background";
+ rel2.to: "background";
+ rel1.relative: 0.0 1.0;
+ rel2.relative: 1.0 1.0;
+ align: 0.5 0.0;
+ }
+ }
+ part { name: "elm.text.bottom.left";
+ type: TEXT;
+ scale: 1;
+ description { state: "default" 0.0;
+ rel1.to: "bottom_padding";
+ rel2.to: "base";
+ rel1.relative: 0.0 1.0;
+ rel2.relative: 1.0 1.0;
+ text {
+ min: 0 0;
+ align: 0.0 0.0;
+ font: "Tizen:style=Regular"; size: "12";
+ text_class: "tizen";
+ }
+ align: 0.0 0.0;
+ color: 102 102 102 255;
+ visible: 0;
+ }
+ description { state: "show" 0.0;
+ inherit: "default" 0.0;
+ text.min: 1 1;
+ visible: 1;
+ min: 0 PROGRESSBAR_DEFAULT_TEXT_HEIGHT_INC;
+ }
+ }
+ part { name: "elm.text.status";
+ type: TEXT;
+ scale: 1;
+ description { state: "default" 0.0;
+ rel1.to: "bottom_padding";
+ rel2.to: "base";
+ rel1.relative: 0.0 1.0;
+ rel2.relative: 1.0 1.0;
+ text {
+ min: 0 0;
+ align: 1.0 0.0;
+ font: "Tizen:style=Regular"; size: "12";
+ text_class: "tizen";
+ }
+ align: 1.0 0.0;
+ color: 102 102 102 255;
+ visible: 0;
+ }
+ description { state: "show" 0.0;
+ inherit: "default" 0.0;
+ text.min: 1 1;
+ min: 0 PROGRESSBAR_DEFAULT_TEXT_HEIGHT_INC;
+ visible: 1;
+ }
+ }
+ part { name: "elm.text.bottom.right";
+ type: TEXT;
+ scale: 1;
+ description { state: "default" 0.0;
+ rel1.to: "bottom_padding";
+ rel2.to: "base";
+ rel1.relative: 0.0 1.0;
+ rel2.relative: 1.0 1.0;
+ text {
+ min: 0 0;
+ align: 1.0 0.0;
+ font: "Tizen:style=Regular"; size: "12";
+ text_class: "tizen";
+ }
+ align: 1.0 0.0;
+ color: 102 102 102 255;
+ visible: 0;
+ }
+ description { state: "show" 0.0;
+ inherit: "default" 0.0;
+ text.min: 1 1;
+ visible: 1;
+ min: 0 PROGRESSBAR_DEFAULT_TEXT_HEIGHT_INC;
+ }
+ }
+ }
+ programs {
+ program { name: "text_top_right_show";
+ signal: "elm,state,top.right,visible";
+ source: "elm";
+ action: STATE_SET "show" 0.0;
+ target: "elm.text.top.right";
+ }
+ program { name: "text_top_right_text_hide";
+ signal: "elm,state,top.right,hidden";
+ source: "elm";
+ action: STATE_SET "default" 0.0;
+ target: "elm.text.top.right";
+ }
+ program { name: "text_bottom_left_show";
+ signal: "elm,state,bottom.left,visible";
+ source: "elm";
+ action: STATE_SET "show" 0.0;
+ target: "elm.text.bottom.left";
+ }
+ program { name: "text_bottom_left_text_hide";
+ signal: "elm,state,bottom.left,hidden";
+ source: "elm";
+ action: STATE_SET "default" 0.0;
+ target: "elm.text.bottom.left";
+ }
+ program { name: "text_bottom_right_show";
+ signal: "elm,state,bottom.right,visible";
+ source: "elm";
+ script {
+ set_state(PART:"elm.text.status", "default", 0.0);
+ set_state(PART:"elm.text.bottom.right", "show", 0.0);
+ }
+ }
+ program { name: "text_status_show";
+ signal: "elm,state,units,visible";
+ source: "elm";
+ script {
+ set_state(PART:"elm.text.bottom.right", "default", 0.0);
+ set_state(PART:"elm.text.status", "show", 0.0);
+ }
+ }
+ program { name: "text_status_text_hide";
+ signal: "elm,state,units,hidden";
+ source: "elm";
+ action: STATE_SET "default" 0.0;
+ target: "elm.text.status";
+ }
+ program { name: "slide_to_end";
+ action: STATE_SET "state_end" 0.0;
+ transition: LINEAR 0.5;
+ target: "elm.progress.progressbar";
+ after: "slide_to_begin";
+ }
+ program { name: "slide_to_begin";
+ signal: "elm,state,slide,begin";
+ action: STATE_SET "state_begin" 0.0;
+ target: "elm.progress.progressbar";
+ transition: LINEAR 0.5;
+ after: "slide_to_end";
+ }
+ program { name: "start_pulse";
+ signal: "elm,state,pulse,start";
+ source: "elm";
+ }
+ program { name: "stop_pulse";
+ signal: "elm,state,pulse,stop";
+ source: "elm";
+ action: ACTION_STOP;
+ target: "slide_to_begin";
+ target: "slide_to_end";
+ target: "start_pulse";
+ }
+ program { name: "state_pulse";
+ signal: "elm,state,pulse";
+ source: "elm";
+ action: STATE_SET "state_begin" 0.0;
+ target: "elm.progress.progressbar";
+ action: STATE_SET "default" 0.0;
+ target: "elm.text.status";
+ }
+ program { name: "state_fraction";
+ signal: "elm,state,fraction";
+ source: "elm";
+ action: ACTION_STOP;
+ target: "slide_to_begin";
+ target: "slide_to_end";
+ target: "start_pulse";
+ action: STATE_SET "default" 0.0;
+ target: "elm.progress.progressbar";
+ target: "elm.text.status";
+ }
+ program { name: "set_invert_on";
+ signal: "elm,state,inverted,on";
+ source: "elm";
+ action: STATE_SET "invert" 0.0;
+ target: "elm.progress.progressbar";
+ }
+ program { name: "set_invert_off";
+ signal: "elm,state,inverted,off";
+ source: "elm";
+ action: STATE_SET "default" 0.0;
+ target: "elm.progress.progressbar";
+ }
+ program { name: "finished_animation";
+ signal: "elm,action,animation,finished";
+ source: "elm";
+ action: SIGNAL_EMIT "animation,finished" "";
+ }
+ }
+ }
group { name: "elm/progressbar/horizontal/gallery/list_progress";
images {
return ECORE_CALLBACK_CANCEL;
}
-#if 0
/* We need to perform cancellation, not just delete popup */
static inline void __gl_pb_ea_back_cb(void *data, Evas_Object *obj, void *ei)
{
GL_CHECK(btn_cancel);
evas_object_smart_callback_call(btn_cancel, "clicked", NULL);
}
-#endif
int gl_pb_make_thread_pbar_wheel(void *data, Evas_Object *parent, char *title)
{
return 0;
}
+int gl_pb_make_thread_pbar(void *data, Evas_Object *parent, char *title)
+{
+ GL_CHECK_VAL(data, -1);
+ gl_appdata *ad = (gl_appdata *)data;
+ Evas_Object *popup = NULL;
+ Evas_Object *progressbar = NULL;
+ Evas_Object *box = NULL;
+ Evas_Object *label = NULL;
+
+ gl_pb_del_pbar(ad);
+
+ popup = elm_popup_add(parent);
+
+ /*Delete the Popup if the Popup has a BACK event.*/
+ eext_object_event_callback_add(popup, EEXT_CALLBACK_BACK,
+ __gl_pb_ea_back_cb, NULL);
+ if (!strcmp(GL_STR_ID_MOVING, title)) {
+ _gl_ui_set_translate_part_str(popup, GL_POPUP_TEXT, GL_STR_ID_MOVE);
+ } else {
+ _gl_ui_set_translate_part_str(popup, GL_POPUP_TEXT, GL_STR_ID_COPY);
+ }
+
+ evas_object_size_hint_weight_set(label, 0.0,
+ EVAS_HINT_EXPAND);
+ evas_object_size_hint_align_set(label, 0.0,
+ EVAS_HINT_FILL);
+ evas_object_show(label);
+ progressbar = elm_progressbar_add(popup);
+ elm_object_style_set(progressbar, "gallery/default");
+ elm_progressbar_unit_format_set(progressbar, NULL);
+ elm_progressbar_value_set(progressbar, 0.0);
+ evas_object_size_hint_align_set(progressbar, EVAS_HINT_FILL,
+ EVAS_HINT_FILL);
+ evas_object_size_hint_weight_set(progressbar, EVAS_HINT_EXPAND,
+ EVAS_HINT_EXPAND);
+ evas_object_show(progressbar);
+ elm_object_part_text_set(progressbar, "elm.text.top.right", _gl_str(title));
+ box = elm_box_add(popup);
+ evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND,
+ EVAS_HINT_EXPAND);
+ elm_box_horizontal_set(box, EINA_FALSE);
+ elm_box_homogeneous_set(box, EINA_FALSE);
+ elm_box_pack_end(box, progressbar);
+ evas_object_show(box);
+
+ elm_object_content_set(popup, box);
+ Evas_Object *btn1 = NULL;
+ btn1 = _gl_but_create_but_popup(popup, GL_STR_ID_CANCEL,
+ __gl_pb_cancel_thread_pbar_cb, data);
+ elm_object_part_content_set(popup, "button1", btn1);
+
+ evas_object_show(popup);
+
+ ad->pbarinfo.popup = popup;
+ ad->pbarinfo.pbar = progressbar;
+ ad->pbarinfo.finished_cnt = 0;
+
+ return 0;
+}
+
+
int gl_pb_refresh_thread_pbar(void *data, int cur_cnt, int total_cnt)
{
GL_CHECK_VAL(data, -1);
char status_info[GL_POPUP_DESC_LEN_MAX] = { 0, };
+ char status_percent[GL_POPUP_DESC_LEN_MAX] = { 0, };
double percent = 0.0;
gl_appdata *ad = (gl_appdata *)data;
GL_CHECK_VAL(ad->pbarinfo.pbar, -1);
- GL_CHECK_VAL(ad->pbarinfo.status_label, -1);
snprintf(status_info, sizeof(status_info),
- GL_FONT_STYLE_POP_S"%d/%d"GL_FONT_STYLE_POP_E, cur_cnt,
+ "%d/%d", cur_cnt,
total_cnt);
/* Save medias count already operated */
ad->pbarinfo.finished_cnt = cur_cnt;
- elm_object_text_set(ad->pbarinfo.status_label, status_info);
- evas_object_show(ad->pbarinfo.status_label);
+ elm_object_part_text_set(ad->pbarinfo.pbar, "elm.text.bottom.left", status_info);
if (total_cnt != 0) {
percent = (double)cur_cnt / (double)total_cnt;
elm_progressbar_value_set(ad->pbarinfo.pbar, percent);
+ snprintf(status_percent, sizeof(status_percent),
+ "%d%%", (int)(percent*100));
+ elm_object_part_text_set(ad->pbarinfo.pbar, "elm.text.bottom.right", status_percent);
}
return 0;