drag appearance looks better
parent
f6dd4f0f2c
commit
2de85571af
|
@ -153,26 +153,31 @@ struct RibbonCrown : View {
|
||||||
|
|
||||||
.if(draggedRibbon != nil && draggedRibbon!.id == ribbon.id && isDragging) { $0.overlay(Color(red: 0.1, green: 0.1, blue: 0.1)) }
|
.if(draggedRibbon != nil && draggedRibbon!.id == ribbon.id && isDragging) { $0.overlay(Color(red: 0.1, green: 0.1, blue: 0.1)) }
|
||||||
|
|
||||||
|
.offset(x: 10)
|
||||||
|
|
||||||
Text(ribbon.title)
|
Text(ribbon.title)
|
||||||
.foregroundColor(Color(UIColor(red: 0.76, green: 0.76, blue: 0.76, alpha: 1.00)))
|
.foregroundColor(Color(UIColor(red: 0.76, green: 0.76, blue: 0.76, alpha: 1.00)))
|
||||||
// .foregroundColor(.white))
|
// .foregroundColor(.white))
|
||||||
// .foregroundColor(.black)
|
// .foregroundColor(.black)
|
||||||
.frame(minWidth: CGFloat(70), maxWidth: CGFloat(70), minHeight: height, maxHeight: height, alignment: .center)
|
.frame(minWidth: CGFloat(70), maxWidth: CGFloat(70), minHeight: height, maxHeight: height, alignment: .center)
|
||||||
|
|
||||||
|
|
||||||
.if(draggedRibbon != nil && draggedRibbon!.id == ribbon.id && isDragging) { $0.overlay(Color(red: 0.1, green: 0.1, blue: 0.1)) }
|
.if(draggedRibbon != nil && draggedRibbon!.id == ribbon.id && isDragging) { $0.overlay(Color(red: 0.1, green: 0.1, blue: 0.1)) }
|
||||||
|
|
||||||
// .if(!isDragging || draggedRibbon == nil || draggedRibbon!.id != ribbon.id) { $0.background(Color(red: 0.1, green: 0.1, blue: 0.1)) }
|
// .if(!isDragging || draggedRibbon == nil || draggedRibbon!.id != ribbon.id) { $0.background(Color(red: 0.1, green: 0.1, blue: 0.1)) }
|
||||||
// .if(draggedRibbon != nil && draggedRibbon!.id == ribbon.id) { $0.background(.red) }
|
// .if(draggedRibbon != nil && draggedRibbon!.id == ribbon.id) { $0.background(.red) }
|
||||||
.background(Color(red: 0.1, green: 0.1, blue: 0.1))
|
.background(Color(red: 0.1, green: 0.1, blue: 0.1))
|
||||||
|
.offset(x: 10)
|
||||||
// .background(Color(red: 0.1, green: 0.1, blue: 0.1))
|
// .background(Color(red: 0.1, green: 0.1, blue: 0.1))
|
||||||
// .background(.red)
|
// .background(.red)
|
||||||
// .background(.yellow)
|
// .background(.yellow)
|
||||||
.multilineTextAlignment(.center)
|
.multilineTextAlignment(.center)
|
||||||
// .minimumScaleFactor(0.5)
|
// .minimumScaleFactor(0.5)
|
||||||
.padding([.top, .bottom], 10)
|
// .padding([.top, .bottom], 10)
|
||||||
.font(Font.custom("AveriaSerifLibre-Regular", size: CGFloat(10)))
|
.font(Font.custom("AveriaSerifLibre-Regular", size: CGFloat(10)))
|
||||||
|
|
||||||
}
|
}
|
||||||
|
.frame(width: CGFloat(100 * 1.66 * scale + 10 ), height:CGFloat(100 * scale + 5))
|
||||||
|
|
||||||
// Text(ribbon.title)
|
// Text(ribbon.title)
|
||||||
// .foregroundColor(Color(UIColor(red: 0.76, green: 0.76, blue: 0.76, alpha: 1.00)))
|
// .foregroundColor(Color(UIColor(red: 0.76, green: 0.76, blue: 0.76, alpha: 1.00)))
|
||||||
|
@ -397,6 +402,7 @@ struct ContentView: View {
|
||||||
draggedRibbon: draggedRibbon,
|
draggedRibbon: draggedRibbon,
|
||||||
isDragging: isDragging
|
isDragging: isDragging
|
||||||
)
|
)
|
||||||
|
// .offset(x: 6, y: 6)
|
||||||
.onDrag {
|
.onDrag {
|
||||||
self.draggedRibbon = ribbon
|
self.draggedRibbon = ribbon
|
||||||
return NSItemProvider()
|
return NSItemProvider()
|
||||||
|
@ -926,6 +932,7 @@ struct DropViewDelegate2: DropDelegate {
|
||||||
}
|
}
|
||||||
|
|
||||||
func performDrop(info: DropInfo) -> Bool {
|
func performDrop(info: DropInfo) -> Bool {
|
||||||
|
isDragging = false
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue