mirror of
https://github.com/yattee/yattee.git
synced 2025-04-28 16:00:33 +05:30
Fix tool active position
This commit is contained in:
parent
57e0356c8e
commit
201ae0fde1
@ -107,17 +107,6 @@ struct VideoDetailsToolbar: View {
|
|||||||
.frame(width: 30, height: 30)
|
.frame(width: 30, height: 30)
|
||||||
.layoutPriority(1)
|
.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,
|
if activeToolID == tool.wrappedValue.id,
|
||||||
playerDetailsPageButtonLabelStyle.text,
|
playerDetailsPageButtonLabelStyle.text,
|
||||||
player.playerSize.width > 450
|
player.playerSize.width > 450
|
||||||
@ -136,6 +125,16 @@ struct VideoDetailsToolbar: View {
|
|||||||
RoundedRectangle(cornerRadius: 10, style: .continuous)
|
RoundedRectangle(cornerRadius: 10, style: .continuous)
|
||||||
.fill(activeToolID == tool.wrappedValue.id ? Color.accentColor : Color.secondary)
|
.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 {
|
var visibleToolsCount: Int {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user