From 758f6e75dd4babd49a437aecdf1a796685f925d8 Mon Sep 17 00:00:00 2001 From: Kevin Hermawan <84965338+kevinhermawan@users.noreply.github.com> Date: Mon, 5 Aug 2024 02:10:18 +0700 Subject: [PATCH] fix: text alignment in preferences view (#16) --- Canvas/Views/AppView.swift | 2 +- CoreViews/Sources/CoreViews/Texts/FootnoteText.swift | 11 +++++++---- .../ImagePreferencesModule/ImagePreferencesView.swift | 2 +- .../Subviews/Pickers/ModelPicker.swift | 2 +- .../Subviews/Pickers/NumberPicker.swift | 2 +- .../Subviews/Pickers/QualityPicker.swift | 2 +- .../Subviews/Pickers/SizePicker.swift | 2 +- .../Subviews/Pickers/StylePicker.swift | 2 +- 8 files changed, 14 insertions(+), 11 deletions(-) diff --git a/Canvas/Views/AppView.swift b/Canvas/Views/AppView.swift index dd11a65..1e2fa2d 100644 --- a/Canvas/Views/AppView.swift +++ b/Canvas/Views/AppView.swift @@ -36,7 +36,7 @@ struct AppView: View { var body: some View { NavigationSplitView { AppSidebarView(selection: $selectedSidebar) - .navigationSplitViewColumnWidth(min: 224, ideal: 224) + .navigationSplitViewColumnWidth(min: 256, ideal: 256) } detail: { switch selectedSidebar { case .imageGeneration: diff --git a/CoreViews/Sources/CoreViews/Texts/FootnoteText.swift b/CoreViews/Sources/CoreViews/Texts/FootnoteText.swift index 9012172..13ddf74 100644 --- a/CoreViews/Sources/CoreViews/Texts/FootnoteText.swift +++ b/CoreViews/Sources/CoreViews/Texts/FootnoteText.swift @@ -15,10 +15,13 @@ public struct FootnoteText: View { } public var body: some View { - Text(titleKey) - .foregroundStyle(.secondary) - .frame(maxWidth: .infinity, alignment: .leading) - .font(.callout) + VStack { + Text(titleKey) + .multilineTextAlignment(.leading) + .foregroundStyle(.secondary) + .font(.callout) + } + .frame(maxWidth: .infinity, alignment: .leading) } } diff --git a/ImagePreferencesModule/Sources/ImagePreferencesModule/ImagePreferencesView.swift b/ImagePreferencesModule/Sources/ImagePreferencesModule/ImagePreferencesView.swift index 73d8d84..691dbd6 100644 --- a/ImagePreferencesModule/Sources/ImagePreferencesModule/ImagePreferencesView.swift +++ b/ImagePreferencesModule/Sources/ImagePreferencesModule/ImagePreferencesView.swift @@ -75,7 +75,7 @@ public struct ImagePreferencesView: View { StylePicker(styles, selection: selection) } } - .inspectorColumnWidth(min: 312, ideal: 312) + .inspectorColumnWidth(min: 320, ideal: 320) .onChange(of: modelSelection) { numberSelection = modelSelection.numbers[0] sizeSelection = modelSelection.sizes[0] diff --git a/ImagePreferencesModule/Sources/ImagePreferencesModule/Subviews/Pickers/ModelPicker.swift b/ImagePreferencesModule/Sources/ImagePreferencesModule/Subviews/Pickers/ModelPicker.swift index aeb6b7c..37141b4 100644 --- a/ImagePreferencesModule/Sources/ImagePreferencesModule/Subviews/Pickers/ModelPicker.swift +++ b/ImagePreferencesModule/Sources/ImagePreferencesModule/Subviews/Pickers/ModelPicker.swift @@ -14,7 +14,7 @@ struct ModelPicker: View { var body: some View { Section { - Picker("Select model", selection: $selection) { + Picker("Selected model", selection: $selection) { ForEach(DalleModel.allCases) { model in Text(model.title).tag(model) } diff --git a/ImagePreferencesModule/Sources/ImagePreferencesModule/Subviews/Pickers/NumberPicker.swift b/ImagePreferencesModule/Sources/ImagePreferencesModule/Subviews/Pickers/NumberPicker.swift index 71cb4c5..6e92b20 100644 --- a/ImagePreferencesModule/Sources/ImagePreferencesModule/Subviews/Pickers/NumberPicker.swift +++ b/ImagePreferencesModule/Sources/ImagePreferencesModule/Subviews/Pickers/NumberPicker.swift @@ -19,7 +19,7 @@ struct NumberPicker: View { var body: some View { Section { - Picker("Select number", selection: $selection) { + Picker("Selected number", selection: $selection) { ForEach(numbers, id: \.self) { number in Text(String(number)).tag(number) } diff --git a/ImagePreferencesModule/Sources/ImagePreferencesModule/Subviews/Pickers/QualityPicker.swift b/ImagePreferencesModule/Sources/ImagePreferencesModule/Subviews/Pickers/QualityPicker.swift index 1a63723..75c3432 100644 --- a/ImagePreferencesModule/Sources/ImagePreferencesModule/Subviews/Pickers/QualityPicker.swift +++ b/ImagePreferencesModule/Sources/ImagePreferencesModule/Subviews/Pickers/QualityPicker.swift @@ -20,7 +20,7 @@ struct QualityPicker: View { var body: some View { Section { - Picker("Select quality", selection: $selection) { + Picker("Selected quality", selection: $selection) { ForEach(qualities) { quality in Text(quality.title).tag(quality) } diff --git a/ImagePreferencesModule/Sources/ImagePreferencesModule/Subviews/Pickers/SizePicker.swift b/ImagePreferencesModule/Sources/ImagePreferencesModule/Subviews/Pickers/SizePicker.swift index beb6885..d0ad415 100644 --- a/ImagePreferencesModule/Sources/ImagePreferencesModule/Subviews/Pickers/SizePicker.swift +++ b/ImagePreferencesModule/Sources/ImagePreferencesModule/Subviews/Pickers/SizePicker.swift @@ -20,7 +20,7 @@ struct SizePicker: View { var body: some View { Section { - Picker("Select size", selection: $selection) { + Picker("Selected size", selection: $selection) { ForEach(sizes, id: \.self) { size in Text(size.title).tag(size) } diff --git a/ImagePreferencesModule/Sources/ImagePreferencesModule/Subviews/Pickers/StylePicker.swift b/ImagePreferencesModule/Sources/ImagePreferencesModule/Subviews/Pickers/StylePicker.swift index 4620966..1d41098 100644 --- a/ImagePreferencesModule/Sources/ImagePreferencesModule/Subviews/Pickers/StylePicker.swift +++ b/ImagePreferencesModule/Sources/ImagePreferencesModule/Subviews/Pickers/StylePicker.swift @@ -20,7 +20,7 @@ struct StylePicker: View { var body: some View { Section { - Picker("Select style", selection: $selection) { + Picker("Selected style", selection: $selection) { ForEach(styles) { style in Text(style.title).tag(style) }