summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2019-09-18 18:56:42 +0100
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2019-09-18 18:59:54 +0100
commit1783c328394ffe1743522cab4d904a226ac7574c (patch)
tree05d6952e15330666369f0aab47fe70b4115c8ab9 /src/modules
parentb8afba1e49ce6e3d1c4ae4e8161b5b7df2c9be5d (diff)
backlight - add battery timeout in addition to regular dim timeout
this allows for a shorter timeout when on battery vs when on ac for backlight dimming. this is actually important so when on ac dimming can interrupt minimally bur when on battery it can be much more aggressive.
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/conf_display/e_int_config_dpms.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/modules/conf_display/e_int_config_dpms.c b/src/modules/conf_display/e_int_config_dpms.c
index e520de6..b3a8638 100644
--- a/src/modules/conf_display/e_int_config_dpms.c
+++ b/src/modules/conf_display/e_int_config_dpms.c
@@ -14,6 +14,8 @@ struct _E_Config_Dialog_Data
14 E_Config_Dialog *cfd; 14 E_Config_Dialog *cfd;
15 15
16 Evas_Object *backlight_slider_idle; 16 Evas_Object *backlight_slider_idle;
17 Evas_Object *backlight_battery_slider_idle;
18 Evas_Object *backlight_battery_label;
17 Evas_Object *backlight_slider_fade; 19 Evas_Object *backlight_slider_fade;
18 20
19 char *bl_dev; 21 char *bl_dev;
@@ -23,6 +25,7 @@ struct _E_Config_Dialog_Data
23 double backlight_normal; 25 double backlight_normal;
24 double backlight_dim; 26 double backlight_dim;
25 double backlight_timeout; 27 double backlight_timeout;
28 double backlight_battery_timeout;
26 double backlight_transition; 29 double backlight_transition;
27 30
28 int ask_presentation; 31 int ask_presentation;
@@ -68,6 +71,7 @@ _fill_data(E_Config_Dialog_Data *cfdata)
68 cfdata->backlight_transition = e_config->backlight.transition; 71 cfdata->backlight_transition = e_config->backlight.transition;
69 cfdata->enable_idle_dim = e_config->backlight.idle_dim; 72 cfdata->enable_idle_dim = e_config->backlight.idle_dim;
70 cfdata->backlight_timeout = e_config->backlight.timer; 73 cfdata->backlight_timeout = e_config->backlight.timer;
74 cfdata->backlight_battery_timeout = e_config->backlight.battery_timer;
71 cfdata->ask_presentation = e_config->screensaver_ask_presentation; 75 cfdata->ask_presentation = e_config->screensaver_ask_presentation;
72 cfdata->ask_presentation_timeout = e_config->screensaver_ask_presentation_timeout; 76 cfdata->ask_presentation_timeout = e_config->screensaver_ask_presentation_timeout;
73} 77}
@@ -97,6 +101,7 @@ _apply_data(E_Config_Dialog *cfd EINA_UNUSED, E_Config_Dialog_Data *cfdata)
97 e_config->backlight.dim = cfdata->backlight_dim / 100.0; 101 e_config->backlight.dim = cfdata->backlight_dim / 100.0;
98 e_config->backlight.transition = cfdata->backlight_transition; 102 e_config->backlight.transition = cfdata->backlight_transition;
99 e_config->backlight.timer = lround(cfdata->backlight_timeout); 103 e_config->backlight.timer = lround(cfdata->backlight_timeout);
104 e_config->backlight.battery_timer = lround(cfdata->backlight_battery_timeout);
100 e_config->backlight.idle_dim = cfdata->enable_idle_dim; 105 e_config->backlight.idle_dim = cfdata->enable_idle_dim;
101 e_config->screensaver_ask_presentation = cfdata->ask_presentation; 106 e_config->screensaver_ask_presentation = cfdata->ask_presentation;
102 e_config->screensaver_ask_presentation_timeout = cfdata->ask_presentation_timeout; 107 e_config->screensaver_ask_presentation_timeout = cfdata->ask_presentation_timeout;
@@ -125,12 +130,15 @@ _advanced_check_changed(E_Config_Dialog *cfd EINA_UNUSED, E_Config_Dialog_Data *
125{ 130{
126 // set state from saved config 131 // set state from saved config
127 e_widget_disabled_set(cfdata->backlight_slider_idle, !cfdata->enable_idle_dim); 132 e_widget_disabled_set(cfdata->backlight_slider_idle, !cfdata->enable_idle_dim);
133 e_widget_disabled_set(cfdata->backlight_battery_slider_idle, !cfdata->enable_idle_dim);
134 e_widget_disabled_set(cfdata->backlight_battery_label, !cfdata->enable_idle_dim);
128 e_widget_disabled_set(cfdata->backlight_slider_fade, !cfdata->enable_idle_dim); 135 e_widget_disabled_set(cfdata->backlight_slider_fade, !cfdata->enable_idle_dim);
129 136
130 return (!EINA_DBL_EQ(e_config->backlight.normal * 100.0, cfdata->backlight_normal)) || 137 return (!EINA_DBL_EQ(e_config->backlight.normal * 100.0, cfdata->backlight_normal)) ||
131 (!EINA_DBL_EQ(e_config->backlight.dim * 100.0, cfdata->backlight_dim)) || 138 (!EINA_DBL_EQ(e_config->backlight.dim * 100.0, cfdata->backlight_dim)) ||
132 (!EINA_DBL_EQ(e_config->backlight.transition, cfdata->backlight_transition)) || 139 (!EINA_DBL_EQ(e_config->backlight.transition, cfdata->backlight_transition)) ||
133 (!EINA_DBL_EQ(e_config->backlight.timer, cfdata->backlight_timeout)) || 140 (!EINA_DBL_EQ(e_config->backlight.timer, cfdata->backlight_timeout)) ||
141 (!EINA_DBL_EQ(e_config->backlight.battery_timer, cfdata->backlight_battery_timeout)) ||
134 (e_config->backlight.idle_dim != cfdata->enable_idle_dim) || 142 (e_config->backlight.idle_dim != cfdata->enable_idle_dim) ||
135 (e_config->screensaver_ask_presentation != cfdata->ask_presentation) || 143 (e_config->screensaver_ask_presentation != cfdata->ask_presentation) ||
136 (!EINA_DBL_EQ(e_config->screensaver_ask_presentation_timeout, cfdata->ask_presentation_timeout)); 144 (!EINA_DBL_EQ(e_config->screensaver_ask_presentation_timeout, cfdata->ask_presentation_timeout));
@@ -192,6 +200,15 @@ _advanced_create_widgets(E_Config_Dialog *cfd EINA_UNUSED, Evas *evas, E_Config_
192 cfdata->backlight_slider_idle = ob; 200 cfdata->backlight_slider_idle = ob;
193 e_widget_disabled_set(ob, !cfdata->enable_idle_dim); // set state from saved config 201 e_widget_disabled_set(ob, !cfdata->enable_idle_dim); // set state from saved config
194 e_widget_list_object_append(o, ob, 1, 1, 0.5); 202 e_widget_list_object_append(o, ob, 1, 1, 0.5);
203 ob = e_widget_label_add(evas, _("Fade Time on Battery"));
204 cfdata->backlight_battery_label = ob;
205 e_widget_disabled_set(ob, !cfdata->enable_idle_dim); // set state from saved config
206 e_widget_list_object_append(o, ob, 1, 1, 0.5);
207 ob = e_widget_slider_add(evas, 1, 0, _("%1.0f second(s)"), 0.0, 300.0, 1.0, 0,
208 &(cfdata->backlight_battery_timeout), NULL, 100);
209 cfdata->backlight_battery_slider_idle = ob;
210 e_widget_disabled_set(ob, !cfdata->enable_idle_dim); // set state from saved config
211 e_widget_list_object_append(o, ob, 1, 1, 0.5);
195 212
196 ob = e_widget_label_add(evas, _("Fade Time")); 213 ob = e_widget_label_add(evas, _("Fade Time"));
197 e_widget_list_object_append(o, ob, 1, 1, 0.5); 214 e_widget_list_object_append(o, ob, 1, 1, 0.5);