Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions _scripts/webpack.main.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ const config = {
},
plugins: [
new webpack.DefinePlugin({
'process.platform': `'${process.platform}'`,
'process.env.IS_ELECTRON_MAIN': true
})
],
Expand Down
1 change: 1 addition & 0 deletions _scripts/webpack.renderer.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ const config = {
plugins: [
processLocalesPlugin,
new webpack.DefinePlugin({
'process.platform': `'${process.platform}'`,
'process.env.IS_ELECTRON': true,
'process.env.IS_ELECTRON_MAIN': false,
'process.env.SUPPORTS_LOCAL_API': true,
Expand Down
1 change: 1 addition & 0 deletions _scripts/webpack.web.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ const config = {
},
plugins: [
new webpack.DefinePlugin({
'process.platform': 'undefined',
'process.env.IS_ELECTRON': false,
'process.env.IS_ELECTRON_MAIN': false,
'process.env.SUPPORTS_LOCAL_API': false,
Expand Down
50 changes: 26 additions & 24 deletions src/main/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1738,6 +1738,24 @@ function runApp() {
const hidePlaylists = (await sidenavSettings.hidePlaylists)?.value

const template = [
...process.platform === 'darwin'
? [
{
label: app.getName(),
submenu: [
{ role: 'about' },
{ type: 'separator' },
{ role: 'services' },
{ type: 'separator' },
{ role: 'hide' },
{ role: 'hideothers' },
{ role: 'unhide' },
{ type: 'separator' },
{ role: 'quit' }
]
}
]
: [],
{
label: 'File',
submenu: [
Expand Down Expand Up @@ -1945,32 +1963,16 @@ function runApp() {
{ role: 'minimize' },
{ role: 'close' }
]
}
},
...process.platform === 'darwin'
? [
{ role: 'window' },
{ role: 'help' },
{ role: 'services' }
]
: []
]

if (process.platform === 'darwin') {
template.unshift({
label: app.getName(),
submenu: [
{ role: 'about' },
{ type: 'separator' },
{ role: 'services' },
{ type: 'separator' },
{ role: 'hide' },
{ role: 'hideothers' },
{ role: 'unhide' },
{ type: 'separator' },
{ role: 'quit' }
]
})

template.push(
{ role: 'window' },
{ role: 'help' },
{ role: 'services' }
)
}

const menu = Menu.buildFromTemplate(template)
Menu.setApplicationMenu(menu)
}
Expand Down
31 changes: 16 additions & 15 deletions src/renderer/components/player-settings/player-settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -198,18 +198,19 @@ export default defineComponent({
this.$t('Settings.General Settings.Thumbnail Preference.Default'),
this.$t('Settings.Player Settings.Default Viewing Mode.Theater'),
this.$t('Video.Player.Full Window'),

...process.env.IS_ELECTRON
? [
this.$t('Settings.Player Settings.Default Viewing Mode.Full Screen'),
this.$t('Settings.Player Settings.Default Viewing Mode.Picture in Picture')
]
: []
]

if (process.env.IS_ELECTRON) {
if (process.env.IS_ELECTRON && this.externalPlayer !== '') {
viewingModeNames.push(
this.$t('Settings.Player Settings.Default Viewing Mode.Full Screen'),
this.$t('Settings.Player Settings.Default Viewing Mode.Picture in Picture')
this.$t('Settings.Player Settings.Default Viewing Mode.External Player', { externalPlayerName: this.externalPlayer })
)
if (this.externalPlayer !== '') {
viewingModeNames.push(
this.$t('Settings.Player Settings.Default Viewing Mode.External Player', { externalPlayerName: this.externalPlayer })
)
}
}

return viewingModeNames
Expand All @@ -219,15 +220,15 @@ export default defineComponent({
const viewingModeValues = [
'default',
'theatre',
'fullwindow'
]
'fullwindow',

if (process.env.IS_ELECTRON) {
viewingModeValues.push('fullscreen', 'pip')
...process.env.IS_ELECTRON
? ['fullscreen', 'pip']
: []
]

if (this.externalPlayer !== '') {
viewingModeValues.push('external_player')
}
if (process.env.IS_ELECTRON && this.externalPlayer !== '') {
viewingModeValues.push('external_player')
}

return viewingModeValues
Expand Down
24 changes: 16 additions & 8 deletions src/renderer/components/top-nav/top-nav.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,14 @@ export default defineComponent({
},

forwardText: function () {
const shortcuts = [KeyboardShortcuts.APP.GENERAL.HISTORY_FORWARD]
if (process.platform === 'darwin') {
shortcuts.push(KeyboardShortcuts.APP.GENERAL.HISTORY_FORWARD_ALT_MAC)
}
const shortcuts = process.platform === 'darwin'
? [
KeyboardShortcuts.APP.GENERAL.HISTORY_FORWARD,
KeyboardShortcuts.APP.GENERAL.HISTORY_FORWARD_ALT_MAC
]
: [
KeyboardShortcuts.APP.GENERAL.HISTORY_FORWARD
]

return localizeAndAddKeyboardShortcutToActionTitle(
this.$t('Forward'),
Expand All @@ -112,10 +116,14 @@ export default defineComponent({
},

backwardText: function () {
const shortcuts = [KeyboardShortcuts.APP.GENERAL.HISTORY_BACKWARD]
if (process.platform === 'darwin') {
shortcuts.push(KeyboardShortcuts.APP.GENERAL.HISTORY_BACKWARD_ALT_MAC)
}
const shortcuts = process.platform === 'darwin'
? [
KeyboardShortcuts.APP.GENERAL.HISTORY_BACKWARD,
KeyboardShortcuts.APP.GENERAL.HISTORY_BACKWARD_ALT_MAC
]
: [
KeyboardShortcuts.APP.GENERAL.HISTORY_BACKWARD
]

return localizeAndAddKeyboardShortcutToActionTitle(
this.$t('Back'),
Expand Down