// main process for the app.

'use strict';

// require modules.
var app = require('app');
var BrowserWindow = require('browser-window');
var flags = require('flags');
var ipc = require('ipc');
var Tray = require('tray');

// declear variables.
var mainWindow = null;
var appIcon = null;

// flags
flags.defineBoolean('hidden', false, 'hidden main window.');
flags.parse();

/*
listen event.
*/

app.on('ready', function() {
    // control main window by hidden flag when app start.
    if (!flags.get('hidden')) {
        mainWindow = new BrowserWindow({
            height: 600,
            width: 800,
            'min-height': 600,
            'min-width': 800,
            frame: true
        });

        mainWindow.loadUrl('file://' + __dirname + '/index.html');
    }

    // add tray
    appIcon = new Tray(__dirname + '/static/image/tray@4x.png');
});

ipc.on('app-close-main-window', function() {
    mainWindow.hide();
});

app.on('activate', function(){
    mainWindow.show();
});
@@ -315,19 +315,17 @@
 ean('hid
-den
+e
 ', false
@@ -330,19 +330,17 @@
 se, 'hid
-den
+e
  main wi
@@ -418,102 +418,8 @@
 ) %7B%0A
-    // control main window by hidden flag when app start.%0A    if (!flags.get('hidden')) %7B%0A    
     
@@ -459,20 +459,16 @@
         
-   
- 
 height: 
@@ -480,20 +480,16 @@
         
-    
 width: 8
@@ -496,28 +496,24 @@
 00,%0A        
-  
-  
 'min-height'
@@ -515,28 +515,24 @@
 ight': 600,%0A
-    
         'min
@@ -557,41 +557,149 @@
     
-    frame: true%0A        %7D
+frame: false%0A    %7D);%0A%0A    // control main window by hide flag when app start.%0A    if (flags.get('hide')) %7B%0A        mainWindow.hide(
 );%0A
-%0A
     
+%7D%0A%0A
     
@@ -756,22 +756,16 @@
 .html');
-%0A    %7D
 %0A%0A    //
@@ -946,16 +946,17 @@
 nction()
+ 
 %7B%0A    ma

fix hide flag bug.