Fixes button state on Extension Help View
This commit is contained in:
parent
015ee0a8e0
commit
f4fe19ae90
|
@ -26,22 +26,15 @@ struct EnableExtensionPointHelpView: View {
|
||||||
VStack {
|
VStack {
|
||||||
HStack {
|
HStack {
|
||||||
ForEach(0..<extensionPoints.count, content: { i in
|
ForEach(0..<extensionPoints.count, content: { i in
|
||||||
|
Button(action: {
|
||||||
|
preferencesController?.enableExtensionPointFromSelection(extensionPoints[i])
|
||||||
|
hoveringId = nil
|
||||||
|
}, label: {
|
||||||
Image(nsImage: extensionPoints[i].image)
|
Image(nsImage: extensionPoints[i].image)
|
||||||
.resizable()
|
.resizable()
|
||||||
.frame(width: 20, height: 20, alignment: .center)
|
.frame(width: 20, height: 20, alignment: .center)
|
||||||
.onTapGesture {
|
|
||||||
preferencesController?.enableExtensionPointFromSelection(extensionPoints[i])
|
|
||||||
hoveringId = nil
|
|
||||||
}
|
|
||||||
.onHover(perform: { hovering in
|
|
||||||
if hovering {
|
|
||||||
hoveringId = extensionPoints[i].title
|
|
||||||
} else {
|
|
||||||
hoveringId = nil
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
.scaleEffect(hoveringId == extensionPoints[i].title ? 1.2 : 1)
|
.buttonStyle(PlainButtonStyle())
|
||||||
.shadow(radius: hoveringId == extensionPoints[i].title ? 0.8 : 0)
|
|
||||||
})
|
})
|
||||||
|
|
||||||
if ExtensionPointManager.shared.availableExtensionPointTypes.count == 0 {
|
if ExtensionPointManager.shared.availableExtensionPointTypes.count == 0 {
|
||||||
|
|
Loading…
Reference in New Issue