|
@@ -5482,6 +5482,11 @@ class ViewController: NSViewController {
|
|
|
meetingsPageView.trailingAnchor.constraint(equalTo: mainContentColumn.trailingAnchor),
|
|
meetingsPageView.trailingAnchor.constraint(equalTo: mainContentColumn.trailingAnchor),
|
|
|
meetingsPageView.bottomAnchor.constraint(equalTo: mainContentColumn.bottomAnchor),
|
|
meetingsPageView.bottomAnchor.constraint(equalTo: mainContentColumn.bottomAnchor),
|
|
|
|
|
|
|
|
|
|
+ widgetsPageView.topAnchor.constraint(equalTo: mainContentColumn.topAnchor),
|
|
|
|
|
+ widgetsPageView.leadingAnchor.constraint(equalTo: mainContentColumn.leadingAnchor),
|
|
|
|
|
+ widgetsPageView.trailingAnchor.constraint(equalTo: mainContentColumn.trailingAnchor),
|
|
|
|
|
+ widgetsPageView.bottomAnchor.constraint(equalTo: mainContentColumn.bottomAnchor),
|
|
|
|
|
+
|
|
|
schedulerRoot.topAnchor.constraint(equalTo: mainContentColumn.topAnchor, constant: 8),
|
|
schedulerRoot.topAnchor.constraint(equalTo: mainContentColumn.topAnchor, constant: 8),
|
|
|
schedulerRoot.leadingAnchor.constraint(equalTo: mainContentColumn.leadingAnchor, constant: 8),
|
|
schedulerRoot.leadingAnchor.constraint(equalTo: mainContentColumn.leadingAnchor, constant: 8),
|
|
|
schedulerRoot.trailingAnchor.constraint(equalTo: mainContentColumn.trailingAnchor, constant: -8),
|
|
schedulerRoot.trailingAnchor.constraint(equalTo: mainContentColumn.trailingAnchor, constant: -8),
|
|
@@ -8127,7 +8132,7 @@ private struct WidgetsRootView: View {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
var body: some View {
|
|
var body: some View {
|
|
|
- VStack(alignment: .leading, spacing: 16) {
|
|
|
|
|
|
|
+ VStack(alignment: .leading, spacing: 18) {
|
|
|
HStack {
|
|
HStack {
|
|
|
VStack(alignment: .leading, spacing: 3) {
|
|
VStack(alignment: .leading, spacing: 3) {
|
|
|
Text("Add Widget to Desktop")
|
|
Text("Add Widget to Desktop")
|
|
@@ -8140,9 +8145,16 @@ private struct WidgetsRootView: View {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
GeometryReader { geo in
|
|
GeometryReader { geo in
|
|
|
- let spacing: CGFloat = 18
|
|
|
|
|
- let rowWidth = variants.reduce(CGFloat(0)) { $0 + $1.previewCardSize.width } + CGFloat(max(variants.count - 1, 0)) * spacing
|
|
|
|
|
- let scale = max(0.40, min(1, (geo.size.width - 28) / max(1, rowWidth)))
|
|
|
|
|
|
|
+ let count = max(variants.count, 1)
|
|
|
|
|
+ let spacing: CGFloat = 24
|
|
|
|
|
+ let baseRowWidth = variants.reduce(CGFloat(0)) { $0 + $1.previewCardSize.width }
|
|
|
|
|
+ let usableWidth = max(1, geo.size.width)
|
|
|
|
|
+ let usableHeight = max(1, geo.size.height)
|
|
|
|
|
+ let maxPreviewHeight = variants.map(\.previewCardSize.height).max() ?? 320
|
|
|
|
|
+ let widthScale = (usableWidth - CGFloat(count - 1) * spacing) / max(1, baseRowWidth)
|
|
|
|
|
+ let heightScale = usableHeight / max(1, maxPreviewHeight)
|
|
|
|
|
+ let scale = max(0.45, min(1.0, min(widthScale, heightScale)))
|
|
|
|
|
+
|
|
|
HStack(alignment: .top, spacing: spacing) {
|
|
HStack(alignment: .top, spacing: spacing) {
|
|
|
ForEach(variants) { variant in
|
|
ForEach(variants) { variant in
|
|
|
WidgetPreviewAddCard(
|
|
WidgetPreviewAddCard(
|
|
@@ -8156,13 +8168,14 @@ private struct WidgetsRootView: View {
|
|
|
}
|
|
}
|
|
|
.frame(maxWidth: .infinity, maxHeight: .infinity, alignment: .topLeading)
|
|
.frame(maxWidth: .infinity, maxHeight: .infinity, alignment: .topLeading)
|
|
|
}
|
|
}
|
|
|
- .frame(height: variants.map(\.previewCardSize.height).max() ?? 320)
|
|
|
|
|
|
|
+ .frame(maxWidth: .infinity, maxHeight: .infinity)
|
|
|
|
|
|
|
|
Text("Tip: Right-click a desktop widget to remove it.")
|
|
Text("Tip: Right-click a desktop widget to remove it.")
|
|
|
.font(.system(size: 12, weight: .medium))
|
|
.font(.system(size: 12, weight: .medium))
|
|
|
.foregroundStyle(secondaryTextColor)
|
|
.foregroundStyle(secondaryTextColor)
|
|
|
}
|
|
}
|
|
|
- .padding(18)
|
|
|
|
|
|
|
+ .padding(22)
|
|
|
|
|
+ .frame(maxWidth: .infinity, maxHeight: .infinity, alignment: .topLeading)
|
|
|
.background(
|
|
.background(
|
|
|
RoundedRectangle(cornerRadius: 18, style: .continuous)
|
|
RoundedRectangle(cornerRadius: 18, style: .continuous)
|
|
|
.fill(colorScheme == .dark ? Color.white.opacity(0.05) : Color.white.opacity(0.93))
|
|
.fill(colorScheme == .dark ? Color.white.opacity(0.05) : Color.white.opacity(0.93))
|
|
@@ -8171,6 +8184,8 @@ private struct WidgetsRootView: View {
|
|
|
RoundedRectangle(cornerRadius: 18, style: .continuous)
|
|
RoundedRectangle(cornerRadius: 18, style: .continuous)
|
|
|
.stroke(colorScheme == .dark ? Color.white.opacity(0.09) : Color.black.opacity(0.08), lineWidth: 1)
|
|
.stroke(colorScheme == .dark ? Color.white.opacity(0.09) : Color.black.opacity(0.08), lineWidth: 1)
|
|
|
)
|
|
)
|
|
|
|
|
+ .padding(.horizontal, 12)
|
|
|
|
|
+ .padding(.vertical, 12)
|
|
|
.overlay(alignment: .top) {
|
|
.overlay(alignment: .top) {
|
|
|
if let toastMessage {
|
|
if let toastMessage {
|
|
|
Text(toastMessage)
|
|
Text(toastMessage)
|