Skip to content

Commit

Permalink
2.3.2
Browse files Browse the repository at this point in the history
  • Loading branch information
ZzzM committed Dec 19, 2023
1 parent 20e65e2 commit 6bf1f5e
Show file tree
Hide file tree
Showing 114 changed files with 3,190 additions and 1,452 deletions.
40 changes: 17 additions & 23 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,54 +1,48 @@
name: Mars

on:
# push:
# tags:
# - '*'

workflow_dispatch:
push:
tags:
- '*'

env:
APP_NAME: CalendarX
SPARKLE_KEY: ${{ secrets.SPARKLE_KEY }}
BODY_PATH: BODY_PATH.md
PERSONAL_TOKEN: ${{ secrets.PERSONAL_TOKEN }}

jobs:

Release:
runs-on: macos-latest
runs-on: macos-13
steps:

- name: Checkout
uses: actions/checkout@v3.3.0
uses: actions/checkout@v4.1.1

- name: Setup
uses: actions/[email protected]

- run: |
echo "APP_VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
- name: Package
run: |
fastlane package
uses: actions/[email protected]

- name: Setup Xcode
uses: maxim-lobanov/[email protected]

- name: Create
- name: Create DMG
run: |
sh scripts/create_dmg.sh
fastlane create_dmg
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
body_path: ${{ env.BODY_PATH }}
files: ${{ env.APP_NAME }}.dmg
body_path: ${{ env.LOG_PATH }}
files: ${{ env.APP_PATH }}

- name: Appcast
uses: actions/github-script@v6
uses: actions/github-script@v7.0.1
if: startsWith(github.ref, 'refs/tags/')
with:
github-token: ${{ secrets.PERSONAL_TOKEN }}
script: |
github.rest.repos.requestPagesBuild({
owner: context.repo.owner,
repo: context.repo.repo,
})
})
33 changes: 7 additions & 26 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -45,48 +45,29 @@ playground.xcworkspace

# Swift Package Manager
# Add this line if you want to avoid checking in source code from Swift Package Manager dependencies.
# Packages/
# Package.pins
# Package.resolved
# *.xcodeproj
# Xcode automatically generates this directory with a .xcworkspacedata file and xcuserdata
# hence it is not needed unless you have added a package configuration file to your project
# .swiftpm
Packages/
Package.pins
Package.resolved
*.xcodeproj
Xcode automatically generates this directory with a .xcworkspacedata file and xcuserdata
hence it is not needed unless you have added a package configuration file to your project
.swiftpm

.build/

# CocoaPods
# We recommend against adding the Pods directory to your .gitignore. However
# you should judge for yourself, the pros and cons are mentioned at:
# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
# Pods/
# Add this line if you want to avoid checking in source code from the Xcode workspace
# *.xcworkspace

# Carthage
# Add this line if you want to avoid checking in source code from Carthage dependencies.
# Carthage/Checkouts

Carthage/Build/

# Accio dependency management
Dependencies/
.accio/

# fastlane
# It is recommended to not store the screenshots in the git repo.
# Instead, use fastlane to re-generate the screenshots whenever they are needed.
# For more information about the recommended setup visit:
# https://docs.fastlane.tools/best-practices/source-control/#source-control

fastlane/report.xml
fastlane/Preview.html
fastlane/screenshots/**/*.png
fastlane/test_output

# Code Injection
# After new code Injection tools there's a generated folder /iOSInjectionProject
# https://github.com/johnno1962/injectionforxcode

iOSInjectionProject/

Expand Down
922 changes: 526 additions & 396 deletions CalendarX.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

15 changes: 7 additions & 8 deletions CalendarX.xcodeproj/xcshareddata/xcschemes/CalendarX.xcscheme
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1420"
version = "1.3">
LastUpgradeVersion = "1510"
version = "1.7">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
Expand All @@ -14,7 +14,7 @@
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "98D573CD27571EB3001C2D8C"
BlueprintIdentifier = "98712FA02B2BB15E005163D4"
BuildableName = "CalendarX.app"
BlueprintName = "CalendarX"
ReferencedContainer = "container:CalendarX.xcodeproj">
Expand All @@ -26,9 +26,8 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
shouldUseLaunchSchemeArgsEnv = "YES"
shouldAutocreateTestPlan = "YES">
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
Expand All @@ -44,7 +43,7 @@
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "98D573CD27571EB3001C2D8C"
BlueprintIdentifier = "98712FA02B2BB15E005163D4"
BuildableName = "CalendarX.app"
BlueprintName = "CalendarX"
ReferencedContainer = "container:CalendarX.xcodeproj">
Expand All @@ -61,7 +60,7 @@
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "98D573CD27571EB3001C2D8C"
BlueprintIdentifier = "98712FA02B2BB15E005163D4"
BuildableName = "CalendarX.app"
BlueprintName = "CalendarX"
ReferencedContainer = "container:CalendarX.xcodeproj">
Expand Down
7 changes: 1 addition & 6 deletions CalendarX/CalendarX.entitlements
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.security.application-groups</key>
<array>
<string>group.com.alpha.calendarx</string>
</array>
</dict>
<dict/>
</plist>
13 changes: 9 additions & 4 deletions CalendarX/CalendarXApp.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
//

import SwiftUI

import CalendarXShared

@main
struct CalendarXApp: App {
Expand All @@ -15,9 +15,11 @@ struct CalendarXApp: App {
private var delegate

init() {

LaunchHelper.migrateIfNeeded()
EventHelper.start()
CalendarPreference.check()
Updater.start()

}

var body: some Scene {
Expand All @@ -32,17 +34,20 @@ class CalendarXDelegate: NSObject & NSApplicationDelegate {
lazy var rootView = RootView()
lazy var popover = MenubarPopover(rootView)
lazy var controller = MenubarController(popover)

func applicationWillFinishLaunching(_ notification: Notification) {

NSRunningApplication
.runningApplications(withBundleIdentifier: AppInfo.identifier)
.runningApplications(withBundleIdentifier: AppBundle.identifier)
.filter { $0.isFinishedLaunching }
.forEach { $0.terminate() }

}

func applicationDidFinishLaunching(_ notification: Notification) {
_ = controller
}


}

3 changes: 2 additions & 1 deletion CalendarX/Component/RotationArrow.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ struct RotationArrow: View {
var isPresented: Bool
var body: some View {
Image.rightArrow
.foregroundColor(.secondary)
.font(.title3)
.appForeground(.appSecondary)
.rotationEffect(.degrees(isPresented ? 90 : 0))
.animation(.spring(), value: isPresented)
}
Expand Down
2 changes: 1 addition & 1 deletion CalendarX/Component/RowTitleView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ struct RowTitleView: View {
Text(title)
.font(font)
.frame(maxWidth: .infinity, alignment: .leading)
.foregroundColor(font != .none ? .primary: .secondary)
.appForeground(font != .none ? .appPrimary: .appSecondary)
}

}
19 changes: 9 additions & 10 deletions CalendarX/Component/ScacleButton.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
//

import SwiftUI

import CalendarXShared

struct ScacleButton<Label: View>: View {
let action: VoidClosure
Expand All @@ -22,17 +22,16 @@ struct ScacleButton<Label: View>: View {


struct ScacleImageButton: View {
private let image: Image, scale: Image.Scale, color: Color, action: VoidClosure
init(image: Image, scale: Image.Scale = .medium, color: Color = .secondary, action: @escaping VoidClosure) {
private let image: Image, color: Color, action: VoidClosure

init(image: Image, color: Color = .appSecondary, action: @escaping VoidClosure) {
self.image = image
self.scale = scale
self.color = color
self.action = action
}

var body: some View {
ScacleButton(action: action, label: { image.imageScale(scale).foregroundColor(color) })
ScacleButton(action: action, label: { image.font(.title3).appForeground(color) })
}
}

Expand All @@ -44,8 +43,8 @@ struct ScacleTagButton: View {
.padding(.horizontal, 5)
.padding(.vertical, 5)
.background(Color.tagBackground)
.foregroundColor(.accentColor)
.clipShape(Capsule())
.appForeground(.white)
.clipShape(.capsule)
}
}
}
Expand All @@ -62,8 +61,8 @@ struct ScacleCapsuleButton: View {
.frame(maxWidth: .infinity)
.padding(.vertical, 5)
.background(backgroundColor)
.foregroundColor(foregroundColor)
.clipShape(Capsule())
.appForeground(foregroundColor)
.clipShape(.capsule)
}
}
}
Expand Down
13 changes: 6 additions & 7 deletions CalendarX/Component/ScacleButtonPicker.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
//
import SwiftUI


struct ScacleButtonPicker<Item: Hashable, Label: View, ItemLabel: View>: View {

private let items: [Item]
Expand Down Expand Up @@ -61,26 +60,26 @@ struct ScacleButtonPicker<Item: Hashable, Label: View, ItemLabel: View>: View {
@ViewBuilder
func popoverContent() -> some View {
ScrollViewReader { reader in
ScrollView {
LazyVStack {
ScrollView(showsIndicators: false) {
LazyVGrid(columns: [GridItem(.fixed(width))], spacing: 0) {
ForEach(items, id: \.self) { item in
Button {
selection = item
isPresented.toggle()
} label: {
itemLabel(item)
.foregroundColor(item == selection ? tint:.primary)
.appForeground(item == selection ? tint:.primary)
.lineLimit(1)
.minimumScaleFactor(0.1)
.minimumScaleFactor(0.75)
}
.id(item)
.buttonStyle(.plain)
.frame(minWidth: width, idealHeight: .popoverRowHeight)
.frame(height: .popoverRowHeight)
}
}
.padding(5)
}
.frame(height: min(CGFloat(items.count + 1) * .popoverRowHeight + 10, .popoverHeight))
.frame(height: min(CGFloat(items.count) * .popoverRowHeight + 10, .popoverHeight))
.onAppear { reader.scrollTo(selection) }
}
}
Expand Down
Loading

0 comments on commit 6bf1f5e

Please sign in to comment.