From 72fa146d1ca56af0eab9c982276996724e0809a9 Mon Sep 17 00:00:00 2001 From: Satindar Dhillon Date: Sat, 4 Jun 2022 09:14:34 -0700 Subject: [PATCH] style the web prefs sheet --- .../Views/FontSizeAdjustmentPopoverView.swift | 111 ++++++++++-------- 1 file changed, 59 insertions(+), 52 deletions(-) diff --git a/apple/OmnivoreKit/Sources/Views/FontSizeAdjustmentPopoverView.swift b/apple/OmnivoreKit/Sources/Views/FontSizeAdjustmentPopoverView.swift index ce03f2c19..f6c08555d 100644 --- a/apple/OmnivoreKit/Sources/Views/FontSizeAdjustmentPopoverView.swift +++ b/apple/OmnivoreKit/Sources/Views/FontSizeAdjustmentPopoverView.swift @@ -64,8 +64,8 @@ public struct WebPreferencesPopoverView: View { } ) } - .padding() } + .listStyle(.plain) .navigationBarTitleDisplayMode(.inline) } @@ -76,60 +76,67 @@ public struct WebPreferencesPopoverView: View { .foregroundColor(.appGrayText) .font(Font.system(size: 17, weight: .semibold)) - LabelledStepper( - labelText: "Font Size:", - onIncrement: { - storedFontSize = min(storedFontSize + 2, 28) - updateFontAction() - }, - onDecrement: { - storedFontSize = max(storedFontSize - 2, 10) - updateFontAction() - } - ) + Divider() + .padding(.bottom, 6) - if UIDevice.isIPad { - LabelledStepper( - labelText: "Margin:", - onIncrement: { - storedMargin = min(storedMargin + 45, 560) - updateMarginAction() - }, - onDecrement: { - storedMargin = max(storedMargin - 45, 200) - updateMarginAction() + ScrollView(showsIndicators: false) { + VStack { + LabelledStepper( + labelText: "Font Size:", + onIncrement: { + storedFontSize = min(storedFontSize + 2, 28) + updateFontAction() + }, + onDecrement: { + storedFontSize = max(storedFontSize - 2, 10) + updateFontAction() + } + ) + + if UIDevice.isIPad { + LabelledStepper( + labelText: "Margin:", + onIncrement: { + storedMargin = min(storedMargin + 45, 560) + updateMarginAction() + }, + onDecrement: { + storedMargin = max(storedMargin - 45, 200) + updateMarginAction() + } + ) } - ) + + LabelledStepper( + labelText: "Line Spacing:", + onIncrement: { + storedLineSpacing = min(storedLineSpacing + 25, 300) + updateLineHeightAction() + }, + onDecrement: { + storedLineSpacing = max(storedLineSpacing - 25, 100) + updateLineHeightAction() + } + ) + + Toggle("High Contrast Text:", isOn: $prefersHighContrastText) + .frame(height: 40) + .onChange(of: prefersHighContrastText) { _ in + updateTextContrastAction() + } + + HStack { + NavigationLink(destination: fontList) { + Text("Change Reader Font") + } + Image(systemName: "chevron.right") + Spacer() + } + .frame(height: 40) + + Spacer() + } } - - LabelledStepper( - labelText: "Line Spacing:", - onIncrement: { - storedLineSpacing = min(storedLineSpacing + 25, 300) - updateLineHeightAction() - }, - onDecrement: { - storedLineSpacing = max(storedLineSpacing - 25, 100) - updateLineHeightAction() - } - ) - - Toggle("High Contrast Text:", isOn: $prefersHighContrastText) - .frame(height: 40) - .onChange(of: prefersHighContrastText) { _ in - updateTextContrastAction() - } - - HStack { - NavigationLink(destination: fontList) { - Text("Change Reader Font") - } - Image(systemName: "chevron.right") - Spacer() - } - .frame(height: 40) - - Spacer() } .padding() .navigationBarHidden(true)