Skip to content

Commit

Permalink
Merge pull request #73 from winebarrel/add_effectHoverCursor
Browse files Browse the repository at this point in the history
Add effect hover cursor
  • Loading branch information
winebarrel authored Dec 8, 2024
2 parents 8755865 + 74946bf commit 7c176da
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 5 deletions.
8 changes: 4 additions & 4 deletions PagerCall.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@
CODE_SIGN_ENTITLEMENTS = PagerCall/PagerCall.entitlements;
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 4;
CURRENT_PROJECT_VERSION = 1;
DEAD_CODE_STRIPPING = YES;
DEVELOPMENT_ASSET_PATHS = "";
DEVELOPMENT_TEAM = 97A8B2WE2P;
Expand All @@ -308,7 +308,7 @@
"$(inherited)",
"@executable_path/../Frameworks",
);
MARKETING_VERSION = 1.1;
MARKETING_VERSION = 1.2;
PRODUCT_BUNDLE_IDENTIFIER = jp.winebarrel.PagerCall;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_EMIT_LOC_STRINGS = YES;
Expand All @@ -324,7 +324,7 @@
CODE_SIGN_ENTITLEMENTS = PagerCall/PagerCall.entitlements;
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 4;
CURRENT_PROJECT_VERSION = 1;
DEAD_CODE_STRIPPING = YES;
DEVELOPMENT_ASSET_PATHS = "";
DEVELOPMENT_TEAM = 97A8B2WE2P;
Expand All @@ -339,7 +339,7 @@
"$(inherited)",
"@executable_path/../Frameworks",
);
MARKETING_VERSION = 1.1;
MARKETING_VERSION = 1.2;
PRODUCT_BUNDLE_IDENTIFIER = jp.winebarrel.PagerCall;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_EMIT_LOC_STRINGS = YES;
Expand Down
3 changes: 2 additions & 1 deletion PagerCall/ContentView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ struct ContentView: View {
.onHover { hovering in
hoverId = hovering ? incident.id : ""
}
.effectHoverCursor()
}
Text("(\(incident.createdAt.relative()))").font(.caption2)
}
Expand All @@ -61,7 +62,7 @@ struct ContentView: View {
}
} label: {
Image(systemName: "arrow.triangle.2.circlepath")
}
}.effectHoverCursor()

let label = if let updatedAt = pagerDuty.updatedAt {
updatedAt.shortTime()
Expand Down
13 changes: 13 additions & 0 deletions PagerCall/HoverEffect.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import SwiftUI

extension View {
func effectHoverCursor() -> some View {
onHover { hovering in
if hovering {
NSCursor.pointingHand.push()
} else {
NSCursor.pop()
}
}
}
}
2 changes: 2 additions & 0 deletions PagerCall/SettingsView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ struct SettingView: View {
Form {
SecureField(text: $apiKey) {
Link("API Key", destination: URL(string: "https://support.pagerduty.com/main/docs/api-access-keys")!)
.effectHoverCursor()
}.onChange(of: apiKey) {
Vault.apiKey = apiKey
}
Expand Down Expand Up @@ -44,6 +45,7 @@ struct SettingView: View {
// swiftlint:enable force_cast
Text("Ver. \(appVer).\(buildVer)")
}
.effectHoverCursor()
.frame(maxWidth: .infinity, alignment: .trailing)
}
.padding(20)
Expand Down

0 comments on commit 7c176da

Please sign in to comment.