Skip to content

Commit

Permalink
fix: change default column to auto
Browse files Browse the repository at this point in the history
  • Loading branch information
zzzgydi committed Dec 14, 2022
1 parent 8385050 commit 6e421e6
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
1 change: 0 additions & 1 deletion src-tauri/src/config/verge.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,6 @@ impl IVerge {
proxy_guard_duration: Some(30),
auto_close_connection: Some(true),
enable_builtin_enhanced: Some(true),
proxy_layout_column: Some(1),
..Self::default()
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/components/proxy/use-render-list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ export const useRenderList = (mode: string) => {
const { verge } = useVerge();
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;
else if (width > 1024) col = 4;
else if (width > 900) col = 3;
Expand Down
4 changes: 2 additions & 2 deletions src/components/setting/mods/misc-viewer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export const MiscViewer = forwardRef<DialogRef>((props, ref) => {
const [values, setValues] = useState({
autoCloseConnection: false,
enableBuiltinEnhanced: true,
proxyLayoutColumn: 1,
proxyLayoutColumn: 6,
defaultLatencyTest: "",
});

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

0 comments on commit 6e421e6

Please sign in to comment.