From 43a61b3e249dbea13eebe10c94fb2651921040e0 Mon Sep 17 00:00:00 2001 From: Theo Arends <11044339+arendst@users.noreply.github.com> Date: Sat, 6 Apr 2019 18:25:26 +0200 Subject: [PATCH] 6.5.0.5 Add compile time GUI color options 6.5.0.5 20190406 * Add compile time GUI color options (#5586) --- sonoff/_changelog.ino | 5 ++- sonoff/my_user_config.h | 26 +++++++++++++++ sonoff/sonoff_version.h | 2 +- sonoff/xdrv_01_webserver.ino | 65 ++++++++++++++++++++++++++++-------- sonoff/xdrv_09_timers.ino | 19 +++++++++-- 5 files changed, 98 insertions(+), 19 deletions(-) diff --git a/sonoff/_changelog.ino b/sonoff/_changelog.ino index e21c7409a..95d065ccb 100644 --- a/sonoff/_changelog.ino +++ b/sonoff/_changelog.ino @@ -1,4 +1,7 @@ -/* 6.5.0.4 20190402 +/* 6.5.0.5 20190406 + * Add compile time GUI color options (#5586) + * + * 6.5.0.4 20190402 * Fix Configure Timer Web GUI (#5568) * Add validation check when loading settings from flash * Fixed Display Bug in KNX webmenu for Physical Address diff --git a/sonoff/my_user_config.h b/sonoff/my_user_config.h index 407a25c13..97a43836f 100644 --- a/sonoff/my_user_config.h +++ b/sonoff/my_user_config.h @@ -257,6 +257,32 @@ #define WEB_USERNAME "admin" // Web server Admin mode user name #define USE_EMULATION // Enable Belkin WeMo and Hue Bridge emulation for Alexa (+16k code, +2k mem) +// Black text on white/greyish background (default) + #define COLOR_TEXT "#000" // Global text color - Black + #define COLOR_BACKGROUND "#fff" // Global background color - White + #define COLOR_FORM "#f2f2f2" // Form background color - Greyish + +// White text on black/greyish background (alternative) +// #define COLOR_TEXT "#fff" // Global text color - White +// #define COLOR_BACKGROUND "#000" // Global background color - Black +// #define COLOR_FORM "#4f4f4f" // Form background color - Greyish + + #define COLOR_TEXT_WARNING "red" // Warning text color - Red + #define COLOR_TEXT_SUCCESS "green" // Success text color - Green + + #define COLOR_BUTTON_TEXT "#fff" // Button text color - White + #define COLOR_BUTTON "#1fa3ec" // Button color - Blueish + #define COLOR_BUTTON_HOVER "#0e70a4" // Button color when hovered over - Darker blueish + #define COLOR_BUTTON_RESET "#d43535" // Restart/Reset/Delete button color - Redish + #define COLOR_BUTTON_RESET_HOVER "#931f1f" // Restart/Reset/Delete button color when hovered over - Darker redish + #define COLOR_BUTTON_SAVE "#47c266" // Save button color - Greenish + #define COLOR_BUTTON_SAVE_HOVER "#5aaf6f" // Save button color when hovered over - Darker greenish + + #define COLOR_TIMER_TAB_TEXT "#fff" // Config timer tab text color - White + #define COLOR_TIMER_TAB_BACKGROUND "#999" // Config timer tab background color - Light grey + #define COLOR_TIMER_ACTIVE_TAB_TEXT "#000" // Config timer active tab text color - Black + #define COLOR_TIMER_ACTIVE_TAB_BG "transparent" // Config timer active tab text color - Transparent (= COLOR_FORM) + // -- mDNS ---------------------------------------- #define USE_DISCOVERY // Enable mDNS for the following services (+8k code, +0.3k mem) #define WEBSERVER_ADVERTISE // Provide access to webserver by name .local/ diff --git a/sonoff/sonoff_version.h b/sonoff/sonoff_version.h index 3a8dc0eb8..c43d2d6d3 100644 --- a/sonoff/sonoff_version.h +++ b/sonoff/sonoff_version.h @@ -20,6 +20,6 @@ #ifndef _SONOFF_VERSION_H_ #define _SONOFF_VERSION_H_ -const uint32_t VERSION = 0x06050004; +const uint32_t VERSION = 0x06050005; #endif // _SONOFF_VERSION_H_ diff --git a/sonoff/xdrv_01_webserver.ino b/sonoff/xdrv_01_webserver.ino index 33391287f..ff5672093 100644 --- a/sonoff/xdrv_01_webserver.ino +++ b/sonoff/xdrv_01_webserver.ino @@ -31,6 +31,43 @@ #define WIFI_SOFT_AP_CHANNEL 1 // Soft Access Point Channel number between 1 and 11 as used by SmartConfig web GUI #endif +#ifndef COLOR_TEXT_WARNING +#define COLOR_TEXT_WARNING "red" // Warning text color - Red +#endif +#ifndef COLOR_TEXT_SUCCESS +#define COLOR_TEXT_SUCCESS "green" // Success text color - Green +#endif +#ifndef COLOR_TEXT +#define COLOR_TEXT "#000" // Global text color - Black +#endif +#ifndef COLOR_BACKGROUND +#define COLOR_BACKGROUND "#fff" // Global background color - White +#endif +#ifndef COLOR_FORM +#define COLOR_FORM "#f2f2f2" // Form background color - Greyish +#endif +#ifndef COLOR_BUTTON_TEXT +#define COLOR_BUTTON_TEXT "#fff" // Button text color - White +#endif +#ifndef COLOR_BUTTON +#define COLOR_BUTTON "#1fa3ec" // Button color - Blueish +#endif +#ifndef COLOR_BUTTON_HOVER +#define COLOR_BUTTON_HOVER "#0e70a4" // Button color when hovered over - Darker blueish +#endif +#ifndef COLOR_BUTTON_RESET +#define COLOR_BUTTON_RESET "#d43535" // Restart/Reset/Delete button color - Redish +#endif +#ifndef COLOR_BUTTON_RESET_HOVER +#define COLOR_BUTTON_RESET_HOVER "#931f1f" // Restart/Reset/Delete button color when hovered over - Darker redish +#endif +#ifndef COLOR_BUTTON_SAVE +#define COLOR_BUTTON_SAVE "#47c266" // Save button color - Greenish +#endif +#ifndef COLOR_BUTTON_SAVE_HOVER +#define COLOR_BUTTON_SAVE_HOVER "#5aaf6f" // Save button color when hovered over - Darker greenish +#endif + const uint16_t CHUNKED_BUFFER_SIZE = 400; // Chunk buffer size (should be smaller than half mqtt_date size) const uint16_t HTTP_REFRESH_TIME = 2345; // milliseconds @@ -239,21 +276,21 @@ const char HTTP_HEAD_STYLE1[] PROGMEM = "