Skip to content

Commit

Permalink
fix: buttons no longer flicker during file actions
Browse files Browse the repository at this point in the history
Signed-off-by: Craig Bassett <[email protected]>
  • Loading branch information
cadriel committed Apr 12, 2021
1 parent add9272 commit 5e395ad
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 31 deletions.
2 changes: 1 addition & 1 deletion src/components/ui/AppBtnToolheadMove.vue
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export default class AppBtnToolheadMove extends Vue {
@Prop()
disabled!: boolean
@Prop({ type: String, default: 'secondary' })
@Prop({ type: String, default: 'btncolor' })
color!: string
@Prop({ type: Boolean, default: false })
Expand Down
22 changes: 11 additions & 11 deletions src/components/widgets/bedmesh/BedMeshControls.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@
<td class="grey--text focus--text"><span v-if="item.active && mesh.variance">{{ mesh.variance.toFixed(4) }}</span></td>
<td class="text-right">
<v-tooltip
v-if="!item.active && !hasWaits && !printerPrinting && !printerBusy"
v-if="!item.active && !printerPrinting && !printerBusy"
bottom
>
<template v-slot:activator="{ on, attrs }">
<app-btn
@click="loadProfile(item.profile_name)"
v-if="!item.active && !hasWaits && !printerPrinting && !printerBusy"
v-if="!item.active && !printerPrinting && !printerBusy"
v-bind="attrs"
v-on="on"
x-small
Expand All @@ -53,7 +53,7 @@
<template v-slot:activator="{ on, attrs }">
<app-btn
@click="removeProfile(item.profile_name)"
:disabled="hasWaits || printerPrinting || printerBusy"
:disabled="printerPrinting || printerBusy"
v-bind="attrs"
v-on="on"
color=""
Expand Down Expand Up @@ -96,7 +96,7 @@
block
class="mb-2"
:loading="hasWait(waits.onMeshCalibrate)"
:disabled="hasWaits || printerPrinting || printerBusy"
:disabled="printerPrinting || printerBusy"
@click="calibrate()">
{{ $t('app.general.btn.calibrate') }}
</app-btn>
Expand All @@ -112,7 +112,7 @@
block
small
color="primary"
:disabled="!meshLoaded || hasWaits || printerPrinting || printerBusy"
:disabled="!meshLoaded || printerPrinting || printerBusy"
@click="handleOpenSaveDialog()">
{{ $t('app.general.btn.save_as') }}
</app-btn>
Expand All @@ -128,7 +128,7 @@
small
class="mb-2"
:loading="hasWait(waits.onHomeAll)"
:disabled="hasWaits || printerPrinting || printerBusy"
:disabled="printerPrinting || printerBusy"
:color="(!allHomed) ? 'primary' : undefined">
<v-icon small class="mr-1">$home</v-icon> {{ $t('app.general.btn.all') }}
</app-btn>
Expand All @@ -138,7 +138,7 @@
@click="sendGcode('QUAD_GANTRY_LEVEL', waits.onQGL)"
:elevation="2"
:loading="hasWait(waits.onQGL)"
:disabled="hasWaits || printerPrinting || printerBusy"
:disabled="printerPrinting || printerBusy"
block
class="mb-2"
small>
Expand All @@ -151,7 +151,7 @@
<v-row>
<v-col>
<v-radio-group
:disabled="!meshLoaded || hasWaits || printerPrinting || printerBusy"
:disabled="!meshLoaded || printerPrinting || printerBusy"
v-model="matrix"
column
hide-details
Expand All @@ -171,7 +171,7 @@
</v-col>
<v-col>
<v-checkbox
:disabled="!meshLoaded || hasWaits || printerPrinting || printerBusy"
:disabled="!meshLoaded || printerPrinting || printerBusy"
:label="$t('app.bedmesh.label.wireframe')"
v-model="wireframe"
hide-details
Expand All @@ -180,7 +180,7 @@
</v-checkbox>

<v-checkbox
:disabled="!meshLoaded || hasWaits || printerPrinting || printerBusy"
:disabled="!meshLoaded || printerPrinting || printerBusy"
:label="$t('app.bedmesh.label.scale')"
v-model="scale"
hide-details
Expand All @@ -189,7 +189,7 @@
</v-checkbox>

<v-checkbox
:disabled="!meshLoaded || hasWaits || printerPrinting || printerBusy"
:disabled="!meshLoaded || printerPrinting || printerBusy"
:label="$t('app.bedmesh.label.flat_surface')"
v-model="flatSurface"
hide-details
Expand Down
4 changes: 2 additions & 2 deletions src/components/widgets/toolhead/ExtruderMoves.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<v-col cols="6">
<app-btn
@click="sendRetractGcode(extrudeLength, extrudeSpeed, waits.onExtract)"
:disabled="hasWaits || !extrudeRetractReady || !klippyReady || !valid"
:disabled="!extrudeRetractReady || !klippyReady || !valid"
:elevation="2"
block
class="mr-2">
Expand All @@ -44,7 +44,7 @@
<v-col cols="6">
<app-btn
@click="sendExtrudeGcode(extrudeLength, extrudeSpeed, waits.onExtrude)"
:disabled="hasWaits || !extrudeRetractReady || !klippyReady || !valid"
:disabled="!extrudeRetractReady || !klippyReady || !valid"
:elevation="2"
block
class="mr-2">
Expand Down
10 changes: 5 additions & 5 deletions src/components/widgets/toolhead/ToolheadCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<app-btn
@click="sendGcode('M84')"
:elevation="2"
:disabled="hasWaits || !klippyReady || printerPrinting"
:disabled="!klippyReady || printerPrinting"
small
class="ma-1">
MOTORS OFF
Expand All @@ -39,7 +39,7 @@
@click="sendGcode('BED_SCREWS_ADJUST', waits.onBedScrewsAdjust)"
:elevation="2"
:loading="hasWait(waits.onBedScrewsAdjust)"
:disabled="hasWaits || !klippyReady || printerPrinting"
:disabled="!klippyReady || printerPrinting"
small
class="ma-1">
Bed_Screws_Adjust
Expand All @@ -49,7 +49,7 @@
@click="sendGcode('SCREWS_TILT_CALCULATE', waits.onBedScrewsCalculate)"
:elevation="2"
:loading="hasWait(waits.onBedScrewsCalculate)"
:disabled="!allHomed || hasWaits || !klippyReady || printerPrinting"
:disabled="!allHomed || !klippyReady || printerPrinting"
small
class="ma-1">
Screws_Tilt_Calculate
Expand All @@ -59,7 +59,7 @@
@click="sendGcode('Z_TILT_ADJUST', waits.onZTilt)"
:elevation="2"
:loading="hasWait(waits.onZTilt)"
:disabled="hasWaits || !klippyReady || printerPrinting"
:disabled="!klippyReady || printerPrinting"
small
class="ma-1">
Z_Tilt_Adjust
Expand All @@ -69,7 +69,7 @@
@click="sendGcode('QUAD_GANTRY_LEVEL', waits.onQGL)"
:elevation="2"
:loading="hasWait(waits.onQGL)"
:disabled="hasWaits || !klippyReady || printerPrinting"
:disabled="!klippyReady || printerPrinting"
small
class="ma-1">
QGL
Expand Down
22 changes: 11 additions & 11 deletions src/components/widgets/toolhead/ToolheadMoves.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,22 @@
<v-col cols="auto" class="ml-12 mr-12">
<app-btn-toolhead-move
@click="sendMoveGcode('Y', toolheadMoveLength)"
:disabled="hasWaits || !xyHomed || !klippyReady"
:disabled="!xyHomed || !klippyReady"
icon="$up">
</app-btn-toolhead-move>
</v-col>
<v-col cols="auto" class="ml-2">
<app-btn-toolhead-move
@click="sendMoveGcode('Z', toolheadMoveLength)"
:disabled="hasWaits || !zHomed || !klippyReady"
:disabled="!zHomed || !klippyReady"
icon="$up">
</app-btn-toolhead-move>
</v-col>
<v-col class="ml-2" v-if="canHomeXY">
<app-btn-toolhead-move
:color="(!allHomed) ? 'primary' : undefined"
:loading="hasWait(waits.onHomeAll)"
:disabled="!klippyReady || printerPrinting || hasWaits"
:disabled="!klippyReady || printerPrinting"
@click="sendGcode('G28', waits.onHomeAll)"
icon="$home"
small-icon>
Expand All @@ -31,15 +31,15 @@
<v-col cols="auto">
<app-btn-toolhead-move
@click="sendMoveGcode('X', toolheadMoveLength, true)"
:disabled="hasWaits || !xyHomed || !klippyReady"
:disabled="!xyHomed || !klippyReady"
icon="$left">
</app-btn-toolhead-move>
</v-col>
<v-col cols="auto" class="ml-2">
<app-btn-toolhead-move
:color="(!xyHomed) ? 'primary' : undefined"
:loading="hasWait(waits.onHomeXY)"
:disabled="!klippyReady || printerPrinting || hasWaits"
:disabled="!klippyReady || printerPrinting"
@click="sendGcode('G28 X Y', waits.onHomeXY)"
:tooltip="$t('app.tool.tooltip.home_xy')"
icon="$home">
Expand All @@ -48,15 +48,15 @@
<v-col cols="auto" class="ml-2">
<app-btn-toolhead-move
@click="sendMoveGcode('X', toolheadMoveLength)"
:disabled="hasWaits || !xyHomed || !klippyReady"
:disabled="!xyHomed || !klippyReady"
icon="$right">
</app-btn-toolhead-move>
</v-col>
<v-col cols="auto" class="ml-2" v-if="canHomeXY">
<app-btn-toolhead-move
:color="(!zHomed) ? 'primary' : undefined"
:loading="hasWait(waits.onHomeZ)"
:disabled="!klippyReady || printerPrinting || hasWaits"
:disabled="!klippyReady || printerPrinting"
@click="sendGcode('G28 Z', waits.onHomeZ)"
:tooltip="$t('app.tool.tooltip.home_z')"
icon="$home">
Expand All @@ -66,7 +66,7 @@
<app-btn-toolhead-move
:color="(!xHomed) ? 'primary' : undefined"
:loading="hasWait(waits.onHomeX)"
:disabled="!klippyReady || printerPrinting || hasWaits"
:disabled="!klippyReady || printerPrinting"
@click="sendGcode('G28 X', waits.onHomeX)"
icon="$home"
small-icon>
Expand All @@ -78,22 +78,22 @@
<v-col cols="auto" class="ml-12 mr-7">
<app-btn-toolhead-move
@click="sendMoveGcode('Y', toolheadMoveLength, true)"
:disabled="hasWaits || !xyHomed || !klippyReady"
:disabled="!xyHomed || !klippyReady"
icon="$down">
</app-btn-toolhead-move>
</v-col>
<v-col cols="auto" class="ml-7">
<app-btn-toolhead-move
@click="sendMoveGcode('Z', toolheadMoveLength, true)"
:disabled="hasWaits || !zHomed || !klippyReady"
:disabled="!zHomed || !klippyReady"
icon="$down">
</app-btn-toolhead-move>
</v-col>
<v-col class="ml-2" v-if="canHomeXY">
<app-btn-toolhead-move
:color="(!yHomed) ? 'primary' : undefined"
:loading="hasWait(waits.onHomeY)"
:disabled="!klippyReady || printerPrinting || hasWaits"
:disabled="!klippyReady || printerPrinting"
@click="sendGcode('G28 Y', waits.onHomeY)"
icon="$home"
small-icon>
Expand Down
2 changes: 1 addition & 1 deletion todo.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

## Next Up

- cancel uploads
- sync instances across moonraker db
- use components instead of plugins with moonraker
- add cpu time / resource monitor
Expand All @@ -17,6 +16,7 @@
- warn on cputime too high
- warn on systeim too high
- allow a way to configure if a warning is persistent or not
- cancel uploads

### Features

Expand Down

0 comments on commit 5e395ad

Please sign in to comment.