🎨 code comments and test for getMenuBarHeight function

This commit is contained in:
Shubham 2017-05-30 17:26:02 -04:00
parent 793d5fd191
commit 62d9bf9bae
4 changed files with 21 additions and 6 deletions

View file

@ -120,9 +120,9 @@ void Screen::BuildPrototype(
.SetMethod("getPrimaryDisplay", &Screen::GetPrimaryDisplay)
.SetMethod("getAllDisplays", &Screen::GetAllDisplays)
.SetMethod("getDisplayNearestPoint", &Screen::GetDisplayNearestPoint)
#if defined(OS_MACOSX)
#if defined(OS_MACOSX)
.SetMethod("getMenuBarHeight", &Screen::getMenuBarHeight)
#endif
#endif
.SetMethod("getDisplayMatching", &Screen::GetDisplayMatching);
}

View file

@ -1,3 +1,7 @@
// Copyright (c) 2017 GitHub, Inc.
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.
#import "atom/browser/api/atom_api_screen.h"
#import <Cocoa/Cocoa.h>
@ -5,11 +9,10 @@
namespace atom {
namespace api {
#if defined(OS_MACOSX)
int Screen::getMenuBarHeight(){
int Screen::getMenuBarHeight() {
return [[NSApp mainMenu] menuBarHeight];
}
#endif
}// namespace api
}// namespace atom