Update list editing icons

This commit is contained in:
Peter Iakovlev 2018-12-20 15:53:39 +04:00
parent 90b2c8761c
commit f65369f308
9 changed files with 49 additions and 21 deletions

View File

@ -0,0 +1,22 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "ic_addoption@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "ic_addoption@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

@ -0,0 +1,22 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "ic_deleteotion@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "ic_deleteotion@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

@ -420,7 +420,8 @@ public func createPollController(account: Account, peerId: PeerId, completion: @
}
return false
})
} else {
}
if resultItemNode == nil {
let _ = controller.frameForItemNode({ itemNode in
if let itemNode = itemNode as? ItemListItemNode {
if let tag = itemNode.tag, tag.isEqual(to: CreatePollEntryTag.option(id)) {

View File

@ -72,15 +72,7 @@ struct PresentationResourcesItemList {
static func itemListDeleteIndicatorIcon(_ theme: PresentationTheme) -> UIImage? {
return theme.image(PresentationResourceKey.itemListDeleteIndicatorIcon.rawValue, { theme in
generateImage(CGSize(width: 22.0, height: 26.0), contextGenerator: { size, context in
context.clear(CGRect(origin: CGPoint(), size: size))
context.setFillColor(UIColor(white: 0.0, alpha: 0.06).cgColor)
context.fillEllipse(in: CGRect(origin: CGPoint(x: 0.0, y: 0.0), size: CGSize(width: 22.0, height: 22.0)))
context.setFillColor(theme.list.itemDisclosureActions.destructive.fillColor.cgColor)
context.fillEllipse(in: CGRect(origin: CGPoint(x: 0.0, y: 2.0), size: CGSize(width: 22.0, height: 22.0)))
context.setFillColor(theme.list.itemDisclosureActions.destructive.foregroundColor.cgColor)
context.fill(CGRect(origin: CGPoint(x: floorToScreenPixels((size.width - 11.0) / 2.0), y: 2.0 + floorToScreenPixels((size.width - 1.0) / 2.0)), size: CGSize(width: 11.0, height: 1.0)))
})
return generateTintedImage(image: UIImage(bundleImageName: "Item List/RemoveItemIcon"), color: theme.list.itemDestructiveColor)
})
}
@ -111,16 +103,7 @@ struct PresentationResourcesItemList {
static func addPhoneIcon(_ theme: PresentationTheme) -> UIImage? {
return theme.image(PresentationResourceKey.itemListAddPhoneIcon.rawValue, { theme in
generateImage(CGSize(width: 22.0, height: 26.0), contextGenerator: { size, context in
context.clear(CGRect(origin: CGPoint(), size: size))
context.setFillColor(UIColor(white: 0.0, alpha: 0.06).cgColor)
context.fillEllipse(in: CGRect(origin: CGPoint(x: 0.0, y: 0.0), size: CGSize(width: 22.0, height: 22.0)))
context.setFillColor(theme.list.itemDisclosureActions.constructive.fillColor.cgColor)
context.fillEllipse(in: CGRect(origin: CGPoint(x: 0.0, y: 2.0), size: CGSize(width: 22.0, height: 22.0)))
context.setFillColor(theme.list.itemDisclosureActions.constructive.foregroundColor.cgColor)
context.fill(CGRect(origin: CGPoint(x: floorToScreenPixels((size.width - 11.0) / 2.0), y: 2.0 + floorToScreenPixels((size.width - 1.0) / 2.0)), size: CGSize(width: 11.0, height: 1.0)))
context.fill(CGRect(origin: CGPoint(x: floorToScreenPixels((size.width - 1.0) / 2.0), y: 2.0 + floorToScreenPixels((size.width - 11.0) / 2.0)), size: CGSize(width: 1.0, height: 11.0)))
})
return generateTintedImage(image: UIImage(bundleImageName: "Item List/AddItemIcon"), color: theme.list.itemAccentColor)
})
}

View File

@ -168,7 +168,7 @@ class UserInfoEditingPhoneActionItemNode: ListViewItemNode {
strongSelf.bottomStripeNode.frame = CGRect(origin: CGPoint(x: leftInset, y: contentSize.height - separatorHeight), size: CGSize(width: params.width - leftInset, height: separatorHeight))
if let iconImage = iconImage {
strongSelf.iconNode.frame = CGRect(origin: CGPoint(x: leftInset, y: floor((layout.contentSize.height - iconImage.size.height) / 2.0) - 1.0), size: iconImage.size)
strongSelf.iconNode.frame = CGRect(origin: CGPoint(x: leftInset, y: floor((layout.contentSize.height - iconImage.size.height) / 2.0)), size: iconImage.size)
}
strongSelf.titleNode.frame = CGRect(origin: CGPoint(x: leftInset + 30.0, y: 12.0), size: titleLayout.size)