Skip to content
This repository was archived by the owner on May 12, 2026. It is now read-only.

Commit 0414483

Browse files
authored
Merge pull request #2178 from enyaxu/feature/2165
Hotkey for toggle editor fullscreen
2 parents 22939aa + 05488e6 commit 0414483

2 files changed

Lines changed: 16 additions & 1 deletion

File tree

browser/main/Detail/FullscreenButton.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,14 @@ import CSSModules from 'browser/lib/CSSModules'
44
import styles from './FullscreenButton.styl'
55
import i18n from 'browser/lib/i18n'
66

7+
const OSX = global.process.platform === 'darwin'
8+
const hotkey = (OSX ? i18n.__('Command(⌘)') : i18n.__('Ctrl(^)')) + '+B'
79
const FullscreenButton = ({
810
onClick
911
}) => (
1012
<button styleName='control-fullScreenButton' title={i18n.__('Fullscreen')} onMouseDown={(e) => onClick(e)}>
1113
<img styleName='iconInfo' src='../resources/icon/icon-full.svg' />
12-
<span styleName='tooltip'>{i18n.__('Fullscreen')}</span>
14+
<span styleName='tooltip'>{i18n.__('Fullscreen')}({hotkey})</span>
1315
</button>
1416
)
1517

lib/main-menu.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,19 @@ const view = {
276276
mainWindow.setFullScreen(!mainWindow.isFullScreen())
277277
}
278278
},
279+
{
280+
type: 'separator'
281+
},
282+
{
283+
label: 'Toggle Side Bar',
284+
accelerator: 'CommandOrControl+B',
285+
click () {
286+
mainWindow.webContents.send('editor:fullscreen')
287+
}
288+
},
289+
{
290+
type: 'separator'
291+
},
279292
{
280293
role: 'zoomin',
281294
accelerator: macOS ? 'CommandOrControl+Plus' : 'Control+='

0 commit comments

Comments
 (0)