summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Juyung Seo <seojuyung2@gmail.com>2014-11-26 09:50:40 +0900
committerDaniel Juyung Seo <seojuyung2@gmail.com>2014-11-26 09:50:43 +0900
commitafb2e7230a16066159a04ec4b19af06afb92d8c0 (patch)
treebaf5802095f2f0d82d0805890509c9fb81adaa07
parent49ac2b812b3e284f27321b251bde8a5bd1927cdb (diff)
config: Refactor scrolling configuration dialog.
- Group thumb scroll configurations with frame. - Move thumb scroll acceleration config below thumb scroll config.
-rw-r--r--src/bin/config.c195
1 files changed, 107 insertions, 88 deletions
diff --git a/src/bin/config.c b/src/bin/config.c
index 7a5cf15fc..20afb9573 100644
--- a/src/bin/config.c
+++ b/src/bin/config.c
@@ -2959,14 +2959,14 @@ _status_config_scrolling_bounce(Evas_Object *win, Evas_Object *box)
2959} 2959}
2960 2960
2961static void 2961static void
2962_status_config_scrolling_acceleration(Evas_Object *win, Evas_Object *box) 2962_status_config_scrolling_thumb(Evas_Object *win, Evas_Object *box)
2963{ 2963{
2964 Evas_Object *fr, *bx, *sl, *pd, *lb; 2964 Evas_Object *fr, *bx, *ck, *sl, *sp, *pd, *lb;
2965 2965
2966 fr = elm_frame_add(box); 2966 fr = elm_frame_add(box);
2967 evas_object_size_hint_weight_set(fr, EVAS_HINT_EXPAND, 0.0); 2967 evas_object_size_hint_weight_set(fr, EVAS_HINT_EXPAND, 0.0);
2968 evas_object_size_hint_align_set(fr, EVAS_HINT_FILL, EVAS_HINT_FILL); 2968 evas_object_size_hint_align_set(fr, EVAS_HINT_FILL, EVAS_HINT_FILL);
2969 elm_object_text_set(fr, "Acceleration"); 2969 elm_object_text_set(fr, "Thumb Scroll");
2970 elm_box_pack_end(box, fr); 2970 elm_box_pack_end(box, fr);
2971 evas_object_show(fr); 2971 evas_object_show(fr);
2972 2972
@@ -2974,91 +2974,6 @@ _status_config_scrolling_acceleration(Evas_Object *win, Evas_Object *box)
2974 elm_object_content_set(fr, bx); 2974 elm_object_content_set(fr, bx);
2975 evas_object_show(bx); 2975 evas_object_show(bx);
2976 2976
2977 /* Thumb scroll acceleration threshold */
2978 LABEL_FRAME_ADD("<hilight>Thumb scroll acceleration threshold</>");
2979
2980 sl = elm_slider_add(bx);
2981 elm_object_tooltip_text_set(sl, "This is the minimum speed of mouse <br/>"
2982 "cursor movement which will accelerate<br/>"
2983 "scrolling velocity after a<br/>"
2984 "mouse up event (pixels/second)");
2985 evas_object_data_set(win, "ts_acceleration_threshold_slider", sl);
2986 evas_object_size_hint_weight_set(sl, EVAS_HINT_EXPAND, 0.0);
2987 evas_object_size_hint_align_set(sl, EVAS_HINT_FILL, 0.5);
2988 elm_slider_span_size_set(sl, 120);
2989 elm_slider_unit_format_set(sl, "%1.0f pixels/s");
2990 elm_slider_indicator_format_set(sl, "%1.0f");
2991 elm_slider_min_max_set(sl, 10.0, 5000.0);
2992 elm_slider_value_set(sl, elm_config_scroll_thumbscroll_acceleration_threshold_get());
2993 elm_box_pack_end(bx, sl);
2994 evas_object_show(sl);
2995
2996 evas_object_smart_callback_add(sl, "changed", tsat_round, NULL);
2997 evas_object_smart_callback_add(sl, "delay,changed", tsat_change, NULL);
2998
2999 /* Thumb scroll acceleration time limit */
3000 LABEL_FRAME_ADD("<hilight>Thumb scroll acceleration time limit</>");
3001
3002 sl = elm_slider_add(bx);
3003 elm_object_tooltip_text_set(sl, "This is the time limit for<br/>"
3004 "accelerating velocity<br/>");
3005 evas_object_data_set(win, "ts_acceleration_time_limit_slider", sl);
3006 evas_object_size_hint_weight_set(sl, EVAS_HINT_EXPAND, 0.0);
3007 evas_object_size_hint_align_set(sl, EVAS_HINT_FILL, 0.5);
3008 elm_slider_span_size_set(sl, 120);
3009 elm_slider_unit_format_set(sl, "%1.1f");
3010 elm_slider_indicator_format_set(sl, "%1.1f");
3011 elm_slider_min_max_set(sl, 0.0, 15.0);
3012 elm_slider_value_set(sl, elm_config_scroll_thumbscroll_acceleration_time_limit_get());
3013 elm_box_pack_end(bx, sl);
3014 evas_object_show(sl);
3015
3016 evas_object_smart_callback_add(sl, "changed", tsatl_round, NULL);
3017 evas_object_smart_callback_add(sl, "delay,changed", tsatl_change, NULL);
3018
3019 /* Thumb scroll acceleration weight */
3020 LABEL_FRAME_ADD("<hilight>Thumb scroll acceleration weight</>");
3021
3022 sl = elm_slider_add(bx);
3023 elm_object_tooltip_text_set(sl, "This is the weight for acceleration");
3024 evas_object_data_set(win, "ts_acceleration_weight_slider", sl);
3025 evas_object_size_hint_weight_set(sl, EVAS_HINT_EXPAND, 0.0);
3026 evas_object_size_hint_align_set(sl, EVAS_HINT_FILL, 0.5);
3027 elm_slider_span_size_set(sl, 120);
3028 elm_slider_unit_format_set(sl, "%1.1f");
3029 elm_slider_indicator_format_set(sl, "%1.1f");
3030 elm_slider_min_max_set(sl, 1.0, 10.0);
3031 elm_slider_value_set(sl, elm_config_scroll_thumbscroll_acceleration_weight_get());
3032 elm_box_pack_end(bx, sl);
3033 evas_object_show(sl);
3034
3035 evas_object_smart_callback_add(sl, "changed", tsaw_round, NULL);
3036 evas_object_smart_callback_add(sl, "delay,changed", tsaw_change, NULL);
3037}
3038
3039static void
3040_status_config_scrolling(Evas_Object *win,
3041 Evas_Object *naviframe)
3042{
3043 Evas_Object *lb, *pd, *bx, *sl, *sp, *ck, *sc;
3044
3045 bx = elm_box_add(win);
3046 evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, 0.0);
3047 evas_object_size_hint_align_set(bx, EVAS_HINT_FILL, 0.5);
3048
3049 sc = elm_scroller_add(win);
3050 evas_object_size_hint_weight_set(sc, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
3051 evas_object_size_hint_align_set(sc, EVAS_HINT_FILL, EVAS_HINT_FILL);
3052 elm_scroller_bounce_set(sc, EINA_FALSE, EINA_TRUE);
3053 evas_object_show(sc);
3054 elm_object_content_set(sc, bx);
3055
3056 /* Bounce */
3057 _status_config_scrolling_bounce(win, bx);
3058
3059 /* Acceleration */
3060 _status_config_scrolling_acceleration(win, bx);
3061
3062 /* Enable thumb scroll */ 2977 /* Enable thumb scroll */
3063 CHECK_ADD("Enable thumb scroll", 2978 CHECK_ADD("Enable thumb scroll",
3064 "Set whether scrollers should be<br/>" 2979 "Set whether scrollers should be<br/>"
@@ -3268,6 +3183,110 @@ _status_config_scrolling(Evas_Object *win,
3268 evas_object_size_hint_align_set(sp, EVAS_HINT_FILL, 0.5); 3183 evas_object_size_hint_align_set(sp, EVAS_HINT_FILL, 0.5);
3269 elm_box_pack_end(bx, sp); 3184 elm_box_pack_end(bx, sp);
3270 evas_object_show(sp); 3185 evas_object_show(sp);
3186}
3187
3188static void
3189_status_config_scrolling_acceleration(Evas_Object *win, Evas_Object *box)
3190{
3191 Evas_Object *fr, *bx, *sl, *pd, *lb;
3192
3193 fr = elm_frame_add(box);
3194 evas_object_size_hint_weight_set(fr, EVAS_HINT_EXPAND, 0.0);
3195 evas_object_size_hint_align_set(fr, EVAS_HINT_FILL, EVAS_HINT_FILL);
3196 elm_object_text_set(fr, "Thumb Scroll Acceleration");
3197 elm_box_pack_end(box, fr);
3198 evas_object_show(fr);
3199
3200 bx = elm_box_add(fr);
3201 elm_object_content_set(fr, bx);
3202 evas_object_show(bx);
3203
3204 /* Thumb scroll acceleration threshold */
3205 LABEL_FRAME_ADD("<hilight>Thumb scroll acceleration threshold</>");
3206
3207 sl = elm_slider_add(bx);
3208 elm_object_tooltip_text_set(sl, "This is the minimum speed of mouse <br/>"
3209 "cursor movement which will accelerate<br/>"
3210 "scrolling velocity after a<br/>"
3211 "mouse up event (pixels/second)");
3212 evas_object_data_set(win, "ts_acceleration_threshold_slider", sl);
3213 evas_object_size_hint_weight_set(sl, EVAS_HINT_EXPAND, 0.0);
3214 evas_object_size_hint_align_set(sl, EVAS_HINT_FILL, 0.5);
3215 elm_slider_span_size_set(sl, 120);
3216 elm_slider_unit_format_set(sl, "%1.0f pixels/s");
3217 elm_slider_indicator_format_set(sl, "%1.0f");
3218 elm_slider_min_max_set(sl, 10.0, 5000.0);
3219 elm_slider_value_set(sl, elm_config_scroll_thumbscroll_acceleration_threshold_get());
3220 elm_box_pack_end(bx, sl);
3221 evas_object_show(sl);
3222
3223 evas_object_smart_callback_add(sl, "changed", tsat_round, NULL);
3224 evas_object_smart_callback_add(sl, "delay,changed", tsat_change, NULL);
3225
3226 /* Thumb scroll acceleration time limit */
3227 LABEL_FRAME_ADD("<hilight>Thumb scroll acceleration time limit</>");
3228
3229 sl = elm_slider_add(bx);
3230 elm_object_tooltip_text_set(sl, "This is the time limit for<br/>"
3231 "accelerating velocity<br/>");
3232 evas_object_data_set(win, "ts_acceleration_time_limit_slider", sl);
3233 evas_object_size_hint_weight_set(sl, EVAS_HINT_EXPAND, 0.0);
3234 evas_object_size_hint_align_set(sl, EVAS_HINT_FILL, 0.5);
3235 elm_slider_span_size_set(sl, 120);
3236 elm_slider_unit_format_set(sl, "%1.1f");
3237 elm_slider_indicator_format_set(sl, "%1.1f");
3238 elm_slider_min_max_set(sl, 0.0, 15.0);
3239 elm_slider_value_set(sl, elm_config_scroll_thumbscroll_acceleration_time_limit_get());
3240 elm_box_pack_end(bx, sl);
3241 evas_object_show(sl);
3242
3243 evas_object_smart_callback_add(sl, "changed", tsatl_round, NULL);
3244 evas_object_smart_callback_add(sl, "delay,changed", tsatl_change, NULL);
3245
3246 /* Thumb scroll acceleration weight */
3247 LABEL_FRAME_ADD("<hilight>Thumb scroll acceleration weight</>");
3248
3249 sl = elm_slider_add(bx);
3250 elm_object_tooltip_text_set(sl, "This is the weight for acceleration");
3251 evas_object_data_set(win, "ts_acceleration_weight_slider", sl);
3252 evas_object_size_hint_weight_set(sl, EVAS_HINT_EXPAND, 0.0);
3253 evas_object_size_hint_align_set(sl, EVAS_HINT_FILL, 0.5);
3254 elm_slider_span_size_set(sl, 120);
3255 elm_slider_unit_format_set(sl, "%1.1f");
3256 elm_slider_indicator_format_set(sl, "%1.1f");
3257 elm_slider_min_max_set(sl, 1.0, 10.0);
3258 elm_slider_value_set(sl, elm_config_scroll_thumbscroll_acceleration_weight_get());
3259 elm_box_pack_end(bx, sl);
3260 evas_object_show(sl);
3261
3262 evas_object_smart_callback_add(sl, "changed", tsaw_round, NULL);
3263 evas_object_smart_callback_add(sl, "delay,changed", tsaw_change, NULL);
3264}
3265
3266static void
3267_status_config_scrolling(Evas_Object *win,
3268 Evas_Object *naviframe)
3269{
3270 Evas_Object *lb, *pd, *bx, *sl, *sc;
3271
3272 bx = elm_box_add(win);
3273 evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, 0.0);
3274 evas_object_size_hint_align_set(bx, EVAS_HINT_FILL, 0.5);
3275
3276 sc = elm_scroller_add(win);
3277 evas_object_size_hint_weight_set(sc, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
3278 evas_object_size_hint_align_set(sc, EVAS_HINT_FILL, EVAS_HINT_FILL);
3279 elm_scroller_bounce_set(sc, EINA_FALSE, EINA_TRUE);
3280 evas_object_show(sc);
3281 elm_object_content_set(sc, bx);
3282
3283 /* Bounce */
3284 _status_config_scrolling_bounce(win, bx);
3285
3286 _status_config_scrolling_thumb(win, bx);
3287
3288 /* Acceleration */
3289 _status_config_scrolling_acceleration(win, bx);
3271 3290
3272 /* Page scroll friction */ 3291 /* Page scroll friction */
3273 LABEL_FRAME_ADD("<hilight>Page scroll friction</>"); 3292 LABEL_FRAME_ADD("<hilight>Page scroll friction</>");