From 201ae0fde1bace92e8680ec7288472d84037a933 Mon Sep 17 00:00:00 2001 From: Arkadiusz Fal Date: Sat, 19 Nov 2022 15:35:43 +0100 Subject: [PATCH] Fix tool active position --- .../Video Details/VideoDetailsToolbar.swift | 21 +++++++++---------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/Shared/Player/Video Details/VideoDetailsToolbar.swift b/Shared/Player/Video Details/VideoDetailsToolbar.swift index 0db5dbcb..59e4c958 100644 --- a/Shared/Player/Video Details/VideoDetailsToolbar.swift +++ b/Shared/Player/Video Details/VideoDetailsToolbar.swift @@ -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 {