summaryrefslogtreecommitdiff
path: root/panel-plugins
diff options
context:
space:
mode:
authorTimothy Lee <timothy.ty.lee@gmail.com>2020-01-06 00:43:14 +0100
committerSimon Steinbeiss <simon.steinbeiss@elfenbeinturm.at>2020-01-06 00:45:39 +0100
commitc866cf9faec6333e60f6b55a56b92ec9494747f3 (patch)
tree440256f4383b74dc578063b2ab53e9e6459b50ec /panel-plugins
parent5a32cb254f0cfdf0b2a35067a435ab1d2b3c50b8 (diff)
downloadixfce4-power-manager-c866cf9faec6333e60f6b55a56b92ec9494747f3.tar.gz
Make brightness steps configurable (Bug #12062)
This commit introduces two new options: 1) Configuring the amount of brightness steps 2) Whether to distribute the steps in a linear or exponential way Both options are presented in the settings dialog and affect the brightness keys and the panel plugin.
Diffstat (limited to 'panel-plugins')
-rw-r--r--panel-plugins/power-manager-plugin/power-manager-button.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/panel-plugins/power-manager-plugin/power-manager-button.c b/panel-plugins/power-manager-plugin/power-manager-button.c
index c71ce21b..5e4dac0c 100644
--- a/panel-plugins/power-manager-plugin/power-manager-button.c
+++ b/panel-plugins/power-manager-plugin/power-manager-button.c
@@ -1721,6 +1721,19 @@ power_manager_button_show_menu (PowerManagerButton *button)
{
max_level = xfpm_brightness_get_max_level (button->priv->brightness);
+ /* Setup brightness steps */
+ guint brightness_step_count =
+ xfconf_channel_get_uint (button->priv->channel,
+ XFPM_PROPERTIES_PREFIX BRIGHTNESS_STEP_COUNT,
+ 10);
+ gboolean brightness_exponential =
+ xfconf_channel_get_bool (button->priv->channel,
+ XFPM_PROPERTIES_PREFIX BRIGHTNESS_EXPONENTIAL,
+ FALSE);
+ xfpm_brightness_set_step_count (button->priv->brightness,
+ brightness_step_count,
+ brightness_exponential);
+
mi = scale_menu_item_new_with_range (button->priv->brightness_min_level, max_level, 1);
scale_menu_item_set_description_label (SCALE_MENU_ITEM (mi), _("<b>Display brightness</b>"));