Skip to content

Commit

Permalink
Adjust layout of accessory views
Browse files Browse the repository at this point in the history
  • Loading branch information
1024jp committed Feb 3, 2025
1 parent f8290e8 commit 71c1102
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ struct CharacterCountOptionsView: View {

var body: some View {

Grid(alignment: .topLeading) {
Grid(alignment: .topLeading, verticalSpacing: 14) {
GridRow {
Text("Whitespace:", tableName: "AdvancedCharacterCount", comment: "label")
.gridColumnAlignment(.trailing)
Expand Down Expand Up @@ -89,7 +89,6 @@ struct CharacterCountOptionsView: View {
.fixedSize()
.accessibilityLabeledPair(role: .content, id: "unit", in: self.accessibility)


Text(self.unit.description)
.foregroundStyle(.secondary)
.controlSize(.small)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
//
// ---------------------------------------------------------------------------
//
// © 2017-2024 1024jp
// © 2017-2025 1024jp
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -96,6 +96,7 @@ struct CustomSurroundView: View {
self.parent?.dismiss(nil)
}
}
.padding(.top, 8)
}
.onAppear {
self.focus = .beginField
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
//
// ---------------------------------------------------------------------------
//
// © 2018-2024 1024jp
// © 2018-2025 1024jp
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -74,6 +74,7 @@ struct CustomTabWidthView: View {
self.parent?.dismiss(nil)
}
}
.padding(.top, 8)
}
.onAppear {
self.focus = .field
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ struct GoToLineView: View {
self.parent?.dismiss(nil)
}
}
.padding(.top, 8)
}
.onAppear {
self.focus = .field
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ struct OpenPanelAccessory: View {
self.model.options.isReadOnly = false
}
}
.padding(.bottom, -4) // negative padding to keep 6 px margin in Form

Toggle(String(localized: "Show invisible files", table: "OpenPanelAccessory", comment: "toggle button label"), isOn: $showsHiddenFiles)
.onChange(of: self.showsHiddenFiles) { (_, newValue) in
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,12 @@ struct PatternSortView: View {
}.padding(.bottom)
}

Grid(alignment: .leadingFirstTextBaseline) {
Grid(alignment: .leadingFirstTextBaseline, verticalSpacing: 14) {
GridRow {
Text("Sort key:", tableName: "PatternSort")
.gridColumnAlignment(.trailing)

VStack(alignment: .leading) {
VStack(alignment: .leading, spacing: 6) {
Picker(selection: $sortKey) {
ForEach(SortKey.allCases, id: \.self) {
Text($0.label)
Expand Down Expand Up @@ -120,7 +120,7 @@ struct PatternSortView: View {
GridRow {
Text("Sort option:", tableName: "PatternSort")

VStack(alignment: .leading, spacing: 6) { // 6 is natural AppKit spacing
VStack(alignment: .leading, spacing: 6) {
Toggle(String(localized: "Ignore case", table: "PatternSort"),
isOn: self.$options.ignoresCase)
Toggle(String(localized: "Respect language rules", table: "PatternSort"),
Expand All @@ -146,6 +146,7 @@ struct PatternSortView: View {
self.parent?.dismiss(nil)
}.disabled(self.error != nil)
}
.padding(.top, 8)
}
.onAppear {
self.validate()
Expand Down Expand Up @@ -222,7 +223,7 @@ struct ColumnSortPatternView: View {

var body: some View {

HStack {
HStack(alignment: .firstTextBaseline) {
LabeledContent(String(localized: "Delimiter:", table: "PatternSort")) {
TextField(text: $pattern.delimiter, prompt: Text(verbatim: ","), label: EmptyView.init)
.frame(width: 32)
Expand Down Expand Up @@ -252,7 +253,7 @@ struct RegularExpressionSortPatternView: View {
GridRow {
Text("Pattern:", tableName: "PatternSort")
.accessibilityLabeledPair(role: .label, id: "pattern", in: self.accessibility)
VStack(alignment: .leading) {
VStack(alignment: .leading, spacing: 6) {
RegexTextField(text: $pattern.searchPattern, prompt: String(localized: "Regular Expression", table: "PatternSort", comment: "placeholder for regular expression pattern field"))
.leadingInset(18)
.overlay(alignment: .leadingLastTextBaseline) {
Expand Down

0 comments on commit 71c1102

Please sign in to comment.