Skip to content

Commit

Permalink
Only show inspector section chevron on hover (#300)
Browse files Browse the repository at this point in the history
  • Loading branch information
pianostringquartet authored Sep 16, 2024
1 parent 18f1a41 commit 322fd4e
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion Stitch/Graph/LayerInspector/LayerInspectorView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@ struct LayerInspectorInputsSectionView: View {
let nodeId: NodeId

@State private var expanded = true
@State private var isHovered = false

var body: some View {
Section(isExpanded: $expanded) {
Expand Down Expand Up @@ -259,15 +260,22 @@ struct LayerInspectorInputsSectionView: View {
.rotation3DEffect(Angle(degrees: rotationZ),
axis: (x: 0, y: 0, z: rotationZ))
.animation(.linear(duration: 0.2), value: rotationZ)
.opacity(self.isHovered ? 1 : 0)

StitchTextView(string: sectionName.rawValue).textCase(nil)
StitchTextView(string: sectionName.rawValue,
font: stitchFont(16))
.textCase(nil)
.bold()
}
// Note: list row insets appear to be the only way to control padding on a list's section headers
.listRowInsets(EdgeInsets(top: 0,
leading: 0,
bottom: 0,
trailing: 0))
.contentShape(Rectangle())
.onHover {
self.isHovered = $0
}
.onTapGesture {
withAnimation {
self.expanded.toggle()
Expand Down

0 comments on commit 322fd4e

Please sign in to comment.