Macros: suppress placeholder color stripes (#dedede, #fff, ...)
The bbctrl controller seeds new macros with placeholder colors like '#dedede' and '#ffffff'. Treating those as 'configured' lit up the asymmetric 6 px left stripe on every default macro, which looked lopsided. Add control-view.has_macro_color() that filters out a fixed set of default placeholders plus anything within the near-white band (R+G+B > 690). The .has-color class and the inline border-left-color style are gated on that helper, so unconfigured macros render as clean symmetric slate tiles. Tested live on http://10.1.10.55/#control with the existing macro config (#dedede): button now renders without the gray stripe.
This commit is contained in:
@@ -246,13 +246,16 @@ script#control-view-template(type="text/x-template")
|
||||
.stat-sub(v-else) Line · ETA --
|
||||
|
||||
// ----- Macro row (slice 0..7); full list lives in Settings → Macros -----
|
||||
// The colored left stripe (.has-color) is suppressed for white,
|
||||
// near-white and other default placeholder colors so unconfigured
|
||||
// macros render as clean slate tiles instead of looking lopsided.
|
||||
.macro-row(v-if="state.macros && state.macros.length")
|
||||
button.macro-btn(v-for="(index, macros) in state.macros.slice(0, 8)",
|
||||
title="Click to run macro",
|
||||
@click="run_macro(index)",
|
||||
:disabled="!is_ready",
|
||||
:class="{'has-color': macros.color && macros.color !== '#ffffff' && macros.color !== '#fff'}",
|
||||
:style="macros.color && macros.color !== '#ffffff' && macros.color !== '#fff' ? {borderLeftColor: macros.color} : {}")
|
||||
:class="{'has-color': has_macro_color(macros)}",
|
||||
:style="has_macro_color(macros) ? {borderLeftColor: macros.color} : {}")
|
||||
span.mnum {{index + 1}}
|
||||
span.mname {{macros.name || ('Macro ' + (index + 1))}}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user