refactored to use new spacer extension
Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
parent
8b9b83791a
commit
43e9642de6
@ -50,24 +50,17 @@ public class TooltipLabelAttribute: ActionLabelAttributeModel, TooltipLaunchable
|
||||
frame = CGRect(x: 0, y: -1, width: size.value.dimensions.width, height: size.value.dimensions.height)
|
||||
}
|
||||
}
|
||||
|
||||
//create the frame in which to hold the icon
|
||||
let spacerframe = CGRect(x: 0, y: 0, width: VDSLayout.Spacing.space1X.value, height: size.value.dimensions.height)
|
||||
|
||||
|
||||
//create the image icon and match the color of the text
|
||||
let tooltipAttribute = ImageLabelAttribute(location: location,
|
||||
imageName: "info",
|
||||
frame: frame,
|
||||
tintColor: imageTintColor)
|
||||
|
||||
let spacerAttribute = ImageLabelAttribute(location: location,
|
||||
imageName: "info",
|
||||
frame: spacerframe,
|
||||
tintColor: .clear)
|
||||
let spacer = NSAttributedString.spacer(for: VDSLayout.Spacing.space1X.value)
|
||||
|
||||
guard let tooltip = try? tooltipAttribute.getAttachment(),
|
||||
let spacer = try? spacerAttribute.getAttachment() else { return }
|
||||
attributedString.append(NSAttributedString(attachment: spacer))
|
||||
guard let tooltip = try? tooltipAttribute.getAttachment() else { return }
|
||||
attributedString.append(spacer)
|
||||
attributedString.append(NSAttributedString(attachment: tooltip))
|
||||
addHandler(on: attributedString)
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user