Skip to content

Commit

Permalink
Update layout of Donation settings pane (fix #1780)
Browse files Browse the repository at this point in the history
  • Loading branch information
1024jp committed Dec 19, 2024
1 parent 51f40e3 commit bf8fcb7
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 19 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,11 @@

- Provide more Unicode information about the selected character in the document inspector.
- Don’t hide the console when the application has gone to the background.
- Optimize file browser’s performance when expanding a folder containing a large number of items.
- Optimize the file browser’s performance when expanding a folder containing a large number of items.
- Improve the trimming of whitespaces in the extracted outline labels.
- Change the syntax highlighting rule to extract strings in the form of “begin-end” string pairs even if one of those is escaped.
- Adjust the editor’s initial scroll position.
- [trivial] Update the layout of the Donation settings pane.


### Fixes
Expand Down
40 changes: 22 additions & 18 deletions CotEditor/Sources/Settings Window/Panes/DonationSettingsView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -252,12 +252,12 @@ private struct OnetimeProductViewStyle: ProductViewStyle {

HStack(alignment: .top, spacing: 10) {
icon
.font(.system(size: 22))
.font(.system(size: 28))
.foregroundStyle(.secondary)
.productIconBorder()
.frame(width: 50, height: 50)
.frame(width: 64, height: 64)

VStack(alignment: .leading, spacing: 1) {
VStack(alignment: .leading, spacing: 0) {
HStack(alignment: .firstTextBaseline, spacing: 4) {
HStack {
Text(product.displayName)
Expand All @@ -270,30 +270,34 @@ private struct OnetimeProductViewStyle: ProductViewStyle {
Stepper(value: $quantity, in: 1...99, label: EmptyView.init)
.accessibilityValue(String(localized: "\(self.quantity) cups", table: "DonationSettings"))
.accessibilityLabel(String(localized: "Quantity", table: "DonationSettings", comment: "accessibility label for item quantity stepper"))
Spacer()
Button((product.price * Decimal(self.quantity)).formatted(product.priceFormatStyle)) {
Task {
do {
_ = try await product.purchase(options: [.quantity(self.quantity)])
} catch {
self.error = error
}
}
}
.monospacedDigit()
.fixedSize()
.contentTransition(.numericText())
.animation(.default, value: self.quantity)
.accessibilitySortPriority(-1)
}

Text(product.description)
.font(.system(size: 12))
.foregroundStyle(.secondary)
.fixedSize(horizontal: false, vertical: true)

Button {
Task {
do {
_ = try await product.purchase(options: [.quantity(self.quantity)])
} catch {
self.error = error
}
}
} label: {
Text((product.price * Decimal(self.quantity)).formatted(product.priceFormatStyle))
.font(.system(size: 11))
}
.monospacedDigit()
.fixedSize()
.padding(.top, 6)
.contentTransition(.numericText())
.animation(.default, value: self.quantity)
}
.accessibilityElement(children: .contain)
}
.frame(maxWidth: .infinity, alignment: .leading)
.alert(error: $error)
}
}
Expand Down

0 comments on commit bf8fcb7

Please sign in to comment.