Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: only display section options which exists in ExtruderPanel #1694

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/components/mixins/extruder.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
import Vue from 'vue'
import { Component } from 'vue-property-decorator'
import { PrinterStateExtruder } from '@/store/printer/types'
@Component
export default class ExtruderMixin extends Vue {
get extruders(): PrinterStateExtruder[] {
return this.$store.getters['printer/getExtruders']
}

get activeExtruder(): string {
return this.$store.state.printer.toolhead?.extruder
}
Expand Down
7 changes: 4 additions & 3 deletions src/components/panels/Extruder/ExtruderPanelSettings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
</v-btn>
</template>
<v-list>
<v-list-item class="minHeight36">
<v-list-item v-if="toolchangeMacros.length" class="minHeight36">
<v-checkbox
v-model="showTools"
class="mt-0"
Expand All @@ -27,7 +27,7 @@
hide-details
:label="$t('Panels.ExtruderControlPanel.PressureAdvance')" />
</v-list-item>
<v-list-item class="minHeight36">
<v-list-item v-if="existsFirmwareRetraction" class="minHeight36">
<v-checkbox
v-model="showFirmwareRetraction"
class="mt-0"
Expand All @@ -50,8 +50,9 @@ import Component from 'vue-class-component'
import { Mixins } from 'vue-property-decorator'
import BaseMixin from '@/components/mixins/base'
import { mdiCog } from '@mdi/js'
import ControlMixin from '@/components/mixins/control'
@Component
export default class ExtruderPanelSettings extends Mixins(BaseMixin) {
export default class ExtruderPanelSettings extends Mixins(BaseMixin, ControlMixin) {
mdiCog = mdiCog

get showTools(): boolean {
Expand Down
8 changes: 2 additions & 6 deletions src/components/panels/ExtruderControlPanel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
<extruder-panel-settings />
</template>
<!-- TOOL SELECTOR BUTTONS -->
<extruder-control-panel-tools v-if="showTools" />
<extruder-control-panel-tools v-if="showTools && toolchangeMacros.length" />
<!-- EXTRUSION FACTOR SLIDER -->
<template v-if="showExtrusionFactor">
<v-divider v-if="showTools" />
Expand All @@ -108,7 +108,7 @@
<script lang="ts">
import { mdiPrinter3dNozzle, mdiDotsVertical } from '@mdi/js'
import { Component, Mixins } from 'vue-property-decorator'
import { PrinterStateExtruder, PrinterStateMacro } from '@/store/printer/types'
import { PrinterStateMacro } from '@/store/printer/types'
import BaseMixin from '@/components/mixins/base'
import ControlMixin from '@/components/mixins/control'
import Panel from '@/components/ui/Panel.vue'
Expand Down Expand Up @@ -183,10 +183,6 @@ export default class ExtruderControlPanel extends Mixins(BaseMixin, ControlMixin
return this.loadFilamentMacro !== undefined || this.unloadFilamentMacro !== undefined
}
get extruders(): PrinterStateExtruder[] {
return this.$store.getters['printer/getExtruders']
}
get showTools(): boolean {
if (this.toolchangeMacros.length < 1) return false
Expand Down
Loading