summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Faure <billiob@gmail.com>2020-07-31 12:59:01 +0200
committerMarcel Hollerbach <mail@marcel-hollerbach.de>2020-07-31 13:24:43 +0200
commitdb14b825494057145788becf712a6451749a474a (patch)
tree7b99a3a3ab0a9fe7f7905cb2f54744d066b9e777
parent42d525e15b9ed3e8ad053def6de5fc167a98fbff (diff)
elm_config: add slider to configure tooltip_delay
reviewers_: #reviewers, raster, cedric, netstar, bu5hm4n Reviewed By: bu5hm4n Subscribers: bu5hm4n, cedric, #reviewers, #committers Tags: #efl Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de> Differential Revision: https://phab.enlightenment.org/D12060
-rw-r--r--src/bin/elementary/config.c46
1 files changed, 44 insertions, 2 deletions
diff --git a/src/bin/elementary/config.c b/src/bin/elementary/config.c
index 17d1376f54..ff05307700 100644
--- a/src/bin/elementary/config.c
+++ b/src/bin/elementary/config.c
@@ -942,7 +942,7 @@ transition_duration_change(void *data EINA_UNUSED,
942 void *event_info EINA_UNUSED) 942 void *event_info EINA_UNUSED)
943{ 943{
944 double val = elm_slider_value_get(obj); 944 double val = elm_slider_value_get(obj);
945 Eina_Bool scale = elm_config_transition_duration_factor_get(); 945 double scale = elm_config_transition_duration_factor_get();
946 946
947 if (EINA_DBL_EQ(scale, val)) return; 947 if (EINA_DBL_EQ(scale, val)) return;
948 elm_config_transition_duration_factor_set(val); 948 elm_config_transition_duration_factor_set(val);
@@ -950,6 +950,20 @@ transition_duration_change(void *data EINA_UNUSED,
950} 950}
951 951
952static void 952static void
953tooltip_delay_change(void *data EINA_UNUSED,
954 Evas_Object *obj,
955 void *event_info EINA_UNUSED)
956{
957 double val = elm_slider_value_get(obj);
958 double delay = elm_config_tooltip_delay_get();
959
960 if (EINA_DBL_EQ(delay, val)) return;
961 elm_config_tooltip_delay_set(val);
962 elm_config_all_flush();
963}
964
965
966static void
953_status_basic(Evas_Object *win, 967_status_basic(Evas_Object *win,
954 Evas_Object *bx0) 968 Evas_Object *bx0)
955{ 969{
@@ -1307,7 +1321,7 @@ _config_display_update(Evas_Object *win)
1307 ts_sensitivity_friction, ts_acceleration_threshold, 1321 ts_sensitivity_friction, ts_acceleration_threshold,
1308 ts_acceleration_time_limit, ts_acceleration_weight, page_friction, 1322 ts_acceleration_time_limit, ts_acceleration_weight, page_friction,
1309 bring_in_friction, zoom_friction, transition_duration, 1323 bring_in_friction, zoom_friction, transition_duration,
1310 smooth_amount, smooth_time_window; 1324 smooth_amount, smooth_time_window, tooltip_delay;
1311 const char *curr_theme; 1325 const char *curr_theme;
1312 Eina_Bool s_bounce, ts, smooth_start; 1326 Eina_Bool s_bounce, ts, smooth_start;
1313 Elm_Theme *th; 1327 Elm_Theme *th;
@@ -1319,6 +1333,7 @@ _config_display_update(Evas_Object *win)
1319 font_c = elm_config_cache_font_cache_size_get(); 1333 font_c = elm_config_cache_font_cache_size_get();
1320 image_c = elm_config_cache_image_cache_size_get(); 1334 image_c = elm_config_cache_image_cache_size_get();
1321 transition_duration = elm_config_transition_duration_factor_get(); 1335 transition_duration = elm_config_transition_duration_factor_get();
1336 tooltip_delay = elm_config_tooltip_delay_get();
1322 edje_file_c = elm_config_cache_edje_file_cache_size_get(); 1337 edje_file_c = elm_config_cache_edje_file_cache_size_get();
1323 edje_col_c = elm_config_cache_edje_collection_cache_size_get(); 1338 edje_col_c = elm_config_cache_edje_collection_cache_size_get();
1324 1339
@@ -1423,6 +1438,7 @@ _config_display_update(Evas_Object *win)
1423 elm_object_theme_set(evas_object_data_get(win, "theme_preview"), th); 1438 elm_object_theme_set(evas_object_data_get(win, "theme_preview"), th);
1424 elm_theme_free(th); 1439 elm_theme_free(th);
1425 elm_config_transition_duration_factor_set(transition_duration); 1440 elm_config_transition_duration_factor_set(transition_duration);
1441 elm_config_tooltip_delay_set(tooltip_delay);
1426 eina_stringshare_del(curr_theme); 1442 eina_stringshare_del(curr_theme);
1427} 1443}
1428 1444
@@ -2023,6 +2039,32 @@ _status_config_etc(Evas_Object *win,
2023 CHECK_ADD("Enable ATSPI support", "Set atspi mode", atspi_change, NULL); 2039 CHECK_ADD("Enable ATSPI support", "Set atspi mode", atspi_change, NULL);
2024 elm_check_state_set(ck, elm_config_atspi_mode_get()); 2040 elm_check_state_set(ck, elm_config_atspi_mode_get());
2025 2041
2042 // tooltip delay
2043 fr = elm_frame_add(bx);
2044 elm_object_text_set(fr, "Tooltip delay");
2045 evas_object_size_hint_weight_set(fr, EVAS_HINT_EXPAND, 0.0);
2046 evas_object_size_hint_align_set(fr, EVAS_HINT_FILL, 0.5);
2047 elm_box_pack_end(bx, fr);
2048 evas_object_show(fr);
2049
2050 bx2 = elm_box_add(fr);
2051 elm_object_content_set(fr, bx2);
2052 evas_object_show(bx2);
2053
2054 sl = elm_slider_add(bx2);
2055 evas_object_size_hint_weight_set(sl, EVAS_HINT_EXPAND, 0.0);
2056 evas_object_size_hint_align_set(sl, EVAS_HINT_FILL, 0.5);
2057 elm_slider_span_size_set(sl, 120);
2058 elm_slider_unit_format_set(sl, "%1.1f");
2059 elm_slider_indicator_format_set(sl, "%1.1f");
2060 elm_slider_min_max_set(sl, 0, 20.0);
2061 elm_slider_value_set(sl, elm_config_tooltip_delay_get());
2062 elm_box_pack_end(bx2, sl);
2063 evas_object_show(sl);
2064 evas_object_smart_callback_add(sl, "changed", sc_round, NULL);
2065 evas_object_smart_callback_add(sl, "delay,changed", tooltip_delay_change, NULL);
2066
2067
2026 // transition duration in edje 2068 // transition duration in edje
2027 fr = elm_frame_add(bx); 2069 fr = elm_frame_add(bx);
2028 elm_object_text_set(fr, "Edje Transition Duration Factor"); 2070 elm_object_text_set(fr, "Edje Transition Duration Factor");