fix(ui): hide SDR power and align header controls
This commit is contained in:
@@ -334,13 +334,18 @@ function applyCapabilities(caps) {
|
|||||||
const txAudioBtn = document.getElementById("tx-audio-btn");
|
const txAudioBtn = document.getElementById("tx-audio-btn");
|
||||||
const txVolSlider = document.getElementById("tx-vol");
|
const txVolSlider = document.getElementById("tx-vol");
|
||||||
const txVolControl = txVolSlider ? txVolSlider.closest(".vol-label") : null;
|
const txVolControl = txVolSlider ? txVolSlider.closest(".vol-label") : null;
|
||||||
|
const hasPowerControl = !caps.filter_controls;
|
||||||
if (txPowerCol) {
|
if (txPowerCol) {
|
||||||
txPowerCol.style.display = "";
|
txPowerCol.style.display = (caps.tx || hasPowerControl || caps.lockable) ? "" : "none";
|
||||||
const label = txPowerCol.querySelector(".label span");
|
const label = txPowerCol.querySelector(".label span");
|
||||||
if (label) label.textContent = caps.tx ? "Transmit / Power" : "Power / Tuning";
|
if (label) {
|
||||||
|
label.textContent = caps.tx && hasPowerControl ? "Transmit / Power"
|
||||||
|
: caps.tx ? "Transmit / Tuning"
|
||||||
|
: hasPowerControl ? "Power / Tuning" : "Tuning";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (pttBtn) pttBtn.style.display = caps.tx ? "" : "none";
|
if (pttBtn) pttBtn.style.display = caps.tx ? "" : "none";
|
||||||
if (powerBtn) powerBtn.style.display = "";
|
if (powerBtn) powerBtn.style.display = hasPowerControl ? "" : "none";
|
||||||
if (lockBtn) lockBtn.style.display = caps.lockable ? "" : "none";
|
if (lockBtn) lockBtn.style.display = caps.lockable ? "" : "none";
|
||||||
if (txMetersRow) txMetersRow.style.display = caps.tx ? "" : "none";
|
if (txMetersRow) txMetersRow.style.display = caps.tx ? "" : "none";
|
||||||
if (txAudioBtn) txAudioBtn.style.display = caps.tx ? "" : "none";
|
if (txAudioBtn) txAudioBtn.style.display = caps.tx ? "" : "none";
|
||||||
|
|||||||
@@ -1231,7 +1231,7 @@ small { color: var(--text-muted); }
|
|||||||
}
|
}
|
||||||
.top-bar-actions {
|
.top-bar-actions {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: flex-start;
|
||||||
gap: 0.45rem 0.6rem;
|
gap: 0.45rem 0.6rem;
|
||||||
min-width: 0;
|
min-width: 0;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
@@ -1406,7 +1406,7 @@ small { color: var(--text-muted); }
|
|||||||
.header-rig-switch {
|
.header-rig-switch {
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: minmax(0, 1fr);
|
grid-template-columns: minmax(0, 1fr);
|
||||||
align-items: center;
|
align-items: start;
|
||||||
gap: 0.35rem;
|
gap: 0.35rem;
|
||||||
}
|
}
|
||||||
.header-rig-summary {
|
.header-rig-summary {
|
||||||
@@ -1428,6 +1428,7 @@ small { color: var(--text-muted); }
|
|||||||
background: var(--input-bg);
|
background: var(--input-bg);
|
||||||
color: var(--text);
|
color: var(--text);
|
||||||
font-size: 0.85rem;
|
font-size: 0.85rem;
|
||||||
|
align-self: start;
|
||||||
}
|
}
|
||||||
.header-rig-switch button {
|
.header-rig-switch button {
|
||||||
height: 2rem;
|
height: 2rem;
|
||||||
|
|||||||
Reference in New Issue
Block a user