fix: change default column to auto

This commit is contained in:
GyDi 2022-12-14 16:56:33 +08:00
parent 8385050804
commit 6e421e60c5
No known key found for this signature in database
GPG Key ID: 9C3AD40F1F99880A
3 changed files with 4 additions and 5 deletions

View File

@ -120,7 +120,6 @@ impl IVerge {
proxy_guard_duration: Some(30), proxy_guard_duration: Some(30),
auto_close_connection: Some(true), auto_close_connection: Some(true),
enable_builtin_enhanced: Some(true), enable_builtin_enhanced: Some(true),
proxy_layout_column: Some(1),
..Self::default() ..Self::default()
} }
} }

View File

@ -31,10 +31,10 @@ export const useRenderList = (mode: string) => {
const { verge } = useVerge(); const { verge } = useVerge();
const { width } = useWindowWidth(); const { width } = useWindowWidth();
let col = verge?.proxy_layout_column || 1; let col = Math.floor(verge?.proxy_layout_column || 6);
// 自适应 // 自适应
if (col === 6) { if (col >= 6 || col <= 0) {
if (width > 1450) col = 5; if (width > 1450) col = 5;
else if (width > 1024) col = 4; else if (width > 1024) col = 4;
else if (width > 900) col = 3; else if (width > 900) col = 3;

View File

@ -21,7 +21,7 @@ export const MiscViewer = forwardRef<DialogRef>((props, ref) => {
const [values, setValues] = useState({ const [values, setValues] = useState({
autoCloseConnection: false, autoCloseConnection: false,
enableBuiltinEnhanced: true, enableBuiltinEnhanced: true,
proxyLayoutColumn: 1, proxyLayoutColumn: 6,
defaultLatencyTest: "", defaultLatencyTest: "",
}); });
@ -31,7 +31,7 @@ export const MiscViewer = forwardRef<DialogRef>((props, ref) => {
setValues({ setValues({
autoCloseConnection: verge?.auto_close_connection ?? false, autoCloseConnection: verge?.auto_close_connection ?? false,
enableBuiltinEnhanced: verge?.enable_builtin_enhanced ?? true, enableBuiltinEnhanced: verge?.enable_builtin_enhanced ?? true,
proxyLayoutColumn: verge?.proxy_layout_column || 1, proxyLayoutColumn: verge?.proxy_layout_column || 6,
defaultLatencyTest: verge?.default_latency_test || "", defaultLatencyTest: verge?.default_latency_test || "",
}); });
}, },