|
|
@@ -330,7 +330,7 @@ final class ViewController: NSViewController {
|
|
|
private var schedulePageToDate: Date = Calendar.current.startOfDay(for: Date())
|
|
|
private var schedulePageFilteredMeetings: [ScheduledMeeting] = []
|
|
|
private var schedulePageVisibleCount: Int = 0
|
|
|
- private let schedulePageBatchSize: Int = 20
|
|
|
+ private let schedulePageBatchSize: Int = 6
|
|
|
private let schedulePageCardsPerRow: Int = 3
|
|
|
private let schedulePageCardSpacing: CGFloat = 20
|
|
|
private let schedulePageCardHeight: CGFloat = 182
|
|
|
@@ -4341,6 +4341,10 @@ private extension ViewController {
|
|
|
scheduleConnectClicked()
|
|
|
}
|
|
|
|
|
|
+ @objc func schedulePageLoadMorePressed(_ sender: NSButton) {
|
|
|
+ appendSchedulePageBatchIfNeeded()
|
|
|
+ }
|
|
|
+
|
|
|
private func scheduleInitialHeadingText() -> String {
|
|
|
googleOAuth.loadTokens() == nil ? "Connect Google to see meetings" : "Loading…"
|
|
|
}
|
|
|
@@ -4626,8 +4630,33 @@ private extension ViewController {
|
|
|
}
|
|
|
|
|
|
if schedulePageVisibleCount < schedulePageFilteredMeetings.count {
|
|
|
- let moreLabel = textLabel("Scroll to load more (\(schedulePageVisibleCount)/\(schedulePageFilteredMeetings.count))", font: NSFont.systemFont(ofSize: 12, weight: .medium), color: palette.textMuted)
|
|
|
- stack.addArrangedSubview(moreLabel)
|
|
|
+ let pagination = NSStackView()
|
|
|
+ pagination.translatesAutoresizingMaskIntoConstraints = false
|
|
|
+ pagination.orientation = .horizontal
|
|
|
+ pagination.alignment = .centerY
|
|
|
+ pagination.spacing = 10
|
|
|
+
|
|
|
+ let moreLabel = textLabel(
|
|
|
+ "Showing \(schedulePageVisibleCount) of \(schedulePageFilteredMeetings.count)",
|
|
|
+ font: NSFont.systemFont(ofSize: 12, weight: .medium),
|
|
|
+ color: palette.textMuted
|
|
|
+ )
|
|
|
+ pagination.addArrangedSubview(moreLabel)
|
|
|
+
|
|
|
+ let spacer = NSView()
|
|
|
+ spacer.translatesAutoresizingMaskIntoConstraints = false
|
|
|
+ spacer.setContentHuggingPriority(.defaultLow, for: .horizontal)
|
|
|
+ pagination.addArrangedSubview(spacer)
|
|
|
+
|
|
|
+ let loadMore = makeSchedulePagePillButton(
|
|
|
+ title: "Load more",
|
|
|
+ action: #selector(schedulePageLoadMorePressed(_:))
|
|
|
+ )
|
|
|
+ loadMore.widthAnchor.constraint(equalToConstant: 118).isActive = true
|
|
|
+ pagination.addArrangedSubview(loadMore)
|
|
|
+
|
|
|
+ stack.addArrangedSubview(pagination)
|
|
|
+ pagination.widthAnchor.constraint(equalTo: stack.widthAnchor).isActive = true
|
|
|
}
|
|
|
}
|
|
|
|