Skip to content

Commit

Permalink
fix size reloading issues on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
MAKIO135 committed Mar 1, 2019
1 parent d4630b5 commit 3591f6b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions desktop/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ app.on('ready', () => {
resizable: true,
icon: __dirname + '/icon.ico',
frame: process.platform !== 'darwin',
skipTaskbar: process.platform === 'darwin',
autoHideMenuBar: process.platform === 'darwin'
skipTaskbar: true,
autoHideMenuBar: true
})

app.win.loadFile('index.html')
Expand Down
10 changes: 5 additions & 5 deletions desktop/src/scripts/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const hostsList = document.getElementById('hosts')
const addButton = document.querySelector('[data-action="add"]')
const shortcuts = document.getElementById('shortcuts')
addEventListener('load', e => {
app.win.setSize(config.width, config.height)
app.win.setContentSize(config.width, config.height)
if(config.displayShortcuts) shortcuts.classList.toggle('open')
})

Expand All @@ -39,7 +39,7 @@ function validateHost(el) {
osc.removeClient(index)
config.hosts = hosts
// helpers.updateConfig(config)
app.win.setSize(app.win.getSize()[0], shortcuts.getBoundingClientRect().bottom)
app.win.setContentSize(app.win.getContentSize()[0], shortcuts.getBoundingClientRect().bottom)
}

helpers.unfocus(el)
Expand Down Expand Up @@ -166,7 +166,7 @@ function addHostLi(host, selected = true) {
// Events
addEventListener('resize', helpers.debounce(e => {
// update config.json
const dimensions = app.win.getSize()
const dimensions = app.win.getContentSize()
config.width = dimensions[0]
config.height = dimensions[1]
config.displayShortcuts = shortcuts.classList.contains('open')
Expand All @@ -175,12 +175,12 @@ addEventListener('resize', helpers.debounce(e => {

addButton.addEventListener('click', e => {
addHostLi()
app.win.setSize(app.win.getSize()[0], shortcuts.getBoundingClientRect().bottom)
app.win.setContentSize(app.win.getContentSize()[0], shortcuts.getBoundingClientRect().bottom)
})

shortcuts.querySelector('p').addEventListener('click', () => {
shortcuts.classList.toggle('open')
app.win.setSize(app.win.getSize()[0], shortcuts.getBoundingClientRect().bottom)
app.win.setContentSize(app.win.getContentSize()[0], shortcuts.getBoundingClientRect().bottom)
config.width = innerWidth
config.height = innerHeight
config.displayShortcuts = shortcuts.classList.contains('open')
Expand Down

0 comments on commit 3591f6b

Please sign in to comment.