Add directional cue icons to load presets
This commit is contained in:
parent
18542445d1
commit
eb14255759
|
|
@ -80,7 +80,7 @@ export function presets(label = 'MPC_DEV') {
|
|||
},
|
||||
transport_load_next: button(
|
||||
'Load next',
|
||||
'LOAD\nNEXT',
|
||||
'↦\nLOAD\nNEXT',
|
||||
'load_next',
|
||||
[{ feedbackId: 'load_next_status', options: {} }],
|
||||
12,
|
||||
|
|
@ -88,7 +88,7 @@ export function presets(label = 'MPC_DEV') {
|
|||
),
|
||||
transport_load_previous: button(
|
||||
'Load previous',
|
||||
'LOAD\nPREV',
|
||||
'↤\nLOAD\nPREV',
|
||||
'load_previous',
|
||||
[{ feedbackId: 'load_previous_status', options: {} }],
|
||||
12,
|
||||
|
|
|
|||
|
|
@ -94,10 +94,12 @@ export function feedbacks(getState, getSync = () => null, getLoadStatus = () =>
|
|||
callback: () => {
|
||||
const status = getLoadStatus(direction)
|
||||
const label = direction === 'next' ? 'NEXT' : 'PREV'
|
||||
const icon = direction === 'next' ? '↦' : '↤'
|
||||
return {
|
||||
text:
|
||||
{ loading: `LOADING\n${label}`, ready: `LOADED\n${label}`, failed: `FAILED\n${label}` }[status] ??
|
||||
`LOAD\n${label}`,
|
||||
`${icon}\n` +
|
||||
({ loading: `LOADING\n${label}`, ready: `LOADED\n${label}`, failed: `FAILED\n${label}` }[status] ??
|
||||
`LOAD\n${label}`),
|
||||
bgcolor: { loading: colors.amber, ready: colors.blue, failed: colors.red }[status] ?? 0x243b50,
|
||||
color: status === 'loading' ? colors.dark : colors.white,
|
||||
}
|
||||
|
|
|
|||
|
|
@ -186,7 +186,7 @@ for (const direction of ['next', 'previous']) {
|
|||
assert.equal(state.statuses.at(-1), InstanceStatus.Ok)
|
||||
assert.equal(
|
||||
state.feedbacks[`load_${direction}_status`].callback().text,
|
||||
direction === 'next' ? 'LOADED\nNEXT' : 'LOADED\nPREV',
|
||||
direction === 'next' ? '↦\nLOADED\nNEXT' : '↤\nLOADED\nPREV',
|
||||
)
|
||||
})
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue