From 654eab96704c53496cc87d11acb96c78a1b88c56 Mon Sep 17 00:00:00 2001 From: Marat Fayzullin Date: Sat, 4 Nov 2023 22:23:10 -0400 Subject: [PATCH 1/2] Gave user ability to change theme and opacity. --- htdocs/css/openwebrx.css | 4 ++++ htdocs/index.html | 21 +++++++++++++++++++++ htdocs/openwebrx.js | 26 +++++++++++++++++--------- 3 files changed, 42 insertions(+), 9 deletions(-) diff --git a/htdocs/css/openwebrx.css b/htdocs/css/openwebrx.css index 1e81945d..11377086 100644 --- a/htdocs/css/openwebrx.css +++ b/htdocs/css/openwebrx.css @@ -891,6 +891,10 @@ img.openwebrx-mirror-img font-size: 10pt; } +#openwebrx-themes-listbox { + font-size: 10pt; +} + #openwebrx-cursor-blink { animation: cursor-blink 1s infinite; diff --git a/htdocs/index.html b/htdocs/index.html index f88e57fd..1a1ce11c 100644 --- a/htdocs/index.html +++ b/htdocs/index.html @@ -259,6 +259,27 @@ +
▾ Theme
+
+
+
+ +
+ +
+ +
+ +
+
▾ Display
diff --git a/htdocs/openwebrx.js b/htdocs/openwebrx.js index 8c17b18f..71ef49f3 100644 --- a/htdocs/openwebrx.js +++ b/htdocs/openwebrx.js @@ -37,7 +37,7 @@ var tuning_step = 1; var nr_enabled = false; var nr_threshold = 0; var swap_wheel = false; -var ui_theme = "default"; +var ui_scheme = "default"; function updateVolume() { audioEngine.setVolume(parseFloat($("#openwebrx-panel-volume").val()) / 100); @@ -1095,15 +1095,11 @@ function on_ws_recv(evt) { } if ('ui_opacity' in config) { - var x = config['ui_opacity']; - x = x<10? 10 : x>100? 100 : x; - $('.openwebrx-panel').css('opacity', x/100); + set_ui_opacity(config['ui_opacity']); } if ('ui_frame' in config) { - var x = config['ui_frame']; - $('#openwebrx-panel-receiver').css('border', x? '2px solid':''); - $('#openwebrx-dialog-bookmark').css('border', x? '2px solid':''); + set_ui_frame(config['ui_frame']); } if ('ui_swap_wheel' in config) { @@ -1143,8 +1139,7 @@ function on_ws_recv(evt) { } if ('ui_scheme' in config) { - ui_scheme = config['ui_scheme']; - set_ui_scheme(ui_scheme); + set_ui_scheme(config['ui_scheme']); } break; @@ -2031,9 +2026,22 @@ function nr_changed() { })); } +function set_ui_frame(x) { + $('#openwebrx-panel-receiver').css('border', x? '2px solid':''); + $('#openwebrx-dialog-bookmark').css('border', x? '2px solid':''); +} + +function set_ui_opacity(x) { + x = x<10? 10 : x>100? 100 : x; + $('.openwebrx-panel').css('opacity', x/100); +} + function set_ui_scheme(theme) { const themes = ['brown', 'red', 'green', 'khaki', 'blue', 'navy', 'night']; + // Save current theme name + ui_scheme = theme; + themes.forEach(function(theme) { $('body').removeClass('theme-' + theme); }); From 536733dbf13638ed1da0779e1c3a005e71d3218b Mon Sep 17 00:00:00 2001 From: "Stanislav Lechev [0xAF]" Date: Sun, 5 Nov 2023 06:32:46 +0200 Subject: [PATCH 2/2] change icons on themes in receiver panel and automate the changing of the vaslues --- htdocs/gfx/svg-defs.svg | 2 ++ htdocs/index.html | 6 +++--- htdocs/openwebrx.js | 2 ++ 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/htdocs/gfx/svg-defs.svg b/htdocs/gfx/svg-defs.svg index 72bd8b7c..52cfa184 100644 --- a/htdocs/gfx/svg-defs.svg +++ b/htdocs/gfx/svg-defs.svg @@ -31,5 +31,7 @@ + + diff --git a/htdocs/index.html b/htdocs/index.html index 1a1ce11c..62f8b7fb 100644 --- a/htdocs/index.html +++ b/htdocs/index.html @@ -263,11 +263,11 @@
- +
- +
- +