Merge branch 'main' into 4.9.0

This commit is contained in:
1024jp 2024-05-30 21:54:20 +09:00
commit eecd371224
3 changed files with 9 additions and 12 deletions

View File

@ -44,8 +44,8 @@
- Fix an issue that the application crashed by opening the Appearance settings pane when the font the user set did not exist.
- Fix an issue in the syntax editor that the Values pane was missing in the highlighting list in the sidebar.
- Fix an issue in the Save dialog that the file extension disappeared when the user select the Hide Extension option.
- Fix an issue that the font fields in the Appearance settings pane could unnecessary shrunk with specific fonts.
- Fix an issue in the Save dialog that the file extension disappeared when the user selected the Hide Extension option.
- Fix an issue that the font fields in the Appearance settings pane could unnecessarily shrunk with specific fonts.

View File

@ -47,8 +47,9 @@ struct AntialiasingText: NSViewRepresentable {
let nsView = AntialiasingTextField(string: self.text)
nsView.isEditable = false
nsView.isSelectable = false
nsView.frame.size.height = 22
nsView.alignment = .center
nsView.lineBreakMode = .byTruncatingMiddle
nsView.setContentCompressionResistancePriority(.defaultLow, for: .horizontal)
// keep initial field height
nsView.heightAnchor.constraint(equalToConstant: nsView.frame.height).isActive = true
@ -65,12 +66,6 @@ struct AntialiasingText: NSViewRepresentable {
}
func sizeThatFits(_ proposal: ProposedViewSize, nsView: NSTextField, context: Context) -> CGSize? {
proposal.replacingUnspecifiedDimensions()
}
/// Sets whether disables the antialias.
///
/// - Parameter disabled: The antialias state to change.
@ -131,7 +126,7 @@ private final class CenteringTextFieldCell: NSTextFieldCell {
var titleRect = super.titleRect(forBounds: rect)
let titleSize = self.attributedStringValue.size()
titleRect.origin.y = (rect.minY + (rect.height - titleSize.height) / 2).rounded(.down)
titleRect.origin.y = (rect.minY + (rect.height - titleSize.height) / 2).rounded(.up)
titleRect.size.height = rect.height - titleRect.origin.y
return titleRect
@ -156,6 +151,8 @@ private final class CenteringTextFieldCell: NSTextFieldCell {
AntialiasingText("Smooth Text")
.antialiasDisabled(false)
.font(nsFont: NSFont.monospacedSystemFont(ofSize: 8, weight: .regular))
.font(nsFont: .monospacedSystemFont(ofSize: 8, weight: .regular))
AntialiasingText("Very Long Long Long Long Long Long Text")
}.padding()
}

View File

@ -231,6 +231,6 @@ private extension AppearanceMode {
@State var antialias = false
@State var ligature = false
return FontSettingView(data: .constant(Data()), fallback: NSFont.systemFont(ofSize: 0), antialias: $antialias, ligature: $ligature)
return FontSettingView(data: .constant(Data()), fallback: .systemFont(ofSize: 0), antialias: $antialias, ligature: $ligature)
.padding()
}