h2org / h2-core

Supporting light weight extensions for heavy task lifting
MIT License
0 stars 6 forks source link

Create a basic tray #6

Open poush opened 4 years ago

poush commented 4 years ago

In the recent update, I have commented the old createMenuTray function in main.ts

the task for this issue to reimplement the basic version of the tray icon. First, make sure you have done npm install in your latest pull. Then,

  1. Create a tray-icon.ts config file just like browser-window.ts which will export the object from contextMenu like:

    const contextMenu = Menu.buildFromTemplate([
    { label: 'Item1', type: 'radio' },
    { label: 'Item2', type: 'radio' },
    { label: 'Item3', type: 'radio', checked: true },
    { label: 'Item4', type: 'radio' }
    ])
  2. Right now, we only need one option in the menu Quit which will quit the app.

  3. after you write this config file import it on main.ts and use inside createMenuTray and uncomment the call statement of this function.

  4. Make sure you use the current tray icon image, residing at src/assets/images/tray.png

That's all test your changes and feel free to ask any questions

Find the docs for tray here: https://www.electronjs.org/docs/api/tray

divija-palleti commented 4 years ago

Hi! I am interested in this issue.

poush commented 4 years ago

Sure, please go ahead.