-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #12 from SNQ-2001/develop
1.3.0
- Loading branch information
Showing
16 changed files
with
194 additions
and
151 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// | ||
// AppDelegate.swift | ||
// GitHubContributionsMenuBar | ||
// | ||
// Created by TAISHIN MIYAMOTO on 2023/02/21 | ||
// | ||
// | ||
|
||
import AppKit | ||
|
||
class AppDelegate: NSObject, NSApplicationDelegate, ObservableObject { | ||
private var settingsWindow: NSWindow? { | ||
NSApp.windows.first(where: { window in | ||
window.frameAutosaveName == "com_apple_SwiftUI_Settings_window" | ||
}) | ||
} | ||
|
||
func applicationDidFinishLaunching(_: Notification) {} | ||
|
||
func openPreferences() { | ||
NSApp.sendAction(Selector(("showSettingsWindow:")), to: nil, from: nil) | ||
|
||
guard let window = settingsWindow else { return } | ||
|
||
if window.canBecomeMain { | ||
window.orderFrontRegardless() | ||
window.center() | ||
NSApp.activate(ignoringOtherApps: true) | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// | ||
// ViewState.swift | ||
// GitHubContributionsMenuBar | ||
// | ||
// Created by 宮本大新 on 2023/01/10. | ||
// | ||
|
||
import Foundation | ||
|
||
enum ViewState { | ||
case success | ||
case failure | ||
case emptyUserName | ||
case inProgress | ||
} | ||
|
||
// extension ViewState { | ||
// static func == (lhs: ViewType, rhs: ViewType) -> Bool { | ||
// switch (lhs, rhs) { | ||
// case (.success, .success), | ||
// (.emptyUserName, .emptyUserName), | ||
// (.inProgress, .inProgress): | ||
// return true | ||
// case let (.failure(lhsError), .failure(rhsError)): | ||
// return lhsError.localizedDescription == rhsError.localizedDescription | ||
// default: | ||
// return false | ||
// } | ||
// } | ||
// } |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
File renamed without changes.
File renamed without changes.
Oops, something went wrong.