Better hovering on macos for the labels editor

This commit is contained in:
Jackson Harper
2023-11-15 14:53:16 +08:00
parent ce711dd354
commit 3246bea4d8
2 changed files with 12 additions and 11 deletions

View File

@ -381,17 +381,7 @@ public struct ShareExtensionView: View {
.frame(maxWidth: .infinity)
.padding(.horizontal, 8)
.focused($focusedField, equals: .labelEditor)
#if os(macOS)
.onHover { isHovered in
DispatchQueue.main.async {
if isHovered {
NSCursor.iBeam.push()
} else {
NSCursor.pop()
}
}
}
#endif
if labelsViewModel.selectedLabels.isEmpty, labelsSearch == ZWSP {
Text("Type to add labels")
.fontWeight(.light)

View File

@ -194,7 +194,17 @@ public struct LabelsEntryView: View {
}
}.padding(0)
.frame(height: totalHeight)
.frame(maxWidth: .infinity)
.background(Color.extensionPanelBackground)
.onHover { isHovered in
DispatchQueue.main.async {
if isHovered {
NSCursor.iBeam.push()
} else {
NSCursor.pop()
}
}
}
.cornerRadius(8)
.onAppear {
textFieldFocused = true
@ -299,6 +309,7 @@ public struct LabelsEntryView: View {
createLabelButton
}.padding(4)
}
#endif
}.background(viewHeightReader($totalHeight))
}