Skip to content

Commit

Permalink
^⌘0 resets font size (#1562)
Browse files Browse the repository at this point in the history
* add menu for font size

* fix swiftlint
  • Loading branch information
luah5 authored Feb 3, 2024
1 parent acc3d4b commit 9e60e54
Showing 1 changed file with 24 additions and 15 deletions.
39 changes: 24 additions & 15 deletions CodeEdit/Features/WindowCommands/ViewCommands.swift
Original file line number Diff line number Diff line change
Expand Up @@ -45,26 +45,35 @@ struct ViewCommands: Commands {
}
.keyboardShortcut("p", modifiers: [.shift, .command])

Button("Increase font size") {
if !(editorFontSize >= 288) {
editorFontSize += 1
}
if !(terminalFontSize >= 288) {
terminalFontSize += 1
Menu("Font Size") {
Button("Increase") {
if !(editorFontSize >= 288) {
editorFontSize += 1
}
if !(terminalFontSize >= 288) {
terminalFontSize += 1
}
}
}
.keyboardShortcut("+")
.disabled(windowController == nil)
.keyboardShortcut("+")

Button("Decrease font size") {
if !(editorFontSize <= 1) {
editorFontSize -= 1
Button("Decrease") {
if !(editorFontSize <= 1) {
editorFontSize -= 1
}
if !(terminalFontSize <= 1) {
terminalFontSize -= 1
}
}
if !(terminalFontSize <= 1) {
terminalFontSize -= 1
.keyboardShortcut("-")

Divider()

Button("Reset") {
editorFontSize = 12
terminalFontSize = 12
}
.keyboardShortcut("0", modifiers: [.command, .control])
}
.keyboardShortcut("-")
.disabled(windowController == nil)

Button("Customize Toolbar...") {
Expand Down

0 comments on commit 9e60e54

Please sign in to comment.