Skip to content

Commit

Permalink
fix: 修复记住窗口大小尺寸错误
Browse files Browse the repository at this point in the history
  • Loading branch information
Pylogmon committed May 22, 2023
1 parent f68f000 commit 69b1a22
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/windows/Translator/components/TopBar/index.jsx
Expand Up @@ -19,12 +19,14 @@ let unlisten = listen('tauri://blur', () => {
}
});

listen('tauri://resize', async (e) => {
listen('tauri://resize', async () => {
if (get('remember_window_size') ?? false) {
if (appWindow.label == 'translator' || appWindow.label == 'popclip' || appWindow.label == 'persistent') {
const size = e.payload;
await set('window_height', size.height);
await set('window_width', size.width);
const psize = await appWindow.innerSize();
const factor = await appWindow.scaleFactor();
const lsize = psize.toLogical(factor);
await set('window_height', parseInt(lsize.height));
await set('window_width', parseInt(lsize.width));
}
}
});
Expand Down

0 comments on commit 69b1a22

Please sign in to comment.