Languages

Menu
Sites
Language
Progressbar with percentage, TopRight and BottomLeft text in Popup

I try to develop app which shows popup with progress bar inside the popup. So I made function like below:

static int _popup_progressbar_add(Evas_Object *popup, float progress_val,  char* text_lb, char* text_tp){

    Evas_Object *box = elm_box_add(popup);

    elm_box_horizontal_set(box, EINA_TRUE);
    evas_object_size_hint_align_set(box, EVAS_HINT_FILL, EVAS_HINT_FILL);
    evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
    evas_object_show(box);

    Evas_Object *progressbar = elm_progressbar_add(box);

    elm_object_style_set(progressbar, "custom");// if commentet the progress not apears.
    elm_progressbar_horizontal_set(progressbar, EINA_TRUE);
    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);
    elm_progressbar_value_set(progressbar, progress_val);

    evas_object_show(progressbar);
    elm_box_pack_end(box, progressbar);

    elm_object_content_set(popup, box);

    return RESULT_TYPE_OK;
}

the above fuction I use in below way:

static int _popup_progressbar_type_create(view_data *view)
{
    int res;
    Evas_Object *popup = _popup_new_with_align(view->navi, NULL, view, 0.5);
    elm_object_part_text_set(popup, "title,text", POPUP_TEXT_TITLE_STORAGE);

    res = _popup_progressbar_add(popup,0.3,"XXX","YYYY");
    res = _popup_button_add(popup, "button1", POPUP_BTN_OK,  _popup_cancel_cb, popup);

    if (res != RESULT_TYPE_OK)
    {
        ERR("Fail to create button");
        evas_object_del(popup);
        return RESULT_TYPE_FAIL;
    }
    return RESULT_TYPE_OK;
}

 

The configuration of progress bar I took from example app (UI controls app) I want to have in popup same progress bar as in example the second progress bar (with percentage and LeftBottom and RightTop text) this kind of progress bar has no style in example. How to achieve that? Not only raw progress bar but with additional elements?

Edited by: Arkadiusz Zychewicz on 04 Feb, 2015

Responses

3 Replies
Rihan Ishtiaq

I think you can do that changing the style in the ui_controls edc file

colin Rao

It's a hard work to study the default ui_controls style .edc file. :)

But if you want to costomize the UI widgets style, you must to understand its default implement firstly. It's a long way.

colin Rao

regard how to costomize a widget's style.

https://developer.tizen.org/documentation/mobile-native-app-programming/programming-guide/ui-creating-application-ui/widgets/widget-customization