import { Component, Mixins, Watch } from 'vue-property-decorator'
import BaseMixin from '@/components/mixins/base'
-import { validGcodeExtensions } from '@/store/variables'
+import { defaultBigThumbnailBackground, validGcodeExtensions } from '@/store/variables'
import { formatFilesize, formatPrintTime, sortFiles } from '@/plugins/helpers'
import { FileStateFile, FileStateGcodefile } from '@/store/files/types'
import Panel from '@/components/ui/Panel.vue'
@@ -1101,6 +1102,18 @@ export default class GcodefilesPanel extends Mixins(BaseMixin, ControlMixin) {
this.$store.dispatch('gui/saveSetting', { name: 'view.gcodefiles.countPerPage', value: newVal })
}
+ get bigThumbnailBackground() {
+ return this.$store.state.gui.uiSettings.bigThumbnailBackground ?? defaultBigThumbnailBackground
+ }
+
+ get bigThumbnailTooltipColor() {
+ if (defaultBigThumbnailBackground.toLowerCase() === this.bigThumbnailBackground.toLowerCase()) {
+ return undefined
+ }
+
+ return this.bigThumbnailBackground
+ }
+
getStatusIcon(status: string | null) {
return this.$store.getters['server/history/getPrintStatusIcon'](status)
}
diff --git a/src/components/panels/Status/Gcodefiles.vue b/src/components/panels/Status/Gcodefiles.vue
index 4b5064f7d..b65a32e48 100644
--- a/src/components/panels/Status/Gcodefiles.vue
+++ b/src/components/panels/Status/Gcodefiles.vue
@@ -20,7 +20,11 @@
@click="showDialog(item)">
-
+
+ @closeDialog="closeDialog" />
@@ -241,6 +245,7 @@ import {
mdiCloseThick,
} from '@mdi/js'
import Panel from '@/components/ui/Panel.vue'
+import { defaultBigThumbnailBackground } from '@/store/variables'
interface dialogRenameObject {
show: boolean
@@ -356,6 +361,18 @@ export default class StatusPanelGcodefiles extends Mixins(BaseMixin, ControlMixi
return `width: ${this.contentTdWidth}px;`
}
+ get bigThumbnailBackground() {
+ return this.$store.state.gui.uiSettings.bigThumbnailBackground ?? defaultBigThumbnailBackground
+ }
+
+ get bigThumbnailTooltipColor() {
+ if (defaultBigThumbnailBackground.toLowerCase() === this.bigThumbnailBackground.toLowerCase()) {
+ return undefined
+ }
+
+ return this.bigThumbnailBackground
+ }
+
showContextMenu(e: any, item: FileStateGcodefile) {
if (!this.contextMenu.shown) {
e?.preventDefault()
diff --git a/src/components/panels/Status/JobqueueEntry.vue b/src/components/panels/Status/JobqueueEntry.vue
index 4ba7e0ac8..bc3b9d898 100644
--- a/src/components/panels/Status/JobqueueEntry.vue
+++ b/src/components/panels/Status/JobqueueEntry.vue
@@ -5,7 +5,11 @@
@contextmenu="showContextMenu($event, item)">
-
+
@@ -116,6 +120,7 @@ import BaseMixin from '@/components/mixins/base'
import { ServerJobQueueStateJob } from '@/store/server/jobQueue/types'
import { mdiChevronDown, mdiChevronUp, mdiCloseThick, mdiCounter, mdiFile, mdiPlay, mdiPlaylistRemove } from '@mdi/js'
import NumberInput from '@/components/inputs/NumberInput.vue'
+import { defaultBigThumbnailBackground } from '@/store/variables'
@Component({
components: { NumberInput },
})
@@ -192,6 +197,18 @@ export default class StatusPanelJobqueueEntry extends Mixins(BaseMixin) {
return output
}
+ get bigThumbnailBackground() {
+ return this.$store.state.gui.uiSettings.bigThumbnailBackground ?? defaultBigThumbnailBackground
+ }
+
+ get bigThumbnailTooltipColor() {
+ if (defaultBigThumbnailBackground.toLowerCase() === this.bigThumbnailBackground.toLowerCase()) {
+ return undefined
+ }
+
+ return this.bigThumbnailBackground
+ }
+
formatPrintTime(totalSeconds: number) {
if (totalSeconds) {
let output = ''
diff --git a/src/components/panels/Status/PrintstatusThumbnail.vue b/src/components/panels/Status/PrintstatusThumbnail.vue
index 28a82992e..95b31eebc 100644
--- a/src/components/panels/Status/PrintstatusThumbnail.vue
+++ b/src/components/panels/Status/PrintstatusThumbnail.vue
@@ -7,6 +7,7 @@
tabindex="-1"
class="d-flex align-end statusPanel-big-thumbnail"
height="200"
+ :style="thumbnailStyle"
@focus="focusBigThumbnail"
@blur="blurBigThumbnail">
-
- {{ mdiFile }}
+
+
+
+
+ {{ mdiFile }}
+
-
+
-
-
- {{ mdiFile }}
+
+
+
+
+
+ {{ mdiFile }}
+
@@ -77,13 +86,11 @@
import Component from 'vue-class-component'
import { Mixins } from 'vue-property-decorator'
import BaseMixin from '@/components/mixins/base'
-import { thumbnailBigMin, thumbnailSmallMax, thumbnailSmallMin } from '@/store/variables'
+import { defaultBigThumbnailBackground, thumbnailBigMin, thumbnailSmallMax, thumbnailSmallMin } from '@/store/variables'
import { mdiFileOutline, mdiFile } from '@mdi/js'
import { Debounce } from 'vue-debounce-decorator'
-@Component({
- components: {},
-})
+@Component({})
export default class StatusPanelPrintstatusThumbnail extends Mixins(BaseMixin) {
mdiFileOutline = mdiFileOutline
mdiFile = mdiFile
@@ -178,6 +185,18 @@ export default class StatusPanelPrintstatusThumbnail extends Mixins(BaseMixin) {
return this.current_filename && setting && this.thumbnailBig
}
+ get bigThumbnailBackground() {
+ return this.$store.state.gui.uiSettings.bigThumbnailBackground ?? defaultBigThumbnailBackground
+ }
+
+ get thumbnailStyle() {
+ if (defaultBigThumbnailBackground.toLowerCase() !== this.bigThumbnailBackground.toLowerCase()) {
+ return { backgroundColor: this.bigThumbnailBackground }
+ }
+
+ return {}
+ }
+
focusBigThumbnail() {
if (this.$refs.bigThumbnail) {
const clientWidth = this.$refs.bigThumbnail.$el.clientWidth
diff --git a/src/components/settings/SettingsUiSettingsTab.vue b/src/components/settings/SettingsUiSettingsTab.vue
index bfd44fc0e..f8339aca3 100644
--- a/src/components/settings/SettingsUiSettingsTab.vue
+++ b/src/components/settings/SettingsUiSettingsTab.vue
@@ -65,6 +65,32 @@
+
+
+ {{ mdiRestart }}
+
+
+
+
+
+
+
+
+
@@ -224,7 +250,7 @@ import Component from 'vue-class-component'
import { Mixins } from 'vue-property-decorator'
import BaseMixin from '@/components/mixins/base'
import SettingsRow from '@/components/settings/SettingsRow.vue'
-import { defaultLogoColor, defaultPrimaryColor } from '@/store/variables'
+import { defaultLogoColor, defaultPrimaryColor, defaultBigThumbnailBackground } from '@/store/variables'
import { Debounce } from 'vue-debounce-decorator'
import { mdiRestart, mdiTimerOutline } from '@mdi/js'
import { ServerPowerStateDevice } from '@/store/server/power/types'
@@ -238,6 +264,7 @@ export default class SettingsUiSettingsTab extends Mixins(BaseMixin) {
defaultLogoColor = defaultLogoColor
defaultPrimaryColor = defaultPrimaryColor
+ defaultBigThumbnailBackground = defaultBigThumbnailBackground
get logoColor() {
return this.$store.state.gui.uiSettings.logo
@@ -263,6 +290,14 @@ export default class SettingsUiSettingsTab extends Mixins(BaseMixin) {
this.$store.dispatch('gui/saveSetting', { name: 'uiSettings.boolBigThumbnail', value: newVal })
}
+ get bigThumbnailBackground() {
+ return this.$store.state.gui.uiSettings.bigThumbnailBackground
+ }
+
+ set bigThumbnailBackground(newVal) {
+ this.$store.dispatch('gui/saveSetting', { name: 'uiSettings.bigThumbnailBackground', value: newVal })
+ }
+
get displayCancelPrint() {
return this.$store.state.gui.uiSettings.displayCancelPrint
}
@@ -468,5 +503,10 @@ export default class SettingsUiSettingsTab extends Mixins(BaseMixin) {
updatePrimaryColor(newVal: any) {
this.primaryColor = this.clearColorObject(newVal)
}
+
+ @Debounce(500)
+ updateBigThumbnailBackground(newVal: any) {
+ this.bigThumbnailBackground = this.clearColorObject(newVal)
+ }
}
diff --git a/src/locales/en.json b/src/locales/en.json
index dbdc977b2..592eaf1a8 100644
--- a/src/locales/en.json
+++ b/src/locales/en.json
@@ -1093,6 +1093,7 @@
"UiSettingsTab": {
"BedScrewsDialog": "Bed Screws Dialog",
"BedScrewsDialogDescription": "Display helper dialog for BED_SCREWS_ADJUST.",
+ "BigThumbnailBackground": "Large thumbnail background color",
"BoolBigThumbnail": "Large thumbnail",
"BoolBigThumbnailDescription": "Display a large thumbnail in the status panel during a print.",
"BoolHideUploadAndPrintButton": "Hide Upload and Print Button",
diff --git a/src/store/gui/index.ts b/src/store/gui/index.ts
index 186b6bfce..47512562c 100644
--- a/src/store/gui/index.ts
+++ b/src/store/gui/index.ts
@@ -3,7 +3,7 @@ import { Module } from 'vuex'
import { actions } from '@/store/gui/actions'
import { mutations } from '@/store/gui/mutations'
import { getters } from '@/store/gui/getters'
-import { defaultLogoColor, defaultPrimaryColor } from '@/store/variables'
+import { defaultLogoColor, defaultPrimaryColor, defaultBigThumbnailBackground } from '@/store/variables'
// load modules
import { console } from '@/store/gui/console'
@@ -155,6 +155,7 @@ export const getDefaultState = (): GuiState => {
confirmOnEmergencyStop: false,
confirmOnPowerDeviceChange: false,
boolBigThumbnail: true,
+ bigThumbnailBackground: defaultBigThumbnailBackground,
boolWideNavDrawer: false,
boolHideUploadAndPrintButton: false,
navigationStyle: 'iconsAndText',
diff --git a/src/store/gui/types.ts b/src/store/gui/types.ts
index 5cc904fb7..7ad7e9124 100644
--- a/src/store/gui/types.ts
+++ b/src/store/gui/types.ts
@@ -105,6 +105,7 @@ export interface GuiState {
confirmOnEmergencyStop: boolean
confirmOnPowerDeviceChange: boolean
boolBigThumbnail: boolean
+ bigThumbnailBackground: string
boolWideNavDrawer: boolean
boolHideUploadAndPrintButton: boolean
navigationStyle: 'iconsAndText' | 'iconsOnly'
diff --git a/src/store/variables.ts b/src/store/variables.ts
index f887d5c15..5673c35ce 100644
--- a/src/store/variables.ts
+++ b/src/store/variables.ts
@@ -1,5 +1,6 @@
export const defaultLogoColor = '#D41216'
export const defaultPrimaryColor = '#2196f3'
+export const defaultBigThumbnailBackground = '#1e1e1e'
export const minKlipperVersion = 'v0.11.0-257'
export const minMoonrakerVersion = 'v0.8.0-137'
| |