From 3246bea4d8cb06c555d648077b8b2b0df9aadbab Mon Sep 17 00:00:00 2001 From: Jackson Harper Date: Wed, 15 Nov 2023 14:53:16 +0800 Subject: [PATCH] Better hovering on macos for the labels editor --- .../Share/Views/ShareExtensionView.swift | 12 +----------- .../Sources/App/Views/LabelsEntryView.swift | 11 +++++++++++ 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/apple/OmnivoreKit/Sources/App/AppExtensions/Share/Views/ShareExtensionView.swift b/apple/OmnivoreKit/Sources/App/AppExtensions/Share/Views/ShareExtensionView.swift index 7010f3efc..84232e33d 100644 --- a/apple/OmnivoreKit/Sources/App/AppExtensions/Share/Views/ShareExtensionView.swift +++ b/apple/OmnivoreKit/Sources/App/AppExtensions/Share/Views/ShareExtensionView.swift @@ -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) diff --git a/apple/OmnivoreKit/Sources/App/Views/LabelsEntryView.swift b/apple/OmnivoreKit/Sources/App/Views/LabelsEntryView.swift index f9516288b..07138b14f 100644 --- a/apple/OmnivoreKit/Sources/App/Views/LabelsEntryView.swift +++ b/apple/OmnivoreKit/Sources/App/Views/LabelsEntryView.swift @@ -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)) }