Skip to content

Commit

Permalink
Select enable or disable window resize in preferences
Browse files Browse the repository at this point in the history
  • Loading branch information
noraworld committed Mar 17, 2017
1 parent b7aaae1 commit 62f0e44
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 1 deletion.
1 change: 1 addition & 0 deletions config.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ if (typeof __dirname !== 'undefined') {
* */
var userPreferences = {
alwaysOnTop : true,
windowResize: true,
windowPosition : 'trayCenter',
userAgent : 'Mozilla/5.0 (iPad; CPU OS 9_0 like Mac OS X) AppleWebKit/601.1.17 (KHTML, like Gecko) Version/8.0 Mobile/13A175 Safari/600.1.',
globalShortcuts : true
Expand Down
3 changes: 2 additions & 1 deletion main.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ var menubar = require('menubar');
var ipcMain = require('electron').ipcMain;

var AppConfig = require('./config.js');
var config = AppConfig.store.userPreferences;

var mb = menubar(
Object.assign(AppConfig.store.defaults)
Expand Down Expand Up @@ -75,7 +76,7 @@ mb.on('ready', function ready() {
});

mb.on('after-create-window', function () {
mb.window.setResizable(true);
mb.window.setResizable(config.windowResize);
mb.window.setMinimumSize(400, 400);
});

Expand Down
1 change: 1 addition & 0 deletions src/preferences.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
/* Must reflect <input name={GROUP}> in preference.html and configs */
var groups = [
'alwaysOnTop',
'windowResize',
'windowPosition',
'externalLinks',
'globalShortcuts'
Expand Down
20 changes: 20 additions & 0 deletions views/preferences.html
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,26 @@ <h1 class="title is-1">
</label>
</p>
</div>
<div class="container">
<div class="heading">
<p class="title is-3">Window resize<span
class="tag is-danger is-small">Require a restart</span>
</p>
<p class="subtitle is-6">Allow you to resize window</p>

</div>
<p class="control">
<label class="radio">
<input value="yes" type="radio" name="windowResize"
checked>
Yes
</label>
<label class="radio">
<input value="no" type="radio" name="windowResize">
No
</label>
</p>
</div>
<div class="container">
<div class="heading">
<p class="title is-3">Window position</p>
Expand Down

0 comments on commit 62f0e44

Please sign in to comment.