feat: Refactor Menu Navigation and Update Media Control Icons (#2783)

* 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`.
This commit is contained in:
Yılmaz ÇABUK
2024-12-28 17:27:07 +03:00
committed by GitHub
parent f15c51f3d7
commit 6b8fed3fc2
5 changed files with 5 additions and 5 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 250 B

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 192 B

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 265 B

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 269 B

After

Width:  |  Height:  |  Size: 13 KiB

View File

@ -68,7 +68,7 @@ export const mainMenuTemplate = async (
win: BrowserWindow, win: BrowserWindow,
): Promise<MenuTemplate> => { ): Promise<MenuTemplate> => {
const innerRefreshMenu = () => refreshMenu(win); const innerRefreshMenu = () => refreshMenu(win);
const { navigationHistory } = win.webContents;
await loadAllMenuPlugins(win); await loadAllMenuPlugins(win);
const menuResult = Object.entries(getAllMenuTemplate()).map( const menuResult = Object.entries(getAllMenuTemplate()).map(
@ -610,16 +610,16 @@ export const mainMenuTemplate = async (
{ {
label: t('main.menu.navigation.submenu.go-back'), label: t('main.menu.navigation.submenu.go-back'),
click() { click() {
if (win.webContents.canGoBack()) { if (navigationHistory.canGoBack()) {
win.webContents.goBack(); navigationHistory.goBack();
} }
}, },
}, },
{ {
label: t('main.menu.navigation.submenu.go-forward'), label: t('main.menu.navigation.submenu.go-forward'),
click() { click() {
if (win.webContents.canGoForward()) { if (navigationHistory.canGoForward()) {
win.webContents.goForward(); navigationHistory.goForward();
} }
}, },
}, },