Skip to content

Commit

Permalink
[electron] Add settings option to context menu (#233)
Browse files Browse the repository at this point in the history
* [electron] Add settings option to context menu

* Add changelog entry
  • Loading branch information
gabrieldonadel authored Dec 19, 2024
1 parent c57bd0e commit 16dcaaf
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

### 🎉 New features

- [Windows] Add settings option to context menu. ([#233](https://github.com/expo/orbit/pull/233) by [@gabrieldonadel](https://github.com/gabrieldonadel))

### 🐛 Bug fixes

### 💡 Others
Expand Down
16 changes: 16 additions & 0 deletions apps/menu-bar/electron/src/TrayGenerator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ import {
} from 'electron';
import path from 'path';

import WindowManager from '../modules/WindowManager/main';

export default class TrayGenerator {
mainWindow: BrowserWindow;
tray: Tray | null;
Expand Down Expand Up @@ -56,6 +58,20 @@ export default class TrayGenerator {
};
rightClickMenu = () => {
const menu: MenuItemConstructorOptions[] = [
{
label: 'Settings...',
click() {
WindowManager.openWindow('Settings', {
// Keep in sync with menu-bar/src/windows/index.ts
title: 'Settings',
windowStyle: {
titlebarAppearsTransparent: true,
height: 580,
width: 500,
},
});
},
},
{
role: 'quit',
accelerator: 'Command+Q',
Expand Down

0 comments on commit 16dcaaf

Please sign in to comment.