mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
use zstack to show font adjustment view
This commit is contained in:
parent
997f087635
commit
96a02a3855
1 changed files with 30 additions and 14 deletions
|
|
@ -82,7 +82,7 @@ public struct LinkItemDetailView: View {
|
|||
.scaleEffect(navBarVisibilityRatio)
|
||||
Spacer()
|
||||
Button(
|
||||
action: { showFontSizePopover = true },
|
||||
action: { showFontSizePopover.toggle() },
|
||||
label: {
|
||||
Image(systemName: "textformat.size")
|
||||
.font(.appTitle)
|
||||
|
|
@ -90,25 +90,41 @@ public struct LinkItemDetailView: View {
|
|||
)
|
||||
.padding(.horizontal)
|
||||
.scaleEffect(navBarVisibilityRatio)
|
||||
#if os(iOS)
|
||||
.fittedPopover(isPresented: $showFontSizePopover) {
|
||||
FontSizeAdjustmentPopoverView(
|
||||
increaseFontAction: { viewModel.webAppWrapperViewModel?.sendIncreaseFontSignal = true },
|
||||
decreaseFontAction: { viewModel.webAppWrapperViewModel?.sendDecreaseFontSignal = true }
|
||||
)
|
||||
}
|
||||
#endif
|
||||
}
|
||||
.frame(height: LinkItemDetailView.navBarHeight * navBarVisibilityRatio)
|
||||
.opacity(navBarVisibilityRatio)
|
||||
}
|
||||
if let webAppWrapperViewModel = viewModel.webAppWrapperViewModel {
|
||||
WebAppWrapperView(
|
||||
viewModel: webAppWrapperViewModel,
|
||||
navBarVisibilityRatioUpdater: {
|
||||
navBarVisibilityRatio = $0
|
||||
ZStack {
|
||||
WebAppWrapperView(
|
||||
viewModel: webAppWrapperViewModel,
|
||||
navBarVisibilityRatioUpdater: {
|
||||
navBarVisibilityRatio = $0
|
||||
}
|
||||
)
|
||||
if showFontSizePopover {
|
||||
VStack {
|
||||
HStack {
|
||||
Spacer()
|
||||
FontSizeAdjustmentPopoverView(
|
||||
increaseFontAction: { viewModel.webAppWrapperViewModel?.sendIncreaseFontSignal = true },
|
||||
decreaseFontAction: { viewModel.webAppWrapperViewModel?.sendDecreaseFontSignal = true }
|
||||
)
|
||||
.background(Color.appButtonBackground)
|
||||
.cornerRadius(8)
|
||||
.padding(.trailing, 5)
|
||||
}
|
||||
Spacer()
|
||||
}
|
||||
.background(
|
||||
Color.clear
|
||||
.contentShape(Rectangle())
|
||||
.onTapGesture {
|
||||
showFontSizePopover = false
|
||||
}
|
||||
)
|
||||
}
|
||||
)
|
||||
}
|
||||
} else {
|
||||
Spacer()
|
||||
.onAppear {
|
||||
|
|
|
|||
Loading…
Reference in a new issue