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: more tolerant with thumbnails sizes #1674

Merged
merged 2 commits into from
Dec 8, 2023
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
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
Loading