Fix tool active position

This commit is contained in:
Arkadiusz Fal 2022-11-19 15:35:43 +01:00
parent 57e0356c8e
commit 201ae0fde1

View File

@ -107,17 +107,6 @@ struct VideoDetailsToolbar: View {
.frame(width: 30, height: 30)
.layoutPriority(1)
.background(
GeometryReader { proxy in
let frame = proxy.frame(in: .named("toolbarArea"))
Color.clear
.preference(key: RectKey.self, value: frame)
.onPreferenceChange(RectKey.self) { rect in
tool.wrappedValue.toolPostion = rect
}
}
)
if activeToolID == tool.wrappedValue.id,
playerDetailsPageButtonLabelStyle.text,
player.playerSize.width > 450
@ -136,6 +125,16 @@ struct VideoDetailsToolbar: View {
RoundedRectangle(cornerRadius: 10, style: .continuous)
.fill(activeToolID == tool.wrappedValue.id ? Color.accentColor : Color.secondary)
)
.background(
GeometryReader { proxy in
let frame = proxy.frame(in: .named("toolbarArea"))
Color.clear
.preference(key: RectKey.self, value: frame)
.onPreferenceChange(RectKey.self) { rect in
tool.wrappedValue.toolPostion = rect
}
}
)
}
var visibleToolsCount: Int {