0

I want to set with and height for my app to 1400 and 800 If it is possible but if a Screen is smaller than 1400 or 800 , app opens full size Not Full Screen I mean i want some thin like this:

"window": {
    "title": "My App",
    "toolbar": false,
    "min_width": 1400,
    "min_height": 800,
    "max_width": 100%,
    "max_height": 100%,  
}

I know i can set fullscreen : true

But i want some thing like above or something like this fullsize : true

Thanks

Sachin PATIL
  • 745
  • 1
  • 9
  • 16
nayeri
  • 175
  • 1
  • 7

1 Answers1

0

It is actually pretty simple if you have a look at the documentation http://docs.nwjs.io/en/latest/References/Screen/

Screen.Init() //initiate the screen
var screens = Screen.screens //get all screens. you may have more then one monitor....
var work_area = screens[0]. work_area //get the work area of the screen
var max_width = work_area.width //get the max width
var max_height = work_area.height //get the max height
//check if fullscreen should be entered
if(max_height < 800 || max-wdith < 1400){
     var win = nw.Window.get();
     win.enterFullscreen()
}

You basically check on startup if you have the screenwidth. If not you go to fullscreen. I think you could also us https://developer.chrome.com/apps/system_display to get max-width and max-height

Silve2611
  • 2,198
  • 2
  • 34
  • 55