i am using electron to make a desktop app, I made my own minimize maximize and close buttons, all of them are working fine, but when you click on maximize and it already is maximized it is not being unmaximized. here is my code:
const $ = require('jquery');
const {remote} = require('electron');
var win = remote.getCurrentWindow();
$('#minimize').click(function(){
  win.minimize();
});
$('#close').click(function(){
  win.close();
});
$('#maximize').click(function() {
  if(win.isMaximized()){
      win.unmaximize();
  }else{
      win.maximize();
  }
});
Any help appreciated.
via Fullstack Devs
 
No comments:
Post a Comment