= ({
transitionStart={transitionStart}
transitionEnd={transitionEnd}
onClose={onClose}
+ upscaleMode={upscaleMode}
>
{(props) => (
{
);
};
-export const SlideFileViewerMenuItems = ({ file }: { file: ClientFile }) => {
+export const SlideFileViewerMenuItems = observer(({ file }: { file: ClientFile }) => {
const { uiStore } = useStore();
const handlePreviewWindow = () => {
@@ -175,9 +175,22 @@ export const SlideFileViewerMenuItems = ({ file }: { file: ClientFile }) => {
text="Open In Preview Window"
icon={IconSet.PREVIEW}
/>
+
+
+
+
+
>
);
-};
+});
export const ExternalAppMenuItems = observer(({ file }: { file: ClientFile }) => {
const { uiStore } = useStore();
diff --git a/src/frontend/containers/Settings/index.tsx b/src/frontend/containers/Settings/index.tsx
index a5a298d3..d8825fc5 100644
--- a/src/frontend/containers/Settings/index.tsx
+++ b/src/frontend/containers/Settings/index.tsx
@@ -86,6 +86,23 @@ const Appearance = observer(() => {
+
+
+
+
+
+
+
Thumbnail
diff --git a/src/frontend/stores/UiStore.ts b/src/frontend/stores/UiStore.ts
index 182e5b56..e9da25ba 100644
--- a/src/frontend/stores/UiStore.ts
+++ b/src/frontend/stores/UiStore.ts
@@ -20,6 +20,7 @@ export const enum ViewMethod {
}
export type ThumbnailSize = 'small' | 'medium' | 'large' | number;
type ThumbnailShape = 'square' | 'letterbox';
+export type UpscaleMode = 'smooth' | 'pixelated';
export const PREFERENCES_STORAGE_KEY = 'preferences';
export interface IHotkeyMap {
@@ -100,6 +101,7 @@ type PersistentPreferenceFields =
| 'method'
| 'thumbnailSize'
| 'thumbnailShape'
+ | 'upscaleMode'
| 'hotkeyMap'
| 'isThumbnailTagOverlayEnabled'
| 'isThumbnailFilenameOverlayEnabled'
@@ -148,6 +150,7 @@ class UiStore {
@observable firstItem: number = 0;
@observable thumbnailSize: ThumbnailSize | number = 'medium';
@observable thumbnailShape: ThumbnailShape = 'square';
+ @observable upscaleMode: UpscaleMode = 'smooth';
@observable isToolbarTagPopoverOpen: boolean = false;
/** Dialog for removing unlinked files from Allusion's database */
@@ -216,6 +219,14 @@ class UiStore {
this.setThumbnailShape('letterbox');
}
+ @action.bound setUpscaleModeSmooth() {
+ this.setUpscaleMode('smooth');
+ }
+
+ @action.bound setUpscaleModePixelated() {
+ this.setUpscaleMode('pixelated');
+ }
+
@action.bound setFirstItem(index: number = 0) {
if (isFinite(index) && index < this.rootStore.fileStore.fileList.length) {
this.firstItem = index;
@@ -812,6 +823,9 @@ class UiStore {
if (prefs.thumbnailShape) {
this.setThumbnailShape(prefs.thumbnailShape);
}
+ if (prefs.upscaleMode) {
+ this.setUpscaleMode(prefs.upscaleMode);
+ }
this.isThumbnailTagOverlayEnabled = Boolean(prefs.isThumbnailTagOverlayEnabled ?? true);
this.isThumbnailFilenameOverlayEnabled = Boolean(prefs.isThumbnailFilenameOverlayEnabled ?? false); // eslint-disable-line prettier/prettier
this.isThumbnailResolutionOverlayEnabled = Boolean(prefs.isThumbnailResolutionOverlayEnabled ?? false); // eslint-disable-line prettier/prettier
@@ -866,6 +880,7 @@ class UiStore {
method: this.method,
thumbnailSize: this.thumbnailSize,
thumbnailShape: this.thumbnailShape,
+ upscaleMode: this.upscaleMode,
hotkeyMap: { ...this.hotkeyMap },
isThumbnailFilenameOverlayEnabled: this.isThumbnailFilenameOverlayEnabled,
isThumbnailTagOverlayEnabled: this.isThumbnailTagOverlayEnabled,
@@ -928,6 +943,10 @@ class UiStore {
@action private setThumbnailShape(shape: ThumbnailShape) {
this.thumbnailShape = shape;
}
+
+ @action private setUpscaleMode(mode: UpscaleMode) {
+ this.upscaleMode = mode;
+ }
}
export default UiStore;