forked from enlightenment/efl
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
This commit is contained in:
parent
42d525e15b
commit
db14b82549
|
@ -942,13 +942,27 @@ transition_duration_change(void *data EINA_UNUSED,
|
|||
void *event_info EINA_UNUSED)
|
||||
{
|
||||
double val = elm_slider_value_get(obj);
|
||||
Eina_Bool scale = elm_config_transition_duration_factor_get();
|
||||
double scale = elm_config_transition_duration_factor_get();
|
||||
|
||||
if (EINA_DBL_EQ(scale, val)) return;
|
||||
elm_config_transition_duration_factor_set(val);
|
||||
elm_config_all_flush();
|
||||
}
|
||||
|
||||
static void
|
||||
tooltip_delay_change(void *data EINA_UNUSED,
|
||||
Evas_Object *obj,
|
||||
void *event_info EINA_UNUSED)
|
||||
{
|
||||
double val = elm_slider_value_get(obj);
|
||||
double delay = elm_config_tooltip_delay_get();
|
||||
|
||||
if (EINA_DBL_EQ(delay, val)) return;
|
||||
elm_config_tooltip_delay_set(val);
|
||||
elm_config_all_flush();
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
_status_basic(Evas_Object *win,
|
||||
Evas_Object *bx0)
|
||||
|
@ -1307,7 +1321,7 @@ _config_display_update(Evas_Object *win)
|
|||
ts_sensitivity_friction, ts_acceleration_threshold,
|
||||
ts_acceleration_time_limit, ts_acceleration_weight, page_friction,
|
||||
bring_in_friction, zoom_friction, transition_duration,
|
||||
smooth_amount, smooth_time_window;
|
||||
smooth_amount, smooth_time_window, tooltip_delay;
|
||||
const char *curr_theme;
|
||||
Eina_Bool s_bounce, ts, smooth_start;
|
||||
Elm_Theme *th;
|
||||
|
@ -1319,6 +1333,7 @@ _config_display_update(Evas_Object *win)
|
|||
font_c = elm_config_cache_font_cache_size_get();
|
||||
image_c = elm_config_cache_image_cache_size_get();
|
||||
transition_duration = elm_config_transition_duration_factor_get();
|
||||
tooltip_delay = elm_config_tooltip_delay_get();
|
||||
edje_file_c = elm_config_cache_edje_file_cache_size_get();
|
||||
edje_col_c = elm_config_cache_edje_collection_cache_size_get();
|
||||
|
||||
|
@ -1423,6 +1438,7 @@ _config_display_update(Evas_Object *win)
|
|||
elm_object_theme_set(evas_object_data_get(win, "theme_preview"), th);
|
||||
elm_theme_free(th);
|
||||
elm_config_transition_duration_factor_set(transition_duration);
|
||||
elm_config_tooltip_delay_set(tooltip_delay);
|
||||
eina_stringshare_del(curr_theme);
|
||||
}
|
||||
|
||||
|
@ -2023,6 +2039,32 @@ _status_config_etc(Evas_Object *win,
|
|||
CHECK_ADD("Enable ATSPI support", "Set atspi mode", atspi_change, NULL);
|
||||
elm_check_state_set(ck, elm_config_atspi_mode_get());
|
||||
|
||||
// tooltip delay
|
||||
fr = elm_frame_add(bx);
|
||||
elm_object_text_set(fr, "Tooltip delay");
|
||||
evas_object_size_hint_weight_set(fr, EVAS_HINT_EXPAND, 0.0);
|
||||
evas_object_size_hint_align_set(fr, EVAS_HINT_FILL, 0.5);
|
||||
elm_box_pack_end(bx, fr);
|
||||
evas_object_show(fr);
|
||||
|
||||
bx2 = elm_box_add(fr);
|
||||
elm_object_content_set(fr, bx2);
|
||||
evas_object_show(bx2);
|
||||
|
||||
sl = elm_slider_add(bx2);
|
||||
evas_object_size_hint_weight_set(sl, EVAS_HINT_EXPAND, 0.0);
|
||||
evas_object_size_hint_align_set(sl, EVAS_HINT_FILL, 0.5);
|
||||
elm_slider_span_size_set(sl, 120);
|
||||
elm_slider_unit_format_set(sl, "%1.1f");
|
||||
elm_slider_indicator_format_set(sl, "%1.1f");
|
||||
elm_slider_min_max_set(sl, 0, 20.0);
|
||||
elm_slider_value_set(sl, elm_config_tooltip_delay_get());
|
||||
elm_box_pack_end(bx2, sl);
|
||||
evas_object_show(sl);
|
||||
evas_object_smart_callback_add(sl, "changed", sc_round, NULL);
|
||||
evas_object_smart_callback_add(sl, "delay,changed", tooltip_delay_change, NULL);
|
||||
|
||||
|
||||
// transition duration in edje
|
||||
fr = elm_frame_add(bx);
|
||||
elm_object_text_set(fr, "Edje Transition Duration Factor");
|
||||
|
|
Loading…
Reference in New Issue