From e7de64e07bf60ef583bbb07ba800704638ded401 Mon Sep 17 00:00:00 2001 From: yami Date: Fri, 10 Dec 2021 22:16:12 +0530 Subject: [PATCH] prevent reload when typing, option to select variable width --- package.json | 2 +- src/App.tsx | 1 + src/Components/LocationsTab.tsx | 1 + src/Components/Reader.tsx | 2 +- src/Components/ReaderSideList.tsx | 1 + src/Components/Settings.tsx | 15 +++++++++++++++ src/Components/TopBar.tsx | 1 + src/MainImports.ts | 1 + src/styles/index.scss | 20 ++++++++++++++------ 9 files changed, 36 insertions(+), 8 deletions(-) diff --git a/package.json b/package.json index 513163c..eb767b8 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "mangareader", "productName": "Manga Reader", - "version": "2.1.8", + "version": "2.1.9", "description": "App to read manga on desktop", "main": "./.webpack/main/index.js", "author": { diff --git a/src/App.tsx b/src/App.tsx index 613a9c6..542a05c 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -22,6 +22,7 @@ if (!window.fs.existsSync(settingsPath)) { historyLimit: 60, locationListSortType: "normal", readerWidth: 60, + variableImageSize:true, }; window.fs.writeFileSync(settingsPath, JSON.stringify(settingsData)); } diff --git a/src/Components/LocationsTab.tsx b/src/Components/LocationsTab.tsx index 59466d7..d3caa43 100644 --- a/src/Components/LocationsTab.tsx +++ b/src/Components/LocationsTab.tsx @@ -110,6 +110,7 @@ const LocationsTab = forwardRef( title="Type to Search" data-tooltip="Type to Search" tabIndex={-1} + onKeyDown={(e)=>e.stopPropagation()} onChange={(e) => { const val = e.target.value; let filter = ""; diff --git a/src/Components/Reader.tsx b/src/Components/Reader.tsx index 82064f6..93ea296 100644 --- a/src/Components/Reader.tsx +++ b/src/Components/Reader.tsx @@ -417,7 +417,7 @@ const Reader = () => { }} onLoad={(ev) => { setImagesLoaded((init) => init + 1); - if (ev.currentTarget.offsetHeight / ev.currentTarget.offsetWidth <= 1.2) { + if (appSettings.variableImageSize && ev.currentTarget.offsetHeight / ev.currentTarget.offsetWidth <= 1.2) { setWideImages((init) => [...init, e]); } }} diff --git a/src/Components/ReaderSideList.tsx b/src/Components/ReaderSideList.tsx index 09de965..a6eb268 100644 --- a/src/Components/ReaderSideList.tsx +++ b/src/Components/ReaderSideList.tsx @@ -164,6 +164,7 @@ const ReaderSideList = () => { setfilter(filter); }} onKeyDown={(e) => { + e.stopPropagation() if (e.key === "Escape") { e.currentTarget.blur(); } diff --git a/src/Components/Settings.tsx b/src/Components/Settings.tsx index b025329..a257995 100644 --- a/src/Components/Settings.tsx +++ b/src/Components/Settings.tsx @@ -68,6 +68,7 @@ const Settings = ({ promptSetDefaultLocation }: { promptSetDefaultLocation: () = defaultValue={appSettings.historyLimit} ref={historyInputRef} onKeyDown={(e) => { + e.stopPropagation(); if (e.key === "Enter") { historyBtnRef.current?.click(); } @@ -230,6 +231,20 @@ const Settings = ({ promptSetDefaultLocation }: { promptSetDefaultLocation: () = {window.electron.app.getVersion()} +
+
Other settings
+
+ +
+
Issues? :
diff --git a/src/Components/TopBar.tsx b/src/Components/TopBar.tsx index 7f5f6a4..9d089b8 100644 --- a/src/Components/TopBar.tsx +++ b/src/Components/TopBar.tsx @@ -112,6 +112,7 @@ const TopBar = forwardRef((props, forwaredRef: React.ForwardedRef { + e.stopPropagation(); if ( !( /[0-9]/gi.test(e.key) || diff --git a/src/MainImports.ts b/src/MainImports.ts index 0e282a0..d270dd8 100644 --- a/src/MainImports.ts +++ b/src/MainImports.ts @@ -35,6 +35,7 @@ declare global { historyLimit: number; locationListSortType: "normal" | "inverse"; readerWidth: number; + variableImageSize:boolean; } interface ListItem { mangaName: string; diff --git a/src/styles/index.scss b/src/styles/index.scss index c995e92..6d5d1f5 100644 --- a/src/styles/index.scss +++ b/src/styles/index.scss @@ -283,7 +283,8 @@ body { cursor: pointer; } } - input { + input[type="text"], + input[type="number"] { background: var(--input-bg); overflow: scroll; cursor: text; @@ -592,6 +593,15 @@ body { height: 100%; border-radius: 3px; } + label { + display: flex; + cursor: pointer; + background-color: var(--input-bg); + padding: 5px; + gap: 5px; + border-radius: 3px; + + } p { font-size: 12px; width: 100%; @@ -605,11 +615,9 @@ body { .enabled { background-color: #f003; } - } - } - .themeSelector { - .selected { - background-color: var(--btn-color2); + .selected { + background-color: var(--btn-color2); + } } } }