Skip to content

Commit

Permalink
feat: Refactor Menu Navigation and Update Media Control Icons (#2783)
Browse files Browse the repository at this point in the history
* chore: update media control icons

Updated "next," "pause," "play," and "previous" icons in the media-icons-black folder. This improves visual consistency and ensures the latest icon designs are applied.

* refactor(menu): migrate to `navigationHistory` API

- Replaced deprecated `webContents` navigation methods (`canGoBack`, `goBack`, `canGoForward`, `goForward`) with `navigationHistory` API.
- Updated `mainMenuTemplate` to use the new `navigationHistory` destructured from `win.webContents`.
  • Loading branch information
yilmazcabuk authored Dec 28, 2024
1 parent f15c51f commit 6b8fed3
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
Binary file modified assets/media-icons-black/next.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/media-icons-black/pause.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/media-icons-black/play.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/media-icons-black/previous.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 5 additions & 5 deletions src/menu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export const mainMenuTemplate = async (
win: BrowserWindow,
): Promise<MenuTemplate> => {
const innerRefreshMenu = () => refreshMenu(win);

const { navigationHistory } = win.webContents;
await loadAllMenuPlugins(win);

const menuResult = Object.entries(getAllMenuTemplate()).map(
Expand Down Expand Up @@ -610,16 +610,16 @@ export const mainMenuTemplate = async (
{
label: t('main.menu.navigation.submenu.go-back'),
click() {
if (win.webContents.canGoBack()) {
win.webContents.goBack();
if (navigationHistory.canGoBack()) {
navigationHistory.goBack();
}
},
},
{
label: t('main.menu.navigation.submenu.go-forward'),
click() {
if (win.webContents.canGoForward()) {
win.webContents.goForward();
if (navigationHistory.canGoForward()) {
navigationHistory.goForward();
}
},
},
Expand Down

0 comments on commit 6b8fed3

Please sign in to comment.