Add "cycle reading mode" hotkey
This commit is contained in:
@@ -869,6 +869,7 @@
|
|||||||
"offset_spread_pages": "Toggle offset spread pages",
|
"offset_spread_pages": "Toggle offset spread pages",
|
||||||
"previous_chapter": "Previous chapter",
|
"previous_chapter": "Previous chapter",
|
||||||
"previous_page": "Previous page",
|
"previous_page": "Previous page",
|
||||||
|
"reading_mode": "Cycle reading mode",
|
||||||
"scale_type": "Cycle image scale type",
|
"scale_type": "Cycle image scale type",
|
||||||
"scroll_backward": "Scroll backward",
|
"scroll_backward": "Scroll backward",
|
||||||
"scroll_forward": "Scroll forward",
|
"scroll_forward": "Scroll forward",
|
||||||
@@ -1006,13 +1007,13 @@
|
|||||||
"failure": "Could not delete theme \"{{theme}}\"",
|
"failure": "Could not delete theme \"{{theme}}\"",
|
||||||
"success": "Deleted theme \"{{theme}}\""
|
"success": "Deleted theme \"{{theme}}\""
|
||||||
},
|
},
|
||||||
"mode": "Theme mode",
|
|
||||||
"edit": {
|
"edit": {
|
||||||
"action": "Saving theme changes…",
|
"action": "Saving theme changes…",
|
||||||
"failure": "Could not save theme changes",
|
"failure": "Could not save theme changes",
|
||||||
"success": "Saved theme changes",
|
"success": "Saved theme changes",
|
||||||
"title": "Edit theme"
|
"title": "Edit theme"
|
||||||
},
|
},
|
||||||
|
"mode": "Theme mode",
|
||||||
"pure_black_mode": "Pure black dark mode",
|
"pure_black_mode": "Pure black dark mode",
|
||||||
"select": {
|
"select": {
|
||||||
"fonts": {
|
"fonts": {
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ import { getNextRotationValue } from '@/modules/core/utils/ValueRotationButton.u
|
|||||||
import {
|
import {
|
||||||
READER_PAGE_SCALE_MODE_VALUES,
|
READER_PAGE_SCALE_MODE_VALUES,
|
||||||
ReaderScrollAmount,
|
ReaderScrollAmount,
|
||||||
|
READING_MODE_VALUES,
|
||||||
} from '@/modules/reader/constants/ReaderSettings.constants.tsx';
|
} from '@/modules/reader/constants/ReaderSettings.constants.tsx';
|
||||||
import { useReaderStateMangaContext } from '@/modules/reader/contexts/state/ReaderStateMangaContext.tsx';
|
import { useReaderStateMangaContext } from '@/modules/reader/contexts/state/ReaderStateMangaContext.tsx';
|
||||||
import { MangaIdInfo } from '@/modules/manga/Manga.types.ts';
|
import { MangaIdInfo } from '@/modules/manga/Manga.types.ts';
|
||||||
@@ -146,7 +147,7 @@ export const ReaderHotkeys = ({
|
|||||||
true,
|
true,
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
[updateSetting, deleteSetting, pageScaleMode],
|
[updateSetting, deleteSetting, pageScaleMode.value, pageScaleMode.isDefault],
|
||||||
);
|
);
|
||||||
useHotkeys(
|
useHotkeys(
|
||||||
hotkeys[ReaderHotkey.STRETCH_IMAGE],
|
hotkeys[ReaderHotkey.STRETCH_IMAGE],
|
||||||
@@ -158,6 +159,21 @@ export const ReaderHotkeys = ({
|
|||||||
() => updateSetting('shouldOffsetDoubleSpreads', !shouldOffsetDoubleSpreads.value),
|
() => updateSetting('shouldOffsetDoubleSpreads', !shouldOffsetDoubleSpreads.value),
|
||||||
[updateSetting, shouldOffsetDoubleSpreads.value],
|
[updateSetting, shouldOffsetDoubleSpreads.value],
|
||||||
);
|
);
|
||||||
|
useHotkeys(
|
||||||
|
hotkeys[ReaderHotkey.CYCLE_READING_MODE],
|
||||||
|
() => {
|
||||||
|
updateSettingCycleThrough(
|
||||||
|
updateSetting,
|
||||||
|
deleteSetting,
|
||||||
|
'readingMode',
|
||||||
|
readingMode.value,
|
||||||
|
READING_MODE_VALUES,
|
||||||
|
readingMode.isDefault,
|
||||||
|
true,
|
||||||
|
);
|
||||||
|
},
|
||||||
|
[updateSetting, deleteSetting, readingMode.value, readingMode.isDefault],
|
||||||
|
);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
enableScope(HotkeyScope.READER);
|
enableScope(HotkeyScope.READER);
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ const READER_HOTKEY_TO_TITLE: Record<ReaderHotkey, TranslationKey> = {
|
|||||||
[ReaderHotkey.CYCLE_SCALE_TYPE]: 'reader.settings.hotkey.scale_type',
|
[ReaderHotkey.CYCLE_SCALE_TYPE]: 'reader.settings.hotkey.scale_type',
|
||||||
[ReaderHotkey.STRETCH_IMAGE]: 'reader.settings.hotkey.stretch_image',
|
[ReaderHotkey.STRETCH_IMAGE]: 'reader.settings.hotkey.stretch_image',
|
||||||
[ReaderHotkey.OFFSET_SPREAD_PAGES]: 'reader.settings.hotkey.offset_spread_pages',
|
[ReaderHotkey.OFFSET_SPREAD_PAGES]: 'reader.settings.hotkey.offset_spread_pages',
|
||||||
|
[ReaderHotkey.CYCLE_READING_MODE]: 'reader.settings.hotkey.reading_mode',
|
||||||
};
|
};
|
||||||
|
|
||||||
export const ReaderSettingHotkey = ({
|
export const ReaderSettingHotkey = ({
|
||||||
|
|||||||
@@ -119,6 +119,7 @@ export const DEFAULT_READER_SETTINGS: IReaderSettings = {
|
|||||||
[ReaderHotkey.CYCLE_SCALE_TYPE]: ['i'],
|
[ReaderHotkey.CYCLE_SCALE_TYPE]: ['i'],
|
||||||
[ReaderHotkey.STRETCH_IMAGE]: ['f'],
|
[ReaderHotkey.STRETCH_IMAGE]: ['f'],
|
||||||
[ReaderHotkey.OFFSET_SPREAD_PAGES]: ['o'],
|
[ReaderHotkey.OFFSET_SPREAD_PAGES]: ['o'],
|
||||||
|
[ReaderHotkey.CYCLE_READING_MODE]: ['r'],
|
||||||
},
|
},
|
||||||
imagePreLoadAmount: 5,
|
imagePreLoadAmount: 5,
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -204,6 +204,7 @@ export enum ReaderHotkey {
|
|||||||
CYCLE_SCALE_TYPE,
|
CYCLE_SCALE_TYPE,
|
||||||
STRETCH_IMAGE,
|
STRETCH_IMAGE,
|
||||||
OFFSET_SPREAD_PAGES,
|
OFFSET_SPREAD_PAGES,
|
||||||
|
CYCLE_READING_MODE,
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface ReaderPagerProps
|
export interface ReaderPagerProps
|
||||||
|
|||||||
Reference in New Issue
Block a user