File tree Expand file tree Collapse file tree 1 file changed +13
-11
lines changed
CodeEdit/Features/WindowCommands Expand file tree Collapse file tree 1 file changed +13
-11
lines changed Original file line number Diff line number Diff line change 8
8
import SwiftUI
9
9
10
10
struct ViewCommands : Commands {
11
- @AppSettings ( \. textEditing. font) var font
11
+ @AppSettings ( \. textEditing. font. size) var editorFontSize
12
+ @AppSettings ( \. terminal. font. size) var terminalFontSize
12
13
13
14
@State var windowController : CodeEditWindowController ?
14
15
15
- private let documentController : CodeEditDocumentController = CodeEditDocumentController ( )
16
16
private let statusBarViewModel : StatusBarViewModel = StatusBarViewModel ( )
17
17
18
18
var navigatorCollapsed : Bool {
@@ -31,24 +31,26 @@ struct ViewCommands: Commands {
31
31
. keyboardShortcut ( " p " , modifiers: [ . shift, . command] )
32
32
33
33
Button ( " Increase font size " ) {
34
- if CodeEditDocumentController . shared. documents. count > 1 {
35
- font. size += 1
34
+ if !( editorFontSize >= 288 ) {
35
+ editorFontSize += 1
36
+ }
37
+ if !( terminalFontSize >= 288 ) {
38
+ terminalFontSize += 1
36
39
}
37
- font. size += 1
38
40
}
39
41
. keyboardShortcut ( " + " )
42
+ . disabled ( windowController == nil )
40
43
41
44
Button ( " Decrease font size " ) {
42
- if CodeEditDocumentController . shared. documents. count > 1 {
43
- if !( font. size <= 1 ) {
44
- font. size -= 1
45
- }
45
+ if !( editorFontSize <= 1 ) {
46
+ editorFontSize -= 1
46
47
}
47
- if !( font . size <= 1 ) {
48
- font . size -= 1
48
+ if !( terminalFontSize <= 1 ) {
49
+ terminalFontSize -= 1
49
50
}
50
51
}
51
52
. keyboardShortcut ( " - " )
53
+ . disabled ( windowController == nil )
52
54
53
55
Button ( " Customize Toolbar... " ) {
54
56
You can’t perform that action at this time.
0 commit comments