summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrej Valek <[email protected]>2020-10-23 22:05:37 +0200
committerraveit65 <[email protected]>2020-11-10 20:30:02 +0100
commitd879a18a09e9cbdd43050365e08afd9f9bee72bd (patch)
tree815507378ee5fedfe8999070eff1db9ffb8ebc89
parent42ccd70cbe786d58a68e8479b77b80334186f665 (diff)
downloadmate-power-manager-d879a18a09e9cbdd43050365e08afd9f9bee72bd.tar.bz2
mate-power-manager-d879a18a09e9cbdd43050365e08afd9f9bee72bd.tar.xz
mate-power-preferences: add option to enable keyboard dimming
-rw-r--r--data/gpm-prefs.ui56
-rw-r--r--src/gpm-prefs-core.c3
2 files changed, 59 insertions, 0 deletions
diff --git a/data/gpm-prefs.ui b/data/gpm-prefs.ui
index 81638ff..996fc60 100644
--- a/data/gpm-prefs.ui
+++ b/data/gpm-prefs.ui
@@ -639,6 +639,62 @@
<property name="position">1</property>
</packing>
</child>
+ <child>
+ <object class="GtkFrame" id="frame_battery_keyboard">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label_xalign">0</property>
+ <property name="shadow_type">none</property>
+ <child>
+ <object class="GtkAlignment">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="left_padding">12</property>
+ <child>
+ <object class="GtkBox">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="margin_top">6</property>
+ <property name="margin_bottom">6</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">6</property>
+ <child>
+ <object class="GtkCheckButton" id="checkbutton_battery_keyboard_reduce">
+ <property name="label" translatable="yes">_Reduce keyboard backlight</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="halign">start</property>
+ <property name="use_underline">True</property>
+ <property name="draw_indicator">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ </object>
+ </child>
+ <child type="label">
+ <object class="GtkLabel" id="label_battery_keboard">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Keyboard</property>
+ <attributes>
+ <attribute name="weight" value="bold"/>
+ </attributes>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
</object>
<packing>
<property name="position">1</property>
diff --git a/src/gpm-prefs-core.c b/src/gpm-prefs-core.c
index b43dd12..4375a6a 100644
--- a/src/gpm-prefs-core.c
+++ b/src/gpm-prefs-core.c
@@ -480,6 +480,9 @@ prefs_setup_battery (GpmPrefs *prefs)
g_settings_bind (prefs->priv->settings, GPM_SETTINGS_IDLE_DIM_BATT,
GET_WIDGET ("checkbutton_battery_display_dim"), "active",
G_SETTINGS_BIND_DEFAULT);
+ g_settings_bind (prefs->priv->settings, GPM_SETTINGS_KBD_BACKLIGHT_BATT_REDUCE,
+ GET_WIDGET ("checkbutton_battery_keyboard_reduce"), "active",
+ G_SETTINGS_BIND_DEFAULT);
if (prefs->priv->has_button_lid == FALSE)
gtk_widget_hide (GET_WIDGET ("box_battery_lid"));