From 4ce557a829b9626559963ec86394b9114611b169 Mon Sep 17 00:00:00 2001 From: Blaz Kristan Date: Sun, 27 Feb 2022 22:19:05 +0100 Subject: [PATCH] Multiple fixes: - ability so select mainseg (UI) - changed preset sort (UI) - IR40 white +/- fix - IR repeatable actions fix - minor UI CSS change - removed unnecessary color functions --- wled00/colors.cpp | 27 - wled00/data/index.css | 64 +- wled00/data/index.js | 42 +- wled00/fcn_declare.h | 3 - wled00/html_ui.h | 4408 +++++++++++++++++++++-------------------- wled00/ir.cpp | 78 +- 6 files changed, 2320 insertions(+), 2302 deletions(-) diff --git a/wled00/colors.cpp b/wled00/colors.cpp index 01dbdcb4..25cce032 100644 --- a/wled00/colors.cpp +++ b/wled00/colors.cpp @@ -10,33 +10,6 @@ void setRandomColor(byte* rgb) colorHStoRGB(lastRandomIndex*256,255,rgb); } -void colorFromUint32(uint32_t in, bool secondary) -{ - byte *_col = secondary ? colSec : col; - _col[0] = R(in); - _col[1] = G(in); - _col[2] = B(in); - _col[3] = W(in); -} - -//load a color without affecting the white channel -void colorFromUint24(uint32_t in, bool secondary) -{ - byte *_col = secondary ? colSec : col; - _col[0] = R(in); - _col[1] = G(in); - _col[2] = B(in); -} - -//relatively change white brightness, minumum A=5 -void relativeChangeWhite(int8_t amount, byte lowerBoundary) -{ - int16_t new_val = (int16_t) col[3] + amount; - if (new_val > 0xFF) new_val = 0xFF; - else if (new_val < lowerBoundary) new_val = lowerBoundary; - col[3] = new_val; -} - void colorHStoRGB(uint16_t hue, byte sat, byte* rgb) //hue, sat to rgb { float h = ((float)hue)/65535.0; diff --git a/wled00/data/index.css b/wled00/data/index.css index e6e2cff3..74c8f4a2 100644 --- a/wled00/data/index.css +++ b/wled00/data/index.css @@ -760,11 +760,12 @@ input[type=number]::-webkit-outer-spin-button { margin: 3px 0 6px 0 !important; } -.segname { +.pname, .plname, .segname { position: absolute; - top: 0px; left: 50%; - padding: 9px 0; + text-align: center; + overflow: hidden; + text-overflow: clip; transform: translateX(-50%); white-space: nowrap; cursor: pointer; @@ -776,12 +777,19 @@ input[type=number]::-webkit-outer-spin-button { text-overflow: clip; } -.pname { +.segname { + top: 2px; + padding: 9px 0; +} +.pname, .plname { width: 208px; padding: 8px 0; - text-align: center; - overflow: hidden; - text-overflow: clip; +} +.pname { + top: 2px; +} +.plname { + top:0; } .pid { @@ -824,10 +832,12 @@ input[type=number]::-webkit-outer-spin-button { } .cnf-s { - position: absolute; + /*position: absolute; bottom: 100px; - right: 23px; - padding: 7px 22px; + right: 23px;*/ + padding: 9px 22px 7px; + margin: 0; + display: inline; } .pwr { @@ -889,19 +899,18 @@ input[type=number]::-webkit-outer-spin-button { .checkmark, .radiomark { position: absolute; - bottom: 0; + top: 6px; left: 0; - height: 25px; - width: 25px; - background-color: var(--c-3); + height: 24px; + width: 24px; + background-color: var(--c-4); border-radius: 10px; + /*border: 1px solid var(--c-2);*/ } .radiomark { - height: 24px; - width: 24px; border-radius: 50%; - background-color: transparent; + background-color: transparent; } .schk { @@ -925,11 +934,11 @@ input[type=number]::-webkit-outer-spin-button { .check:hover input ~ .checkmark { background-color: var(--c-4); } - +/* .check input:checked ~ .checkmark { background-color: var(--c-6); } - +*/ .checkmark:after, .radiomark:after { content: ""; position: absolute; @@ -942,7 +951,7 @@ input[type=number]::-webkit-outer-spin-button { .check .checkmark:after { left: 9px; - top: 5px; + top: 4px; width: 5px; height: 10px; border: solid var(--c-f); @@ -953,11 +962,11 @@ input[type=number]::-webkit-outer-spin-button { } .radio .radiomark:after { - width: 12px; - height: 12px; + width: 14px; + height: 14px; top: 50%; left: 50%; - margin: -6px; + margin: -7px; border-radius: 50%; background: var(--c-f); } @@ -972,7 +981,7 @@ input[type=number]::-webkit-outer-spin-button { margin-bottom: 5px; } -.seg { +.seg, .pres { position: relative; display: inline-block; padding: 8px; @@ -988,6 +997,13 @@ input[type=number]::-webkit-outer-spin-button { filter: brightness(1); } +.selected { + background-color: var(--c-4); +} +.selected .checkmark, .selected .radiokmark { + background-color: var(--c-6); +} + .list { position: relative; transition: background-color 0.5s; diff --git a/wled00/data/index.js b/wled00/data/index.js index 2a9e6e10..5a0c4d16 100644 --- a/wled00/data/index.js +++ b/wled00/data/index.js @@ -370,7 +370,7 @@ function presetError(empty) } catch (e) { } - var cn = `
`; + var cn = `
`; if (empty) cn += `You have no presets yet!`; else @@ -479,9 +479,9 @@ function populatePresets(fromls) if (qll) pQL.push([i, qll]); is.push(i); - cn += `
`; + cn += `
`; if (cfg.comp.pid) cn += `
${i}
`; - cn += `
${isPlaylist(i)?"":""}${pName(i)}
+ cn += `
${isPlaylist(i)?"":""}${pName(i)}

`; @@ -560,7 +560,7 @@ function populateSegments(s) if (i == lowestUnused) lowestUnused = i+1; if (i > lSeg) lSeg = i; - cn += `
+ cn += `