Added sliders on picture menu subitems and fixes 53/60653/6
authorBartlomiej Uliasz <b.uliasz@samsung.com>
Mon, 29 Feb 2016 13:47:42 +0000 (14:47 +0100)
committerBartlomiej Uliasz <b.uliasz@samsung.com>
Fri, 4 Mar 2016 12:39:24 +0000 (13:39 +0100)
Change-Id: I4fbaf7e82b3401831295e9eae2d8d47c05823115
Signed-off-by: Bartlomiej Uliasz <b.uliasz@samsung.com>
16 files changed:
include/common/menumgr.h
include/data/settings_picture.h
include/define.h
res/view/common/generic_slider_view.edc
res/view/common/popup_2btns.edc
res/view/common/popup_screen_adj.edc
res/widget/button.edc
res/widget/ctxpopup.edc
res/widget/entry.edc
res/widget/progressbar.edc
res/widget/radio.edc
src/common/menumgr.c
src/data/settings_picture.c
src/layout/layout_picture.c
src/view/picture/view_picture_brightness.c
src/view/picture/view_picture_slider_generic.c

index 5f58c0f..a1fb5bd 100644 (file)
@@ -17,6 +17,8 @@
 #ifndef __AIR_SETTINGS_MENUMGR_H__
 #define __AIR_SETTINGS_MENUMGR_H__
 
+#include <Elementary.h>
+
 struct menumgr;
 
 struct menumgr_info {
@@ -24,7 +26,9 @@ struct menumgr_info {
        const char *title;
        const char *style;
        Eina_Bool disabled;
+       Evas_Object *progress_evas;
        char *(*status)(void *data, int id);
+       float (*progress_value)(void);
        void (*selected)(void *data, int id);
        void (*selected_menu)(void *data, int id);
 };
index f649d43..bc20d03 100644 (file)
@@ -17,6 +17,8 @@
 #ifndef __AIR_SETTINGS_PICTURE_H__
 #define __AIR_SETTINGS_PICTURE_H__
 
+#include "common/menumgr.h"
+
 #define PICTURE_MODE_STANDARD_STR "Standard"
 #define PICTURE_MODE_MOVIE_STR "Movie"
 
@@ -46,11 +48,16 @@ void settings_picture_set_tint_g(int val);
 
 settings_picture_mode settings_picture_get_picture_mode(void);
 int settings_picture_get_contrast(void);
+float settings_picture_get_contrast_relative(void);
 int settings_picture_get_brightness(void);
+float settings_picture_get_brightness_relative(void);
 int settings_picture_get_max_brightness(void);
 int settings_picture_get_sharpness(void);
+float settings_picture_get_sharpness_relative(void);
 int settings_picture_get_color(void);
+float settings_picture_get_color_relative(void);
 int settings_picture_get_tint_g(void);
+float settings_picture_get_tint_relative(void);
 void settings_picture_set_screen_adjust(int adj);
 int settings_picture_get_screen_adjust(void);
 const char *settings_picture_get_screen_adjust_str(void);
index 40d2af3..dc96655 100644 (file)
@@ -89,6 +89,7 @@
 #define PART_MENU_VALUE "part.menu.value"
 #define PART_LIVE_TV_BTN "part.live.tv.btn"
 #define PART_MORE_FAV_BTN "part.more.fav.btn"
+#define PART_MENU_PROGRESS "part.menu.progress"
 
 #define PART_GUIDE "part.guide"
 #define PART_GUIDE_2 "part.guide2"
 #define STYLE_BASE_BTN "style.base.button"
 #define STYLE_NORMAL_BTN "style.normal.button"
 #define STYLE_STATUS_BTN "style.status.button"
+#define STYLE_PROGRESS_BTN "style.progress.button"
 #define STYLE_OPTION_BTN "style.option.button"
 #define STYLE_OPTION_LIST_BTN "style.option.list.button"
 #define STYLE_CTXPOPUP "style.ctxpopup"
 #define FONT_LIGHT "BreezeSans:style=Light"
 
 /* Color */
-#define COLOR_ITEM_BG 255 255 255 255
+#define COLOR_ITEM_BG 191 191 191 255
 #define COLOR_ITEM_FOCUS 0 119 246 255
 #define COLOR_ITEM_BORDER 194 194 194 255
 
-#define COLOR_TEXT_ITEM 92 92 92 255
+
+
+#define COLOR_TEXT_ITEM 255 255 255 255
 #define COLOR_TEXT_FOCUS 255 255 255 255
 #define COLOR_TEXT_DISABLE 92 92 92 155
-#define COLOR_TEXT_VALUE 64 136 211 255
+#define COLOR_TEXT_VALUE 89 89 89 255
+#define COLOR_TEXT_VALUE_FOCUS 189 189 189 255
 #define COLOR_TEXT_VALUE_DISABLE 64 136 211 155
+#define COLOR_TEXT_SLIDER 92 92 92 255
+#define COLOR_TEXT_SLIDER_VALUE 64 136 211 255
 #define COLOR_TEXT_POPUP 104 104 104 255
 
 #define COLOR_LINE_INSIDE 127 127 127 255
index d7e1d59..f0a2a44 100644 (file)
@@ -1,3 +1,19 @@
+/*
+ * Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 #define SLIDER_VAL_MIN_REL_X 0.285
 #define SLIDER_VAL_MAX_REL_X 0.915
 #define SLIDER_VAL_STEP_REL_X 0.0063
@@ -43,7 +59,7 @@ group {
                                rel1.to, "bg";
                                rel2 { to, "bg"; relative, 0.25 1.0; }
                                align, 0.5 0.5;
-                               color, COLOR_TEXT_ITEM;
+                               color, COLOR_TEXT_SLIDER;
                                text {
                                        font, FONT_REGULAR;
                                        size, 32;
@@ -61,7 +77,7 @@ group {
                                rel1 { to, "bg"; relative, SLIDER_VAL_MIN_REL_X SLIDER_VAL_REL_Y; }
                                rel2 { to, "bg"; relative, SLIDER_VAL_MIN_REL_X SLIDER_VAL_REL_Y; }
                                align, 0.5 0.5;
-                               color, COLOR_TEXT_ITEM;
+                               color, COLOR_TEXT_SLIDER;
                                text {
                                        font, FONT_LIGHT;
                                        size, 28;
@@ -79,7 +95,7 @@ group {
                                rel1 { to, "bg"; relative, SLIDER_VAL_MAX_REL_X SLIDER_VAL_REL_Y; }
                                rel2 { to, "bg"; relative, SLIDER_VAL_MAX_REL_X SLIDER_VAL_REL_Y; }
                                align, 0.5 0.5;
-                               color, COLOR_TEXT_ITEM;
+                               color, COLOR_TEXT_SLIDER;
                                text {
                                        font, FONT_LIGHT;
                                        size, 28;
@@ -108,7 +124,7 @@ group {
                                rel1 { to, "bg"; relative, SLIDER_VAL_MIN_REL_X SLIDER_VAL_REL_Y; }
                                rel2 { to, "bg"; relative, SLIDER_VAL_MIN_REL_X SLIDER_VAL_REL_Y; }
                                align, 0.5 0.5;
-                               color, COLOR_TEXT_VALUE;
+                               color, COLOR_TEXT_SLIDER_VALUE;
                                text {
                                        font, FONT_REGULAR;
                                        size, 28;
index dcdc9e3..8f7569a 100644 (file)
@@ -1,3 +1,19 @@
+/*
+ * Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 group {
        name, GRP_VIEW_POPUP_2BTNS;
        parts {
index e46f1d7..49293b9 100644 (file)
@@ -1,3 +1,19 @@
+/*
+ * Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 group {
        name, GRP_VIEW_POPUP_BUTTONS_LIST;
        parts {
index 3791298..8db60ee 100644 (file)
@@ -437,16 +437,30 @@ group {
                        }
                }
                part {
-                       name, "elm.text";
-                       type, TEXT;
+                       name, "bg.content";
+                       type, SPACER;
                        scale, 1;
                        description {
                                state, "default" 0.0;
+                               max, 388 254;
                                rel1.to, "bg";
                                rel2.to, "bg";
+                               align, 0.5 0.5;
+                               fixed, 1 1;
+                       }
+               }
+               part {
+                       name, "elm.text";
+                       type, TEXT;
+                       repeat_events, 1;
+                       scale, 1;
+                       description {
+                               state, "default" 0.0;
+                               rel1.to, "bg.content";
+                               rel2.to, "bg.content";
                                text {
                                        font, FONT_LIGHT;
-                                       size, 32;
+                                       size, 40;
                                        align, 0.5 0.5;
                                }
                                color, COLOR_TEXT_ITEM;
@@ -462,75 +476,6 @@ group {
                                color, COLOR_TEXT_DISABLE;
                        }
                }
-               part {
-                       name, "border_top";
-                       type, RECT;
-                       scale, 1;
-                       description {
-                               state, "default" 0.0;
-                               rel1.to, "bg";
-                               rel2 {
-                                       to, "bg";
-                                       relative, 1.0 0.0;
-                               }
-                               min, 0 1;
-                               align, 0.5 0.0;
-                               color, COLOR_ITEM_BORDER;
-                               fixed, 0 1;
-                       }
-               }
-               part {
-                       name, "border_left";
-                       inherit, "border_top";
-                       description {
-                               state, "default" 0.0;
-                               rel1 {
-                                       to, "border_top";
-                                       relative, 0.0 1.0;
-                               }
-                               rel2 {
-                                       to, "bg";
-                                       relative, 0.0 1.0;
-                               }
-                               min, 1 0;
-                               align, 0.0 0.5;
-                               fixed, 1 0;
-                       }
-               }
-               part {
-                       name, "border_right";
-                       inherit, "border_top";
-                       description {
-                               state, "default" 0.0;
-                               rel1 {
-                                       to, "border_top";
-                                       relative, 1.0 1.0;
-                               }
-                               rel2 {
-                                       to, "bg";
-                                       relative, 1.0 1.0;
-                               }
-                               min, 1 0;
-                               align, 1.0 0.5;
-                               fixed, 1 0;
-                       }
-               }
-               part {
-                       name, "border_bottom";
-                       inherit, "border_top";
-                       description {
-                               state, "default" 0.0;
-                               rel1 {
-                                       to, "border_left";
-                                       relative, 1.0 1.0;
-                               }
-                               rel2 {
-                                       to, "border_right";
-                                       relative, 0.0 1.0;
-                               }
-                               align, 0.5 1.0;
-                       }
-               }
        }
        programs {
                program {
@@ -570,41 +515,14 @@ group {
 group {
        name, "elm/button/base/style.status.button";
        inherit, "elm/button/base/style.normal.button";
-       data.item, "focus_highlight" "on";
        parts {
                part {
-                       name, "bg.text";
-                       type, SPACER;
-                       scale, 1;
-                       description {
-                               state, "default" 0.0;
-                               min, 400 134;
-                               rel1 {
-                                       to, "bg";
-                                       relative, 0.5 0.5;
-                               }
-                               rel2 {
-                                       to, "bg";
-                                       relative, 0.5 0.5;
-                               }
-                               align, 0.5 0.5;
-                               fixed, 1 1;
-                       }
-               }
-               part {
                        name, "elm.text";
-                       type, TEXT;
-                       scale, 1;
                        description {
                                state, "default" 0.0;
-                               rel1.to, "bg.text";
-                               rel2.to, "bg.text";
-                               text {
-                                       font, FONT_LIGHT;
-                                       size, 32;
-                                       align, 0.5 0.0;
-                               }
-                               color, COLOR_TEXT_ITEM;
+                               rel2.relative, 1.0 0.4;
+                               text.align, 0.5 1.0;
+                               // the rest is inherited
                        }
                        description {
                                state, "focused" 0.0;
@@ -620,22 +538,27 @@ group {
                part {
                        name, PART_MENU_VALUE;
                        type, TEXT;
+                       repeat_events, 1;
                        scale, 1;
                        description {
                                state, "default" 0.0;
-                               rel1.to, "bg.text";
-                               rel2.to, "bg.text";
+                               rel1 {
+                                       to, "bg.content";
+                                       relative, 0.0 0.5;
+                               }
+                               rel2.to, "bg.content";
+
                                text {
                                        font, FONT_LIGHT;
-                                       size, 66;
-                                       align, 0.5 1.0;
+                                       size, 40;
+                                       align, 0.5 0.0;
                                }
                                color, COLOR_TEXT_VALUE;
                        }
                        description {
                                state, "focused" 0.0;
                                inherit, "default" 0.0;
-                               color, COLOR_TEXT_FOCUS;
+                               color, COLOR_TEXT_VALUE_FOCUS;
                        }
                        description {
                                state, "disabled" 0.0;
@@ -652,30 +575,14 @@ group {
        programs {
                program {
                        name, "focused";
-                       signal, "elm,action,focus";
-                       source, "elm";
-                       action, STATE_SET "focused" 0.0;
-                       target, "bg";
-                       target, "elm.text";
                        target, PART_MENU_VALUE;
-                       transition, TRANSITION_FOCUS;
                }
                program {
                        name, "unfocused";
-                       signal, "elm,action,unfocus";
-                       source, "elm";
-                       action, STATE_SET "default" 0.0;
-                       target, "bg";
-                       target, "elm.text";
                        target, PART_MENU_VALUE;
-                       transition, TRANSITION_FOCUS;
                }
                program {
                        name, "disabled";
-                       signal, SIG_DISABLED;
-                       source, "elm";
-                       action, STATE_SET "disabled" 0.0;
-                       target, "elm.text";
                        target, PART_MENU_VALUE;
                }
                program {
@@ -689,6 +596,82 @@ group {
 }
 
 group {
+       name, "elm/button/base/style.progress.button";
+       inherit, "elm/button/base/style.status.button";
+       parts {
+               part {
+                       name, PART_MENU_PROGRESS;
+                       type, SWALLOW;
+                       repeat_events, 1;
+                       scale, 1;
+                       description {
+                               state, "default" 0.0;
+                               rel1 {
+                                   to, "bg.content";
+                                   relative, 0.0 0.5;
+                               }
+                               rel2 {
+                                   to, "bg.content";
+                                   relative, 1.0 0.5;
+                               }
+                               min, 80 45;
+                               align, 0.5 0.5;
+                               fixed, 1 0;
+                       }
+               }
+               part {
+                       name, "elm.text";
+                       description {
+                               state, "default" 0.0;
+                               rel1.to, PART_MENU_PROGRESS;
+                               rel2 {
+                                       to, PART_MENU_PROGRESS;
+                                       relative, 1.0 0.0;
+                               }
+                               text.align, 0.5 1.0;
+                               // the rest is inherited
+                       }
+                       description {
+                               state, "focused" 0.0;
+                               inherit, "default" 0.0;
+                               color, COLOR_TEXT_FOCUS;
+                       }
+                       description {
+                               state, "disabled" 0.0;
+                               inherit, "default" 0.0;
+                               color, COLOR_TEXT_DISABLE;
+                       }
+               }
+               part {
+                       name, PART_MENU_VALUE;
+                       description {
+                               state, "default" 0.0;
+                               rel1 {
+                                       to, PART_MENU_PROGRESS;
+                                       relative, 0.0 0.8;
+                               }
+                               rel2.to, PART_MENU_PROGRESS;
+                       }
+                       description {
+                               state, "focused" 0.0;
+                               inherit, "default" 0.0;
+                               color, COLOR_TEXT_VALUE_FOCUS;
+                       }
+                       description {
+                               state, "disabled" 0.0;
+                               inherit, "default" 0.0;
+                               color, COLOR_TEXT_VALUE_DISABLE;
+                       }
+                       description {
+                               state, "notavailable" 0.0;
+                               inherit, "default" 0.0;
+                               color, COLOR_TEXT_DISABLE;
+                       }
+               }
+       }
+}
+
+group {
        name, "elm/button/base/style.option.button";
        data.item, "focus_highlight" "on";
        images {
index 1ab7cf4..bfc3a68 100644 (file)
@@ -1,3 +1,19 @@
+/*
+ * Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 group {
        name, "elm/ctxpopup/base/style.ctxpopup";
        data.item, "focus_hightlight" "on";
index 3df22d9..c78b704 100644 (file)
@@ -1,3 +1,19 @@
+/*
+ * Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 styles {
    /* Unfocused state */
    style { name: "entry_ipaddr_style";
index 4f9c7d6..00fdfe7 100644 (file)
@@ -1,3 +1,19 @@
+/*
+ * Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 group {
        name, "elm/progressbar/horizontal/style.channel.scan.progressbar";
        parts {
index 931e2a2..ff7b4fe 100644 (file)
@@ -1,3 +1,19 @@
+/*
+ * Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
 #define RADIO_SIZE 48 48
 #define RADIO_FONT_SIZE 32
 
index 1b3e25c..b3e2a9d 100644 (file)
@@ -121,17 +121,16 @@ void menumgr_update(struct menumgr *m)
                        str = m->info[i]->status(m->data, m->info[i]->id);
 
                        if (!str) {
-                               elm_object_part_text_set(m->btn[i],
-                                               PART_MENU_VALUE,
-                                               STATUS_DEFAULT);
-                               elm_object_signal_emit(m->btn[i],
-                                               SIG_NOTAVAILABLE, "");
+                               elm_object_part_text_set(m->btn[i], PART_MENU_VALUE, STATUS_DEFAULT);
+                               elm_object_signal_emit(m->btn[i], SIG_NOTAVAILABLE, "");
                        } else {
-                               elm_object_part_text_set(m->btn[i],
-                                               PART_MENU_VALUE, str);
+                               elm_object_part_text_set(m->btn[i], PART_MENU_VALUE, str);
                                free(str);
                        }
                }
+               if (m->info[i]->progress_evas) {
+                       elm_progressbar_value_set(m->info[i]->progress_evas, m->info[i]->progress_value());
+               }
        }
 }
 
@@ -187,6 +186,15 @@ struct menumgr *menumgr_create(Evas_Object *table, Evas_Object *tab_menu_btn,
                elm_object_disabled_set(btn, info[i].disabled);
                evas_object_size_hint_align_set(btn, 0, 0);
 
+               if (info[i].progress_value) {
+                       info[i].progress_evas = utils_add_progressbar(btn, PART_MENU_PROGRESS, NULL);
+                       if (!info[i].progress_evas) {
+                               _ERR("Add progress bar failed.");
+                       } else {
+                               elm_progressbar_value_set(info[i].progress_evas, info[i].progress_value());
+                       }
+               }
+
                inputmgr_add_callback(btn, info[i].id, &_handler, m);
 
                col = i % MAX_BTN_COL;
index 66da12f..487f9a7 100644 (file)
 #define DEFAULT_SHARPNESS 100
 #define DEFAULT_COLOR 100
 #define DEFAULT_TINT_G 50
+#define CONTRAST_MIN_VALUE 0
+#define CONTRAST_MAX_VALUE 100
+#define BRIGHTNESS_MIN_VALUE 0
+#define SHARPNESS_MIN_VALUE 0
+#define SHARPNESS_MAX_VALUE 100
+#define COLOR_MIN_VALUE 0
+#define COLOR_MAX_VALUE 100
+#define TINT_MIN_VALUE 0
+#define TINT_MAX_VALUE 100
 
 /* Display error:
 
@@ -64,7 +73,7 @@ void settings_picture_set_picture_mode(settings_picture_mode mode_to_set)
 void settings_picture_set_contrast(int val)
 {
        //@TODO: set contrast value
-       if (val < 0 || val > 100) {
+       if (val < CONTRAST_MIN_VALUE || val > CONTRAST_MAX_VALUE) {
                _ERR("Invalid contrast value: %d", val);
                return;
        }
@@ -117,24 +126,28 @@ int settings_picture_get_contrast(void)
        return temp_contrast;
 }
 
+float settings_picture_get_contrast_relative(void)
+{
+       if (CONTRAST_MAX_VALUE == CONTRAST_MIN_VALUE) {
+               _ERR("Contrast max and min values are equal");
+               return .0;
+       }
+       return (float)(settings_picture_get_contrast() - CONTRAST_MIN_VALUE)
+                       / (CONTRAST_MAX_VALUE - CONTRAST_MIN_VALUE);
+}
+
 int settings_picture_get_brightness(void)
 {
-       int max, curr;
+       int curr;
        int ret = DEVICE_ERROR_NONE;
 
-       max = settings_picture_get_max_brightness();
-       if (max <= 0) {
-               _ERR("Invalid max brightness value");
-               return 0;
-       }
-
        ret =  device_display_get_brightness(0, &curr);
        if (ret != DEVICE_ERROR_NONE) {
                _ERR("Failed to get current brightness: %s", get_error_message(ret));
                return 0;
        }
 
-       return 100*curr/max;
+       return curr;
 }
 
 int settings_picture_get_max_brightness(void)
@@ -151,24 +164,69 @@ int settings_picture_get_max_brightness(void)
        return max;
 }
 
+float settings_picture_get_brightness_relative(void)
+{
+       int max, curr;
+
+       max = settings_picture_get_max_brightness();
+       if (max - BRIGHTNESS_MIN_VALUE == 0) {
+               _ERR("Brightness max and min values are equal");
+               return .0;
+       }
+
+       curr = settings_picture_get_brightness();
+
+       return (float)curr/(max - BRIGHTNESS_MIN_VALUE);
+}
+
 int settings_picture_get_sharpness(void)
 {
        //@TODO: get sharpness
        return temp_sharpness;
 }
 
+float settings_picture_get_sharpness_relative(void)
+{
+       if (SHARPNESS_MAX_VALUE == SHARPNESS_MIN_VALUE) {
+               _ERR("Sharpness max and min values are equal");
+               return .0;
+       }
+       return (float)(settings_picture_get_sharpness() - SHARPNESS_MIN_VALUE)
+                       / (SHARPNESS_MAX_VALUE - SHARPNESS_MIN_VALUE);
+}
+
 int settings_picture_get_color(void)
 {
        //@TODO: get color
        return temp_color;
 }
 
+float settings_picture_get_color_relative(void)
+{
+       if (COLOR_MAX_VALUE == COLOR_MIN_VALUE) {
+               _ERR("Color max and min values are equal");
+               return .0;
+       }
+       return (float)(settings_picture_get_color() - COLOR_MIN_VALUE)
+                       / (COLOR_MAX_VALUE - COLOR_MIN_VALUE);
+}
+
 int settings_picture_get_tint_g(void)
 {
        //@TODO: get tint
        return temp_tint_g;
 }
 
+float settings_picture_get_tint_relative(void)
+{
+       if (TINT_MAX_VALUE == TINT_MIN_VALUE) {
+               _ERR("Tint max and min values are equal");
+               return .0;
+       }
+       return (float)(settings_picture_get_tint_g() - TINT_MIN_VALUE)
+                       / (TINT_MAX_VALUE - TINT_MIN_VALUE);
+}
+
 void settings_picture_set_screen_adjust(int adj)
 {
        screen_adj = adj;
index 806bf9b..7b496bb 100644 (file)
@@ -72,51 +72,63 @@ static struct menumgr_info menu_info[] = {
                .style = STYLE_STATUS_BTN,
                .disabled = EINA_FALSE,
                .status = _get_picture_mode,
+               .progress_value = NULL,
+               .progress_evas = NULL,
                .selected = _selected,
                .selected_menu = _selected_menu
        },
        {
                .id = MENU_CONTRAST,
                .title = STR_CONTRAST,
-               .style = STYLE_STATUS_BTN,
+               .style = STYLE_PROGRESS_BTN,
                .disabled = EINA_FALSE,
                .status = _get_contrast,
+               .progress_value = settings_picture_get_contrast_relative,
+               .progress_evas = NULL,
                .selected = _selected,
                .selected_menu = _selected_menu
        },
        {
                .id = MENU_BRIGHTNESS,
                .title = STR_BRIGHTNESS,
-               .style = STYLE_STATUS_BTN,
+               .style = STYLE_PROGRESS_BTN,
                .disabled = EINA_FALSE,
                .status = _get_brightness,
+               .progress_value = settings_picture_get_brightness_relative,
+               .progress_evas = NULL,
                .selected = _selected,
                .selected_menu = _selected_menu
        },
        {
                .id = MENU_SHARPNESS,
                .title = STR_SHARPNESS,
-               .style = STYLE_STATUS_BTN,
+               .style = STYLE_PROGRESS_BTN,
                .disabled = EINA_FALSE,
                .status = _get_sharpness,
+               .progress_value = settings_picture_get_sharpness_relative,
+               .progress_evas = NULL,
                .selected = _selected,
                .selected_menu = _selected_menu
        },
        {
                .id = MENU_COLOR,
                .title = STR_COLOR,
-               .style = STYLE_STATUS_BTN,
+               .style = STYLE_PROGRESS_BTN,
                .disabled = EINA_FALSE,
                .status = _get_color,
+               .progress_value = settings_picture_get_color_relative,
+               .progress_evas = NULL,
                .selected = _selected,
                .selected_menu = _selected_menu
        },
        {
                .id = MENU_TINT,
                .title = STR_TINT,
-               .style = STYLE_STATUS_BTN,
+               .style = STYLE_PROGRESS_BTN,
                .disabled = EINA_FALSE,
                .status = _get_tint,
+               .progress_value = settings_picture_get_tint_relative,
+               .progress_evas = NULL,
                .selected = _selected,
                .selected_menu = _selected_menu
        },
@@ -126,6 +138,8 @@ static struct menumgr_info menu_info[] = {
                .style = STYLE_STATUS_BTN,
                .disabled = EINA_FALSE,
                .status = _get_screen_adj,
+               .progress_value = NULL,
+               .progress_evas = NULL,
                .selected = _selected,
                .selected_menu = _selected_menu
        },
@@ -160,7 +174,7 @@ static char *_get_contrast(void *data, int id)
        char con_str[5] = {0, };
        int con_val = settings_picture_get_contrast();
 
-       snprintf(con_str, sizeof(con_str), "%d%%", con_val);
+       snprintf(con_str, sizeof(con_str), "%d", con_val);
 
        return strdup(con_str);
 }
@@ -173,7 +187,7 @@ static char *_get_brightness(void *data, int id)
        if (b_val < 0)
                return NULL;
 
-       snprintf(b_str, sizeof(b_str), "%d%%", b_val);
+       snprintf(b_str, sizeof(b_str), "%d", b_val);
 
        return strdup(b_str);
 }
@@ -183,7 +197,7 @@ static char *_get_sharpness(void *data, int id)
        char sharp_str[5] = {0, };
        int sharp_val = settings_picture_get_sharpness();
 
-       snprintf(sharp_str, sizeof(sharp_str), "%d%%", sharp_val);
+       snprintf(sharp_str, sizeof(sharp_str), "%d", sharp_val);
 
        return strdup(sharp_str);
 }
@@ -193,7 +207,7 @@ static char *_get_color(void *data, int id)
        char color_str[5] = {0, };
        int color_val = settings_picture_get_color();
 
-       snprintf(color_str, sizeof(color_str), "%d%%", color_val);
+       snprintf(color_str, sizeof(color_str), "%d", color_val);
 
        return strdup(color_str);
 }
@@ -203,7 +217,7 @@ static char *_get_tint(void *data, int id)
        char tint_str[10] = {0, };
        int tint_val = settings_picture_get_tint_g();
 
-       snprintf(tint_str, sizeof(tint_str), "G %d R %d", tint_val, 100 - tint_val);
+       snprintf(tint_str, sizeof(tint_str), "G%d R%d", tint_val, 100 - tint_val);
 
        return strdup(tint_str);
 }
index 8627d99..6c049ad 100644 (file)
@@ -50,7 +50,7 @@ static Evas_Object *_create(Evas_Object *win, void *data)
        g_slider_attr.slider_title = STR_BRIGHTNESS;
        g_slider_attr.slider_min_val = 0;
        g_slider_attr.slider_max_val = settings_picture_get_max_brightness();
-       g_slider_attr.slider_cur_val = 100;
+       g_slider_attr.slider_cur_val = settings_picture_get_brightness();
        g_slider_attr.set_setting_value = settings_picture_set_brightness;
        g_slider_attr.get_setting_value = settings_picture_get_brightness;
 
index 4240d0f..6e85629 100644 (file)
@@ -91,7 +91,6 @@ static Evas_Object *_create(Evas_Object *win, void *data)
                        attr->slider_min_val, attr->slider_max_val, attr->slider_step);
        if (!priv->slider) {
                _ERR("Add slider failed.");
-               evas_object_del(priv->slider);
                free(priv);
                return NULL;
        }