Pergunta

Before minimizing the node-webkit window it looked like this:

Before minimizing

After restoring the node-webkit window it looked like this:

After restoring

package.json

   {
      "name": "Gallay",
      "description": "Simplified Billing",
      "version": "0.1",
      "main": "index.html",
      "window": {
        "icon": "icons/16.png", 
        "show": true,
        "toolbar": false,
        "frame": true,
        "position": "center",
        "width": 507,
        "height": 570,
        "min_width": 507,
        "min_height": 570,
    "max_width": 507,
        "max_height": 570
      }
}

I need fixed width while minimizing and restoring the node-webkit window. How can I solve the above problem?

Foi útil?

Solução

After including jQuery and the following JavaScript, the problem can be solved.

    $(document).ready(function(){
        $(window).resize(function(){
            window.resizeTo(507,570);
            window.focus();
        });
    });

Outras dicas

Add to package.json: "resizable": false and remove min_width, min_height, max_width, max_height.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top