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

Conversation

akash-joshi
Copy link
Contributor

What does this PR do?
I made the menu described in #84 . It allows opacity to be changed via the menu or Keyboard shortcuts.

Showing working via keyboard shortcuts :

Apologies about the previous PR, it didn't have the correct file pushed in it.

What platforms did you test it on?
OSX, Windows 7

@alxwrd
Copy link
Contributor

alxwrd commented Jan 15, 2019

Just a thought, you could do something like this?

{
  label: 'Set Opacity',
  submenu: (() => {
      var result = []
      let level = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10].forEach((num) => {
          result.push({
              label: `${num}0%`,
              accelerator: `CmdOrCtrl+${num}`,
              click() {
                  mainWindow.webContents.send('opacity.sync', num * 10);
                  mainWindow.setOpacity(num / 10.0);
              }
          })
      })
      return result
  })()
}

Thanks @alxwrd for the suggestion
@akash-joshi
Copy link
Contributor Author

@alxwrd Incorporated your suggestion. Just changed forEach to a map function and put a check for CmdOrCtrl+0

@kamranahmedse kamranahmedse merged commit 15c106e into kamranahmedse:master Jan 16, 2019
@kamranahmedse
Copy link
Owner

Thanks guys

renatobezerra pushed a commit to renatobezerra/pennywise that referenced this pull request Feb 15, 2021
…one] (kamranahmedse#96)

* It floats ! PDF Support

* It floats ! PDF Support

* Added PDF Support

* PDF Working

* Removes opening PDF from file input

* Reducing changes

* Add files via upload

* Update readme.md

* Adds video,audio,image,PDF support

* Changed logo for merge

* asd

* yeet

* Allows opacity to be set via Menu

Tries to fix kamranahmedse#84

* Reduced submenu to map function

Thanks @alxwrd for the suggestion
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants