Skip to content

Commit

Permalink
feat: support a color or colour variable from tool change macros (#1244)
Browse files Browse the repository at this point in the history
Co-authored-by: Stefan Dej <[email protected]>
  • Loading branch information
richardjm and meteyou authored Feb 18, 2023
1 parent 6a2a1ba commit e0e90bc
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/components/panels/ExtruderControlPanel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
:key="tool.name"
:class="tool.active ? 'primary--text' : {}"
:disabled="isPrinting"
:style="{ 'background-color': '#' + tool.color }"
dense
class="flex-grow-1 px-0"
@click="doSend(tool.name)">
Expand All @@ -85,7 +86,7 @@
attribute-name="S"></tool-slider>
</v-container>
<!-- PRESSURE ADVANCE SETTINGS -->
<template v-if="!extruderSteppers.length > 0">
<template v-if="!(extruderSteppers.length > 0)">
<v-divider></v-divider>
<pressure-advance-settings></pressure-advance-settings>
</template>
Expand Down
1 change: 1 addition & 0 deletions src/store/printer/getters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1097,6 +1097,7 @@ export const getters: GetterTree<PrinterState, RootState> = {
tools.push({
name: macro.name,
active: macro.variables.active ?? false,
color: macro.variables.color ?? macro.variables.colour ?? null,
})
)

Expand Down
1 change: 1 addition & 0 deletions src/store/printer/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,7 @@ export interface PrinterStateExtruderStepper {
export interface PrinterStateToolchangeMacro {
name: string
active: boolean
color: string
}

export interface PrinterGetterObject {
Expand Down

0 comments on commit e0e90bc

Please sign in to comment.