Skip to content

Commit 9e60e54

Browse files
authored
^⌘0 resets font size (#1562)
* add menu for font size * fix swiftlint
1 parent acc3d4b commit 9e60e54

File tree

1 file changed

+24
-15
lines changed

1 file changed

+24
-15
lines changed

CodeEdit/Features/WindowCommands/ViewCommands.swift

Lines changed: 24 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -45,26 +45,35 @@ struct ViewCommands: Commands {
4545
}
4646
.keyboardShortcut("p", modifiers: [.shift, .command])
4747

48-
Button("Increase font size") {
49-
if !(editorFontSize >= 288) {
50-
editorFontSize += 1
51-
}
52-
if !(terminalFontSize >= 288) {
53-
terminalFontSize += 1
48+
Menu("Font Size") {
49+
Button("Increase") {
50+
if !(editorFontSize >= 288) {
51+
editorFontSize += 1
52+
}
53+
if !(terminalFontSize >= 288) {
54+
terminalFontSize += 1
55+
}
5456
}
55-
}
56-
.keyboardShortcut("+")
57-
.disabled(windowController == nil)
57+
.keyboardShortcut("+")
5858

59-
Button("Decrease font size") {
60-
if !(editorFontSize <= 1) {
61-
editorFontSize -= 1
59+
Button("Decrease") {
60+
if !(editorFontSize <= 1) {
61+
editorFontSize -= 1
62+
}
63+
if !(terminalFontSize <= 1) {
64+
terminalFontSize -= 1
65+
}
6266
}
63-
if !(terminalFontSize <= 1) {
64-
terminalFontSize -= 1
67+
.keyboardShortcut("-")
68+
69+
Divider()
70+
71+
Button("Reset") {
72+
editorFontSize = 12
73+
terminalFontSize = 12
6574
}
75+
.keyboardShortcut("0", modifiers: [.command, .control])
6676
}
67-
.keyboardShortcut("-")
6877
.disabled(windowController == nil)
6978

7079
Button("Customize Toolbar...") {

0 commit comments

Comments
 (0)