Skip to content

Commit

Permalink
fix(stage-tamagotchi): set default window size
Browse files Browse the repository at this point in the history
  • Loading branch information
LemonNekoGH committed Feb 27, 2025
1 parent 94aa845 commit a5ceef5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions apps/stage-tamagotchi/src/main/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,10 @@ app.whenReady().then(() => {
})

ipcMain.on('window-size-changed', (_, width: number, height: number) => {
if (width === 0 || height === 0) {
mainWindow.setSize(300 * 1.5, 400 * 1.5) // back to default size
return
}
mainWindow.setSize(width, height)
})

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { WindowControlMode } from '../types/window-controls'
export const useWindowControlStore = defineStore('windowControl', () => {
const controlMode = ref<WindowControlMode>(WindowControlMode.DEFAULT)
const isControlActive = ref(false)
const size = useLocalStorage('window/control/size', { width: 0, height: 0 })
const size = useLocalStorage('window/control/size', { width: 300 * 1.5, height: 400 * 1.5 })
const position = useLocalStorage('window/control/position', { x: 0, y: 0 })

function setMode(mode: WindowControlMode) {
Expand Down

0 comments on commit a5ceef5

Please sign in to comment.