fix(layout): fine tuning of column width in scrolled mode and vertical mode, closes #2383 (#2387)

This commit is contained in:
Huang Xin
2025-11-02 16:34:57 +08:00
committed by GitHub
parent d54c752637
commit 4f33c9280b
3 changed files with 7 additions and 9 deletions
@@ -582,19 +582,19 @@ const LayoutPanel: React.FC<SettingsPanelPanelProp> = ({ bookKey, onRegisterRese
label={viewSettings.vertical ? _('Maximum Column Height') : _('Maximum Column Width')}
value={maxInlineSize}
onChange={setMaxInlineSize}
disabled={maxColumnCount === 1 || viewSettings.scrolled}
min={400}
disabled={false}
min={200}
max={9999}
step={100}
step={50}
/>
<NumberInput
label={viewSettings.vertical ? _('Maximum Column Width') : _('Maximum Column Height')}
value={maxBlockSize}
onChange={setMaxBlockSize}
disabled={maxColumnCount === 1 || viewSettings.scrolled}
disabled={false}
min={400}
max={9999}
step={100}
step={50}
/>
</div>
</div>
+1 -3
View File
@@ -1,13 +1,11 @@
import { ViewSettings } from '@/types/book';
export const getMaxInlineSize = (viewSettings: ViewSettings) => {
const isScrolled = viewSettings.scrolled!;
const isVertical = viewSettings.vertical!;
const maxColumnCount = viewSettings.maxColumnCount!;
const screenWidth = window.innerWidth;
const screenHeight = window.innerHeight;
return maxColumnCount === 1 || isScrolled || isVertical
return isVertical && false
? Math.max(screenWidth, screenHeight, 720)
: viewSettings.maxInlineSize!;
};