Skip to content

Commit

Permalink
fix: more tolerant with thumbnails sizes (#1674)
Browse files Browse the repository at this point in the history
  • Loading branch information
meteyou authored Dec 8, 2023
1 parent eab9060 commit fdf3a93
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
18 changes: 12 additions & 6 deletions src/components/dialogs/StartPrintDialog.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
<template>
<v-dialog v-model="bool" :max-width="dialogWidth" @click:outside="closeDialog" @keydown.esc="closeDialog">
<v-dialog v-model="bool" :max-width="400" @click:outside="closeDialog" @keydown.esc="closeDialog">
<v-card>
<v-img v-if="file.big_thumbnail" contain :src="file.big_thumbnail" :style="bigThumbnailStyle" />
<div v-if="file.big_thumbnail" class="d-flex align-center justify-center" style="min-height: 200px">
<v-img
:src="file.big_thumbnail"
:max-width="maxThumbnailWidth"
class="d-inline-block"
:style="bigThumbnailStyle" />
</div>
<v-card-title class="text-h5">{{ $t('Dialogs.StartPrint.Headline') }}</v-card-title>
<v-card-text class="pb-0">
<p class="body-2">
Expand Down Expand Up @@ -71,10 +77,6 @@ export default class StartPrintDialog extends Mixins(BaseMixin) {
)
}
get dialogWidth() {
return this.file.big_thumbnail_width ?? 400
}
get bigThumbnailBackground() {
return this.$store.state.gui.uiSettings.bigThumbnailBackground ?? defaultBigThumbnailBackground
}
Expand Down Expand Up @@ -112,6 +114,10 @@ export default class StartPrintDialog extends Mixins(BaseMixin) {
return this.$t('Dialogs.StartPrint.DoYouWantToStartFilename', { filename: this.file?.filename ?? 'unknown' })
}
get maxThumbnailWidth() {
return this.file?.big_thumbnail_width ?? 400
}
startPrint(filename = '') {
filename = (this.currentPath + '/' + filename).substring(1)
this.closeDialog()
Expand Down
4 changes: 2 additions & 2 deletions src/store/variables.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,9 @@ export const allDashboardPanels = [
'webcam',
]

export const thumbnailSmallMin = 32
export const thumbnailSmallMin = 30
export const thumbnailSmallMax = 64
export const thumbnailBigMin = 256
export const thumbnailBigMin = 128

export const navigationWidth = 220
export const navigationItemHeight = 48
Expand Down

0 comments on commit fdf3a93

Please sign in to comment.