(push = false)
| 5095 | } |
| 5096 | |
| 5097 | function updatePropsInputs(push = false) { |
| 5098 | if (selectedIds && selectedIds.size > 1) { |
| 5099 | noSelection.style.display = "block"; |
| 5100 | noSelection.textContent = `Multiple selected (${selectedIds.size})`; |
| 5101 | propsPanel.style.display = "none"; |
| 5102 | return; |
| 5103 | } else if (noSelection && noSelection.textContent && noSelection.textContent.startsWith("Multiple selected")) { |
| 5104 | noSelection.textContent = "No element selected"; |
| 5105 | } |
| 5106 | |
| 5107 | const el = elements.find((el) => el.id === selectedId); |
| 5108 | if (!el) { |
| 5109 | noSelection.style.display = "block"; |
| 5110 | propsPanel.style.display = "none"; |
| 5111 | return; |
| 5112 | } |
| 5113 | |
| 5114 | noSelection.style.display = "none"; |
| 5115 | propsPanel.style.display = "block"; |
| 5116 | |
| 5117 | // Keep font dropdown synced with current driver mode (TFT vs OLED) |
| 5118 | initFontList(); |
| 5119 | |
| 5120 | elementTypePill.textContent = el.type.toUpperCase(); |
| 5121 | propX.value = el.x; |
| 5122 | propY.value = el.y; |
| 5123 | propW.value = el.w; |
| 5124 | propH.value = el.h; |
| 5125 | if (propRotate) { |
| 5126 | const rotRow = propRotate.closest(".prop-row"); |
| 5127 | if (rotRow) rotRow.style.display = el.type === "line" ? "none" : ""; |
| 5128 | propRotate.value = Number(el.rotation) || 0; |
| 5129 | propRotate.disabled = el.type === "line"; |
| 5130 | } |
| 5131 | propText.value = el.text || ""; |
| 5132 | propTextSize.value = el.textSize || 2; |
| 5133 | if (propLineHeight) propLineHeight.value = el.lineHeight != null ? el.lineHeight : 12; |
| 5134 | if (propTextAutoSize) propTextAutoSize.checked = !!el.textAutoSize; |
| 5135 | propFillColor.value = el.fillColor || "#ffffff"; |
| 5136 | propStrokeColor.value = el.strokeColor || "#ffffff"; |
| 5137 | propTextColor.value = el.textColor || "#ffffff"; |
| 5138 | |
| 5139 | // Constraints UI |
| 5140 | if (constraintLeft) constraintLeft.checked = !!(el.constraints && el.constraints.left); |
| 5141 | if (constraintRight) constraintRight.checked = !!(el.constraints && el.constraints.right); |
| 5142 | if (constraintTop) constraintTop.checked = !!(el.constraints && el.constraints.top); |
| 5143 | if (constraintBottom) constraintBottom.checked = !!(el.constraints && el.constraints.bottom); |
| 5144 | |
| 5145 | if (driverMode === "u8g2") { |
| 5146 | // OLED mode: use binary fill control |
| 5147 | const isFilled = el.oledFill !== false; // Default to true |
| 5148 | propOLEDFill.checked = isFilled; |
| 5149 | fillTransparencyRow.style.display = "none"; |
| 5150 | oledFillRow.style.display = elementHasFill(el.type) ? "block" : "none"; |
| 5151 | |
| 5152 | // Disable fill color picker when OLED fill is off |
| 5153 | propFillColor.disabled = !isFilled; |
| 5154 | propFillColor.style.opacity = isFilled ? "1" : "0.3"; |
no test coverage detected