From 1cb9608a3d13d0786dbfcf63e4e6e5b2b84e0194 Mon Sep 17 00:00:00 2001 From: Romain Vigier Date: Thu, 27 Feb 2020 09:01:44 +0100 Subject: [PATCH] Update code documentation --- src/modules/Nightlighter.js | 2 +- src/modules/Switcher.js | 20 +++++++++++--------- src/modules/Themer.js | 3 ++- 3 files changed, 14 insertions(+), 11 deletions(-) diff --git a/src/modules/Nightlighter.js b/src/modules/Nightlighter.js index 1f5e647..3353159 100644 --- a/src/modules/Nightlighter.js +++ b/src/modules/Nightlighter.js @@ -31,7 +31,7 @@ const _ = Gettext.gettext; /* The Nightlighter establishes a connection with the session bus to get the -current Night Light status. It can also be asked to listen to status changes. +current Night Light status. It listens to changes and reports them. As Night Light is essential for the extension to work, it continuously checks if it is enabled and warns the user if that's not the case. diff --git a/src/modules/Switcher.js b/src/modules/Switcher.js index 6d258f3..f0d5918 100644 --- a/src/modules/Switcher.js +++ b/src/modules/Switcher.js @@ -29,17 +29,19 @@ const { Themer } = Me.imports.modules.Themer; /* -The Switcher is the brain of the extension. +The Switcher is the orchestrator of the extension. -When the extension is enabled, it listens to theme changes from the user and -changes in the Night Light status: - - On theme changes, it asks for the new day and night variants for that - theme. - - On Night Light activation or deactivation, it asks for the relevant - variant to be applied. +When the extension is enabled, it asks the Themer to listen to theme changes +from the user and the Nightlighter to listen to changes in the Night Light +status: + - On theme change, it asks the Themer to guess the new day and night + variants for that theme, and to apply the relevant variant depending on the + Night Light status. + - On Night Light activation or deactivation, it asks the Themer to apply + the relevant variant. -When the extension is disabled, it resets the theme to the last one the user -explicitely selected, stops listening to changes and cleans itself. +When the extension is disabled, it asks the Themer and the Nightlighter to +disable themselves. */ var Switcher = class { diff --git a/src/modules/Themer.js b/src/modules/Themer.js index 980a6d8..6e96b0e 100644 --- a/src/modules/Themer.js +++ b/src/modules/Themer.js @@ -29,7 +29,8 @@ const { Variants } = Me.imports.modules.Variants; /* The Themer communicates with the system to get the current theme or set a new -one. It can also be asked to listen to theme changes. +one, and get the day and night variants of a theme. It listens to theme changes +and reports them. */ var Themer = class {