Skip to content

Commit

Permalink
optimized gui for windows
Browse files Browse the repository at this point in the history
  • Loading branch information
owestphal committed Aug 17, 2015
1 parent bcaf78c commit e5b5f59
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 6 deletions.
16 changes: 11 additions & 5 deletions src/coffeescript/main.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,18 @@ mainWindow = null

app.on 'window-all-closed', () -> app.quit()

platform = (require "os").platform()

app.on 'ready', () ->
mainWindow = new BrowserWindow(
width:143
height:80
resizable:false
center:true)
# using greater width and heigth for windows
w = if platform is "win32" or platform is "win64" then 156 else 143
h = if platform is "win32" or platform is "win64" then 110 else 80

mainWindow = new BrowserWindow
useContendSize:true
width:w
height:h
center:true
mainWindow.setMenuBarVisibility false
mainWindow.loadUrl 'file://' + __dirname + '/index.html'

Expand Down
12 changes: 11 additions & 1 deletion src/coffeescript/runFlc.coffee
Original file line number Diff line number Diff line change
@@ -1,8 +1,17 @@
button = document.getElementById "runFlc"
footer = document.getElementById "status"

platform = (require "os").platform()
exec = require("child_process").exec

runFlc = (args, callback) ->
flc = require("child_process").exec "./flc " + args, {cwd:"."}, callback
if platform is "win32" or platform is "win64"
console.log "windows platform detected"
exec "flc.exe " + args, {cwd:"."}, callback
else
console.log "linux/unix/os x platform detected"
exec "./flc " + args, {cwd:"."}, callback


remote = require "remote"
dialog = remote.require "dialog"
Expand All @@ -24,6 +33,7 @@ button.addEventListener "click", chooseFile

version = runFlc "--version", (e, stdout, stderr) ->
if e isnt null
console.log "no version on flc found"
console.log stderr
else
console.log "found flc version " + stdout
Expand Down

0 comments on commit e5b5f59

Please sign in to comment.