                   type: 'radio'
                   checked: viewstate.fontSize == 'x-small'
                   click: -> action 'changefontsize', 'x-small'
-              }, {
+              }
+              {
                   label: 'Small'
                   type: 'radio'
                   checked: viewstate.fontSize == 'small'
                   click: -> action 'changefontsize', 'small'
-              }, {
+              }
+              {
                   label: 'Medium'
                   type: 'radio'
                   checked: viewstate.fontSize == 'medium'
                   click: -> action 'changefontsize', 'medium'
-              }, {
+              }
+              {
                   label: 'Large'
                   type: 'radio'
                   checked: viewstate.fontSize == 'large'
                   click: -> action 'changefontsize', 'large'
-              }, {
+              }
+              {
                   label: 'Extra Large'
                   type: 'radio'
                   checked: viewstate.fontSize == 'x-large'
                   click: -> action 'changefontsize', 'x-large'
               }
             ]
-        }, {
-            label: 'Toggle Full Screen',
-            accelerator: getAccelerator('togglefullscreen'),
-            click: -> action 'togglefullscreen'
-        }, {
-            # seee https://github.com/atom/electron/issues/1507
-            label: 'Zoom In',
-            accelerator: getAccelerator('zoomin'),
-            click: -> action 'zoom', +0.25
-        }, {
-            label: 'Zoom Out',
-            accelerator: getAccelerator('zoomout'),
-            click: -> action 'zoom', -0.25
-        }, {
-            label: 'Reset Zoom',
-            accelerator: getAccelerator('resetzoom'),
-            click: -> action 'zoom'
-        }, {
-            type: 'separator'
-        }, {
+        }
+        { role: 'togglefullscreen' }
+        { role: 'zoomin' }
+        { role: 'zoomout' }
+        { role: 'resetzoom' }
+        { type: 'separator' }
+        {
             label: 'Previous Conversation',
             accelerator: getAccelerator('previousconversation')
             enabled: viewstate.loggedin
             click: -> action 'selectNextConv', -1
-        }, {
+        }
+        {
             label: 'Next Conversation',
             accelerator: getAccelerator('nextconversation')
             enabled: viewstate.loggedin
             click: -> action 'selectNextConv', +1
-        }, {
+        }
+        {
             label: 'Select Conversation',
             enabled: viewstate.loggedin
             submenu: [

                  label: 'Conversation 1'
                  accelerator: getAccelerator('conversation1')
                  click: -> action 'selectConvIndex', 0
              }, {
                  label: 'Conversation 2'
                  accelerator: getAccelerator('conversation2')
                  click: -> action 'selectConvIndex', 1
              }, {
                  label: 'Conversation 3'
                  accelerator: getAccelerator('conversation3')
                  click: -> action 'selectConvIndex', 2
              }, {
                  label: 'Conversation 4'
                  accelerator: getAccelerator('conversation4')
                  click: -> action 'selectConvIndex', 3
              }, {
                  label: 'Conversation 5'
                  accelerator: getAccelerator('conversation5')
                  click: -> action 'selectConvIndex', 4
              }, {
                  label: 'Conversation 6'
                  accelerator: getAccelerator('conversation6')
                  click: -> action 'selectConvIndex', 5
              }, {
                  label: 'Conversation 7'
                  accelerator: getAccelerator('conversation7')
                  click: -> action 'selectConvIndex', 6
              }, {
                  label: 'Conversation 8'
                  accelerator: getAccelerator('conversation8')
                  click: -> action 'selectConvIndex', 7
              }, {
                  label: 'Conversation 9'
                  accelerator: getAccelerator('conversation9')
                  click: -> action 'selectConvIndex', 8
              }
            ]
        }, {
            type: 'separator'
        }, {
            label: 'Show tray icon'
            type: 'checkbox'
            enabled: not viewstate.hidedockicon
            checked:  viewstate.showtray
            click: -> action 'toggleshowtray'
        }
        if isDarwin
            {
                label: 'Hide Dock icon'
                type: 'checkbox'
                enabled: viewstate.showtray
                checked:  viewstate.hidedockicon
                click: -> action 'togglehidedockicon'
            }
    ].filter (n) -> n != undefined

templateWindow = (viewstate) -> [
    {
        label: 'Minimize'
        accelerator: getAccelerator('minimize')
        selector: 'performMiniaturize:' if isDarwin
    }, {
        label: 'Close'
        accelerator: getAccelerator('close')
        selector: 'performClose:' if isDarwin
    }, {
        type: 'separator'
    }, {
        label: 'Bring All to Front',
        selector: 'arrangeInFront:' if isDarwin
    }
]


            label: 'View'
            submenu: templateView viewstate
        }
        {
            label: 'Window'
            submenu: templateWindow viewstate
        } if isDarwin
    ].filter (n) -> n != undefined

module.exports = (viewstate) ->
