Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allows opacity to be set via main menu or keyboard shortcuts[correct one] #96

Merged
merged 20 commits into from
Jan 16, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions public/menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,22 @@ function getOpacityMenuItems(mainWindow) {
mainWindow.setOpacity(nextOpacity);
}
},
{
label: 'Set Opacity',
submenu: (() => {
const result = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10].map((num) => {
return {
label: `${num}0%`,
accelerator: num === 10 ? `CmdOrCtrl+0` : `CmdOrCtrl+${num}`,
click() {
mainWindow.webContents.send('opacity.sync', num * 10);
mainWindow.setOpacity(num / 10.0);
}
}
})
return result
})()
},
{ type: 'separator' },
];
}
Expand Down
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,4 +118,4 @@ Because the application helps in floating and [Pennywise loved to do that](http:
Feel free to implement anything from the roadmap, submit pull requests, create issues, discuss ideas or spread the word.

## License
MIT © [Kamran Ahmed](https://twitter.com/kamranahmedse)
MIT © [Kamran Ahmed](https://twitter.com/kamranahmedse)