Skip to content

Commit 707052d

Browse files
committed
fix hovering glitch, code formatting
1 parent be8fad5 commit 707052d

1 file changed

Lines changed: 28 additions & 23 deletions

File tree

CodeEdit/Features/Welcome/Views/WelcomeView.swift

Lines changed: 28 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -121,18 +121,18 @@ struct WelcomeView: View {
121121
appBuild
122122
)
123123
)
124-
.foregroundColor(.secondary)
125-
.font(.system(size: 13))
126-
.onHover { inside in
127-
if inside {
128-
NSCursor.pointingHand.push()
129-
} else {
130-
NSCursor.pop()
131-
}
132-
}
133-
.onTapGesture {
134-
copyInformation()
124+
.foregroundColor(.secondary)
125+
.font(.system(size: 13))
126+
.onHover { inside in
127+
if inside {
128+
NSCursor.pointingHand.push()
129+
} else {
130+
NSCursor.pop()
135131
}
132+
}
133+
.onTapGesture {
134+
copyInformation()
135+
}
136136

137137
Spacer().frame(height: 20)
138138
HStack {
@@ -165,9 +165,9 @@ struct WelcomeView: View {
165165
comment: ""
166166
)
167167
)
168-
.onTapGesture {
169-
showGitClone = true
170-
}
168+
.onTapGesture {
169+
showGitClone = true
170+
}
171171
}
172172
}
173173
Spacer()
@@ -177,26 +177,28 @@ struct WelcomeView: View {
177177
.padding(.horizontal, 56)
178178
.padding(.bottom, 16)
179179
.background(Color(colorScheme == .dark ? NSColor.windowBackgroundColor : .white))
180-
.onHover { isHovering in
181-
self.isHovering = isHovering
182-
}
183180

184181
if isHovering {
185182
HStack(alignment: .center) {
186183
dismissButton
187184
Spacer()
188-
}.padding(13).transition(AnyTransition.opacity.animation(.easeInOut(duration: 0.25)))
185+
}
186+
.padding(13)
187+
.transition(AnyTransition.opacity.animation(.easeInOut(duration: 0.25)))
189188
}
190189
if isHovering {
191190
VStack {
192191
Spacer()
193192
HStack {
194193
Spacer()
195-
Toggle("Show this window when CodeEdit launches", isOn: .init(get: {
196-
prefs.preferences.general.reopenBehavior == .welcome
197-
}, set: { new in
198-
prefs.preferences.general.reopenBehavior = new ? .welcome : .openPanel
199-
}))
194+
Toggle(
195+
"Show this window when CodeEdit launches",
196+
isOn: .init(get: {
197+
prefs.preferences.general.reopenBehavior == .welcome
198+
}, set: { new in
199+
prefs.preferences.general.reopenBehavior = new ? .welcome : .openPanel
200+
})
201+
)
200202
.toggleStyle(.checkbox)
201203
Spacer()
202204
}
@@ -206,6 +208,9 @@ struct WelcomeView: View {
206208
.transition(AnyTransition.opacity.animation(.easeInOut(duration: 0.25)))
207209
}
208210
}
211+
.onHover { isHovering in
212+
self.isHovering = isHovering
213+
}
209214
.sheet(isPresented: $showGitClone) {
210215
GitCloneView(
211216
shellClient: shellClient,

0 commit comments

Comments
 (0)