Skip to content

Commit ac43b81

Browse files
Merge pull request #985 from lukepistrol/fix/hover-welcome-window-glitch
[fix]: Hover Welcome Window Glitch
2 parents 51afc73 + 350806c commit ac43b81

3 files changed

Lines changed: 33 additions & 28 deletions

File tree

CodeEdit.xcodeproj/project.pbxproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3722,7 +3722,7 @@
37223722
repositoryURL = "https://github.com/CodeEditApp/CodeEditTextView.git";
37233723
requirement = {
37243724
kind = exactVersion;
3725-
version = 0.3.1;
3725+
version = 0.3.2;
37263726
};
37273727
};
37283728
58F2EB18292FB91C004A9BDE /* XCRemoteSwiftPackageReference "Preferences" */ = {

CodeEdit.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

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)