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`.
|
Before Width: | Height: | Size: 250 B After Width: | Height: | Size: 13 KiB |
|
Before Width: | Height: | Size: 192 B After Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 265 B After Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 269 B After Width: | Height: | Size: 13 KiB |
10
src/menu.ts
@ -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(
|
||||
@ -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();
|
||||
}
|
||||
},
|
||||
},
|
||||
|
||||