Various fixes

This commit is contained in:
Ilya Laktyushin
2023-01-19 16:14:44 +04:00
parent 50a789e9ed
commit ab9d4748ec
6 changed files with 36 additions and 5 deletions

View File

@@ -167,7 +167,7 @@ final class EntityKeyboardAnimationTopPanelComponent: Component {
itemLayer.layerTintColor = component.theme.list.itemAccentColor.cgColor
}
itemLayer.isVisibleForAnimations = true
itemLayer.isVisibleForAnimations = itemEnvironment.isContentInFocus
}
if itemEnvironment.isExpanded {
@@ -924,11 +924,13 @@ final class EntityKeyboardStaticStickersPanelComponent: Component {
public final class EntityKeyboardTopPanelItemEnvironment: Equatable {
public let isExpanded: Bool
public let isContentInFocus: Bool
public let isHighlighted: Bool
public let highlightedSubgroupId: AnyHashable?
public init(isExpanded: Bool, isHighlighted: Bool, highlightedSubgroupId: AnyHashable?) {
public init(isExpanded: Bool, isContentInFocus: Bool, isHighlighted: Bool, highlightedSubgroupId: AnyHashable?) {
self.isExpanded = isExpanded
self.isContentInFocus = isContentInFocus
self.isHighlighted = isHighlighted
self.highlightedSubgroupId = highlightedSubgroupId
}
@@ -937,6 +939,9 @@ public final class EntityKeyboardTopPanelItemEnvironment: Equatable {
if lhs.isExpanded != rhs.isExpanded {
return false
}
if lhs.isContentInFocus != rhs.isContentInFocus {
return false
}
if lhs.isHighlighted != rhs.isHighlighted {
return false
}
@@ -1798,7 +1803,11 @@ public final class EntityKeyboardTopPanelComponent: Component {
transition: itemTransition,
component: item.content,
environment: {
EntityKeyboardTopPanelItemEnvironment(isExpanded: itemLayout.isExpanded, isHighlighted: self.activeContentItemId == item.id, highlightedSubgroupId: self.activeContentItemId == item.id ? self.activeSubcontentItemId : nil)
EntityKeyboardTopPanelItemEnvironment(
isExpanded: itemLayout.isExpanded,
isContentInFocus: self.environment?.isContentInFocus ?? false,
isHighlighted: self.activeContentItemId == item.id,
highlightedSubgroupId: self.activeContentItemId == item.id ? self.activeSubcontentItemId : nil)
},
containerSize: itemOuterFrame.size
)