Skip to content

Commit

Permalink
feat: show print progress when status panel is collapsed
Browse files Browse the repository at this point in the history
Signed-off-by: Mathis Mensing <[email protected]>
  • Loading branch information
matmen committed Jun 2, 2024
1 parent 9ae83b6 commit 6c7d2fb
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/components/common/CollapsableCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,12 @@
</v-row>
</v-card-title>

<v-expand-transition>
<div v-show="isCollapsed && !inLayout">
<slot name="collapsed-content" />
</div>
</v-expand-transition>

<v-expand-transition v-if="!lazy">
<div
v-if="!isCollapsed && !inLayout"
Expand Down
13 changes: 13 additions & 0 deletions src/components/widgets/status/PrinterStatusCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,14 @@
/>
</template>

<template #collapsed-content>
<v-progress-linear
:height="6"
:value="estimates.progress"
color="primary"
/>
</template>

<v-tabs-items
v-model="tab"
touchless
Expand Down Expand Up @@ -66,6 +74,7 @@ import StateMixin from '@/mixins/state'
import StatusControls from './StatusControls.vue'
import StatusTab from './StatusTab.vue'
import ReprintTab from './ReprintTab.vue'
import type { TimeEstimates } from '@/store/printer/types'
@Component({
components: {
Expand Down Expand Up @@ -96,6 +105,10 @@ export default class PrinterStatusCard extends Mixins(StateMixin) {
return this.$store.state.printer.printer.print_stats.filename
}
get estimates (): TimeEstimates {
return this.$store.getters['printer/getTimeEstimates'] as TimeEstimates
}
@Watch('filename')
onPrinterPrinting (val: string) {
this.init(val)
Expand Down

0 comments on commit 6c7d2fb

Please sign in to comment.