Add nightlight indicator switch

This commit is contained in:
zapashcanon 2018-08-03 16:15:52 +01:00
parent 6800d2fff7
commit 8a6d8754a5
Signed by: zapashcanon
GPG Key ID: 8981C3C62D1D28F1
3 changed files with 12 additions and 2 deletions

View File

@ -17,7 +17,8 @@ const SETTING_SHOW_NETWORK_INDICATOR = 'show-network-indicator';
const SETTING_SHOW_RFKILL_INDICATOR = 'show-rfkill-indicator';
const SETTING_SHOW_BLUETOOTH_INDICATOR = 'show-bluetooth-indicator';
const SETTING_SHOW_POWER_INDICATOR = 'show-power-indicator';
const SETTING_SHOW_POWER_PERCENTAGE_LABEL = 'show-power-percentage-label'
const SETTING_SHOW_POWER_PERCENTAGE_LABEL = 'show-power-percentage-label';
const SETTING_SHOW_NIGHTLIGHT_INDICATOR = 'show-nightlight-indicator';
const SETTING_REMOVE_ROUNDED_CORNERS = 'remove-rounded-corners';
function init() {
@ -49,6 +50,7 @@ function disable() {
show_status_area_component_indicator('aggregateMenu', '_bluetooth', '_indicator');
show_status_area_component_indicator('aggregateMenu', '_power', '_indicator');
show_status_area_component_indicator('aggregateMenu', '_power', '_percentageLabel');
show_status_area_component_indicator('aggregateMenu', '_nightLight', '_indicator');
restore_rounded_corners();
}
@ -70,6 +72,7 @@ function auto() {
auto_status_area_component_indicator('aggregateMenu', '_bluetooth', '_indicator', SETTING_SHOW_BLUETOOTH_INDICATOR);
auto_status_area_component_indicator('aggregateMenu', '_power', '_indicator', SETTING_SHOW_POWER_INDICATOR);
auto_status_area_component_indicator('aggregateMenu', '_power', '_percentageLabel', SETTING_SHOW_POWER_PERCENTAGE_LABEL);
auto_status_area_component_indicator('aggregateMenu', '_nightLight', '_indicator', SETTING_SHOW_NIGHTLIGHT_INDICATOR);
auto_rounded_corners();
}

View File

@ -17,7 +17,8 @@ const SETTING_SHOW_NETWORK_INDICATOR = 'show-network-indicator';
const SETTING_SHOW_RFKILL_INDICATOR = 'show-rfkill-indicator';
const SETTING_SHOW_BLUETOOTH_INDICATOR = 'show-bluetooth-indicator';
const SETTING_SHOW_POWER_INDICATOR = 'show-power-indicator';
const SETTING_SHOW_POWER_PERCENTAGE_LABEL = 'show-power-percentage-label'
const SETTING_SHOW_POWER_PERCENTAGE_LABEL = 'show-power-percentage-label';
const SETTING_SHOW_NIGHTLIGHT_INDICATOR = 'show-nightlight-indicator';
const SETTING_REMOVE_ROUNDED_CORNERS = 'remove-rounded-corners';
const PowerfulTopbarPrefsWidget = new GObject.Class({
@ -52,6 +53,7 @@ const PowerfulTopbarPrefsWidget = new GObject.Class({
this._create_switch(SETTING_SHOW_RFKILL_INDICATOR);
this._create_switch(SETTING_SHOW_BLUETOOTH_INDICATOR);
this._create_switch(SETTING_SHOW_POWER_INDICATOR);
this._create_switch(SETTING_SHOW_NIGHTLIGHT_INDICATOR);
this._create_switch(SETTING_SHOW_POWER_PERCENTAGE_LABEL);
this._create_switch(SETTING_REMOVE_ROUNDED_CORNERS);

View File

@ -56,6 +56,11 @@
<summary>Show power's indicator</summary>
<description>Show power's indicator</description>
</key>
<key name="show-nightlight-indicator" type="b">
<default>false</default>
<summary>Show nightlight's indicator</summary>
<description>Show nightlight's indicator</description>
</key>
<key name="show-power-percentage-label" type="b">
<default>false</default>
<summary>Show power's percentage</summary>