Skip to content

Commit

Permalink
Merge pull request #165 from aapis/bugfix/general-bugfixes
Browse files Browse the repository at this point in the history
General bugfixes
  • Loading branch information
aapis authored Aug 10, 2023
2 parents 17330c0 + d4c6c2d commit 97ae4a8
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 18 deletions.
4 changes: 2 additions & 2 deletions DLPrototype.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1342,7 +1342,7 @@
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 133;
CURRENT_PROJECT_VERSION = 134;
DEAD_CODE_STRIPPING = YES;
DEVELOPMENT_ASSET_PATHS = "\"DLPrototype/Preview Content\"";
DEVELOPMENT_TEAM = 6DT7L2N5X6;
Expand Down Expand Up @@ -1377,7 +1377,7 @@
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 133;
CURRENT_PROJECT_VERSION = 134;
DEAD_CODE_STRIPPING = YES;
DEVELOPMENT_ASSET_PATHS = "\"DLPrototype/Preview Content\"";
DEVELOPMENT_TEAM = 6DT7L2N5X6;
Expand Down
3 changes: 1 addition & 2 deletions DLPrototype/Views/Notes/NoteGroup.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ struct NoteGroup: View {
@Environment(\.managedObjectContext) var moc
@EnvironmentObject public var nav: Navigation

@AppStorage("widget.tasks.minimizeAll") private var minimizeAll: Bool = false
@AppStorage("widget.notesearch.minimizeAll") private var minimizeAll: Bool = false

var body: some View {
let colour = Color.fromStored(key.colour ?? Theme.rowColourAsDouble)
Expand Down Expand Up @@ -87,4 +87,3 @@ extension NoteGroup {
minimized = minimizeAll
}
}

14 changes: 10 additions & 4 deletions DLPrototype/Views/Settings/Tabs/TodaySettings.swift
Original file line number Diff line number Diff line change
Expand Up @@ -122,12 +122,13 @@ struct TodaySettings: View {
}

VStack(alignment: .trailing) {
if hasAccess {
if hasAccess && calendars.count > 0 {
Picker("Active calendar", selection: $calendar) {
ForEach(calendars, id: \.self) { item in
Text(item.title).tag(item.tag)
}
}
.onAppear(perform: {print("DERPO HI")})
} else {
Button("Request access to calendar") {
ce.requestAccess({(granted, error) in
Expand All @@ -144,9 +145,14 @@ struct TodaySettings: View {
}

private func onAppear() -> Void {
if hasAccess {
calendars = CoreDataCalendarEvent(moc: moc).getCalendarsForPicker()
}
ce.requestAccess({(granted, error) in
if granted {
calendars = CoreDataCalendarEvent(moc: moc).getCalendarsForPicker()
} else {
print("[error][calendar] No calendar access")
print("[error][calendar] \(error.debugDescription)")
}
})
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ extension JobPickerWidget {
grouped = filtered
} else {
actionOnAppear()
nav.session.job = nil
}
}

Expand Down
14 changes: 6 additions & 8 deletions DLPrototype/Views/Shared/Fancy/FancyTab.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import SwiftUI

struct FancyTab: View {
@State public var tab: Tab
@State public var highlighted: Bool = false

@Binding public var selected: Int

Expand All @@ -32,21 +33,18 @@ struct FancyTab: View {
}
}
Image(systemName: tab.icon)
.foregroundColor(highlighted || selected == tab.id ? .white : .white.opacity(0.8))
}
})
.buttonStyle(.borderless)
.foregroundColor(Color.white)
.help(tab.help)
.frame(width: 50)
.onHover { inside in
if inside {
NSCursor.pointingHand.push()
} else {
NSCursor.pop()
}
}
.useDefaultHover({ inside in highlighted = inside})
}

}

extension FancyTab {
private func setActive(_ index: Int) -> Void {
selected = index
}
Expand Down
2 changes: 1 addition & 1 deletion DLPrototype/Views/Today/LogTable/LogTable.swift
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ struct LogTable: View, Identifiable {

if viewRequiresColumns.contains(.job) {
Group {
ZStack(alignment: .leading) {
ZStack(alignment: .center) {
Theme.headerColour
Text("Job ID")
.padding(10)
Expand Down
4 changes: 4 additions & 0 deletions DLPrototype/Views/Today/LogTable/RowTypes/LogRow.swift
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,10 @@ struct LogRow: View, Identifiable {

if dotIndex != nil {
selectedJob = String(job.prefix(upTo: dotIndex!))

if let jobIdDbl = Double(job) {
nav.session.job = CoreDataJob(moc: moc).byId(jobIdDbl)
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion DLPrototype/Views/Today/Today.swift
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ struct Today: View {
VStack(alignment: .leading) {
ZStack(alignment: .topLeading) {
FancyTextField(
placeholder: nav.session.job != nil ? "Type and hit enter to create a record" : "Choose a job from the jobs sidebar widget first",
placeholder: nav.session.job != nil ? "Type and hit enter to create a record" : "Choose a job from the recent jobs list in the sidebar",
lineLimit: 6,
onSubmit: submitAction,
fgColour: nav.session.job != nil ? Color.fromStored(nav.session.job!.colour!).isBright() ? .black : .white : .white,
Expand Down

0 comments on commit 97ae4a8

Please sign in to comment.