mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-11-07 09:20:08 +00:00
Merge branch 'master' of gitlab.com:peter-iakovlev/telegram-ios
This commit is contained in:
commit
dcdb3a44a7
@ -1 +1 @@
|
|||||||
462c8b20925f8d3f87f0ab82d25d9c2a
|
91204a26a271ccb13c9732b161e1aa0f
|
||||||
|
|||||||
@ -1643,7 +1643,7 @@ extension PresentationThemeInputMediaPanel: Codable {
|
|||||||
panelIconColor: try decodeColor(values, .panelIcon),
|
panelIconColor: try decodeColor(values, .panelIcon),
|
||||||
panelHighlightedIconBackgroundColor: try decodeColor(values, .panelHighlightedIconBg),
|
panelHighlightedIconBackgroundColor: try decodeColor(values, .panelHighlightedIconBg),
|
||||||
panelHighlightedIconColor: panelHighlightedIconColor,
|
panelHighlightedIconColor: panelHighlightedIconColor,
|
||||||
panelContentVibrantOverlayColor: try decodeColor(values, .panelContentVibrantOverlay, fallbackKey: "\(codingPath).panelIcon"),
|
panelContentVibrantOverlayColor: try decodeColor(values, .panelContentVibrantOverlay, fallbackKey: "\(codingPath).stickersSectionText"),
|
||||||
stickersBackgroundColor: try decodeColor(values, .stickersBg),
|
stickersBackgroundColor: try decodeColor(values, .stickersBg),
|
||||||
stickersSectionTextColor: try decodeColor(values, .stickersSectionText),
|
stickersSectionTextColor: try decodeColor(values, .stickersSectionText),
|
||||||
stickersSearchBackgroundColor: try decodeColor(values, .stickersSearchBg),
|
stickersSearchBackgroundColor: try decodeColor(values, .stickersSearchBg),
|
||||||
|
|||||||
@ -586,6 +586,8 @@ private final class GroupHeaderLayer: UIView {
|
|||||||
themeUpdated = true
|
themeUpdated = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let needsVibrancy = !theme.overallDarkAppearance
|
||||||
|
|
||||||
let textOffsetY: CGFloat
|
let textOffsetY: CGFloat
|
||||||
if hasTopSeparator {
|
if hasTopSeparator {
|
||||||
textOffsetY = 9.0
|
textOffsetY = 9.0
|
||||||
@ -668,6 +670,7 @@ private final class GroupHeaderLayer: UIView {
|
|||||||
|
|
||||||
UIGraphicsPopContext()
|
UIGraphicsPopContext()
|
||||||
})?.cgImage
|
})?.cgImage
|
||||||
|
self.tintTextLayer.isHidden = !needsVibrancy
|
||||||
self.currentTextLayout = (title, color, textConstrainedWidth, textSize)
|
self.currentTextLayout = (title, color, textConstrainedWidth, textSize)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -709,6 +712,7 @@ private final class GroupHeaderLayer: UIView {
|
|||||||
if let image = PresentationResourcesChat.chatEntityKeyboardLock(theme, color: .white) {
|
if let image = PresentationResourcesChat.chatEntityKeyboardLock(theme, color: .white) {
|
||||||
tintLockIconLayer.contents = image.cgImage
|
tintLockIconLayer.contents = image.cgImage
|
||||||
tintLockIconLayer.frame = lockIconLayer.frame
|
tintLockIconLayer.frame = lockIconLayer.frame
|
||||||
|
tintLockIconLayer.isHidden = !needsVibrancy
|
||||||
} else {
|
} else {
|
||||||
tintLockIconLayer.contents = nil
|
tintLockIconLayer.contents = nil
|
||||||
}
|
}
|
||||||
@ -774,6 +778,7 @@ private final class GroupHeaderLayer: UIView {
|
|||||||
self.tintSubtitleLayer = tintSubtitleLayer
|
self.tintSubtitleLayer = tintSubtitleLayer
|
||||||
self.tintContentLayer.addSublayer(tintSubtitleLayer)
|
self.tintContentLayer.addSublayer(tintSubtitleLayer)
|
||||||
}
|
}
|
||||||
|
tintSubtitleLayer.isHidden = !needsVibrancy
|
||||||
|
|
||||||
if let updateTintSubtitleContents = updateTintSubtitleContents {
|
if let updateTintSubtitleContents = updateTintSubtitleContents {
|
||||||
tintSubtitleLayer.contents = updateTintSubtitleContents.cgImage
|
tintSubtitleLayer.contents = updateTintSubtitleContents.cgImage
|
||||||
@ -813,6 +818,8 @@ private final class GroupHeaderLayer: UIView {
|
|||||||
self.tintContentLayer.addSublayer(tintClearIconLayer)
|
self.tintContentLayer.addSublayer(tintClearIconLayer)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
tintClearIconLayer.isHidden = !needsVibrancy
|
||||||
|
|
||||||
var clearSize = clearIconLayer.bounds.size
|
var clearSize = clearIconLayer.bounds.size
|
||||||
if updateImage, let image = PresentationResourcesChat.chatInputMediaPanelGridDismissImage(theme, color: theme.chat.inputMediaPanel.panelContentVibrantOverlayColor) {
|
if updateImage, let image = PresentationResourcesChat.chatInputMediaPanelGridDismissImage(theme, color: theme.chat.inputMediaPanel.panelContentVibrantOverlayColor) {
|
||||||
clearSize = image.size
|
clearSize = image.size
|
||||||
@ -895,6 +902,8 @@ private final class GroupHeaderLayer: UIView {
|
|||||||
}
|
}
|
||||||
tintSeparatorLayer.backgroundColor = UIColor.white.cgColor
|
tintSeparatorLayer.backgroundColor = UIColor.white.cgColor
|
||||||
tintSeparatorLayer.frame = CGRect(origin: CGPoint(x: 0.0, y: 0.0), size: CGSize(width: size.width, height: UIScreenPixel))
|
tintSeparatorLayer.frame = CGRect(origin: CGPoint(x: 0.0, y: 0.0), size: CGSize(width: size.width, height: UIScreenPixel))
|
||||||
|
|
||||||
|
tintSeparatorLayer.isHidden = !needsVibrancy
|
||||||
} else {
|
} else {
|
||||||
if let separatorLayer = self.separatorLayer {
|
if let separatorLayer = self.separatorLayer {
|
||||||
self.separatorLayer = separatorLayer
|
self.separatorLayer = separatorLayer
|
||||||
@ -1583,7 +1592,12 @@ public final class EmojiPagerContentComponent: Component {
|
|||||||
|
|
||||||
self.itemsPerRow = max(minItemsPerRow, Int((itemHorizontalSpace + minSpacing) / (self.nativeItemSize + minSpacing)))
|
self.itemsPerRow = max(minItemsPerRow, Int((itemHorizontalSpace + minSpacing) / (self.nativeItemSize + minSpacing)))
|
||||||
|
|
||||||
self.visibleItemSize = self.nativeItemSize
|
//self.itemsPerRow * x + minSpacing * (x - 1) = itemHorizontalSpace
|
||||||
|
//self.itemsPerRow * x + minSpacing * (self.itemsPerRow - 1) = itemHorizontalSpace
|
||||||
|
//x = (itemHorizontalSpace - minSpacing * (self.itemsPerRow - 1)) / self.itemsPerRow
|
||||||
|
let proposedItemSize = floor((itemHorizontalSpace - minSpacing * (CGFloat(self.itemsPerRow) - 1.0)) / CGFloat(self.itemsPerRow))
|
||||||
|
|
||||||
|
self.visibleItemSize = proposedItemSize < self.nativeItemSize ? proposedItemSize : self.nativeItemSize
|
||||||
|
|
||||||
self.horizontalSpacing = floorToScreenPixels((itemHorizontalSpace - self.visibleItemSize * CGFloat(self.itemsPerRow)) / CGFloat(self.itemsPerRow - 1))
|
self.horizontalSpacing = floorToScreenPixels((itemHorizontalSpace - self.visibleItemSize * CGFloat(self.itemsPerRow)) / CGFloat(self.itemsPerRow - 1))
|
||||||
|
|
||||||
@ -3672,6 +3686,12 @@ public final class EmojiPagerContentComponent: Component {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if keyboardChildEnvironment.theme.overallDarkAppearance {
|
||||||
|
if let vibrancyEffectView = self.vibrancyEffectView {
|
||||||
|
self.vibrancyEffectView = nil
|
||||||
|
vibrancyEffectView.removeFromSuperview()
|
||||||
|
}
|
||||||
|
} else {
|
||||||
if self.vibrancyEffectView == nil {
|
if self.vibrancyEffectView == nil {
|
||||||
let style: UIBlurEffect.Style
|
let style: UIBlurEffect.Style
|
||||||
style = .extraLight
|
style = .extraLight
|
||||||
@ -3685,6 +3705,7 @@ public final class EmojiPagerContentComponent: Component {
|
|||||||
}
|
}
|
||||||
vibrancyEffectView.contentView.addSubview(self.mirrorContentScrollView)
|
vibrancyEffectView.contentView.addSubview(self.mirrorContentScrollView)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
self.backgroundView.updateColor(color: keyboardChildEnvironment.theme.chat.inputMediaPanel.backgroundColor, enableBlur: true, forceKeepBlur: false, transition: transition.containedViewLayoutTransition)
|
self.backgroundView.updateColor(color: keyboardChildEnvironment.theme.chat.inputMediaPanel.backgroundColor, enableBlur: true, forceKeepBlur: false, transition: transition.containedViewLayoutTransition)
|
||||||
transition.setFrame(view: self.backgroundView, frame: backgroundFrame)
|
transition.setFrame(view: self.backgroundView, frame: backgroundFrame)
|
||||||
|
|||||||
@ -186,6 +186,13 @@ final class EntityKeyboardBottomPanelComponent: Component {
|
|||||||
let intrinsicHeight: CGFloat = 34.0
|
let intrinsicHeight: CGFloat = 34.0
|
||||||
let height = intrinsicHeight + component.containerInsets.bottom
|
let height = intrinsicHeight + component.containerInsets.bottom
|
||||||
|
|
||||||
|
let accessoryButtonOffset: CGFloat
|
||||||
|
if component.containerInsets.bottom > 0.0 {
|
||||||
|
accessoryButtonOffset = 2.0
|
||||||
|
} else {
|
||||||
|
accessoryButtonOffset = -2.0
|
||||||
|
}
|
||||||
|
|
||||||
let panelEnvironment = environment[PagerComponentPanelEnvironment<EntityKeyboardTopContainerPanelEnvironment>.self].value
|
let panelEnvironment = environment[PagerComponentPanelEnvironment<EntityKeyboardTopContainerPanelEnvironment>.self].value
|
||||||
let activeContentId = panelEnvironment.activeContentId
|
let activeContentId = panelEnvironment.activeContentId
|
||||||
|
|
||||||
@ -217,7 +224,7 @@ final class EntityKeyboardBottomPanelComponent: Component {
|
|||||||
environment: {},
|
environment: {},
|
||||||
containerSize: CGSize(width: .greatestFiniteMagnitude, height: intrinsicHeight)
|
containerSize: CGSize(width: .greatestFiniteMagnitude, height: intrinsicHeight)
|
||||||
)
|
)
|
||||||
leftAccessoryButtonTransition.setFrame(view: leftAccessoryButton.view, frame: CGRect(origin: CGPoint(x: component.containerInsets.left + 2.0, y: 2.0), size: leftAccessoryButtonSize))
|
leftAccessoryButtonTransition.setFrame(view: leftAccessoryButton.view, frame: CGRect(origin: CGPoint(x: component.containerInsets.left + 2.0, y: accessoryButtonOffset), size: leftAccessoryButtonSize))
|
||||||
} else {
|
} else {
|
||||||
self.leftAccessoryButton = nil
|
self.leftAccessoryButton = nil
|
||||||
}
|
}
|
||||||
@ -269,7 +276,7 @@ final class EntityKeyboardBottomPanelComponent: Component {
|
|||||||
environment: {},
|
environment: {},
|
||||||
containerSize: CGSize(width: .greatestFiniteMagnitude, height: intrinsicHeight)
|
containerSize: CGSize(width: .greatestFiniteMagnitude, height: intrinsicHeight)
|
||||||
)
|
)
|
||||||
rightAccessoryButtonTransition.setFrame(view: rightAccessoryButton.view, frame: CGRect(origin: CGPoint(x: availableSize.width - component.containerInsets.right - 2.0 - rightAccessoryButtonSize.width, y: 2.0), size: rightAccessoryButtonSize))
|
rightAccessoryButtonTransition.setFrame(view: rightAccessoryButton.view, frame: CGRect(origin: CGPoint(x: availableSize.width - component.containerInsets.right - 2.0 - rightAccessoryButtonSize.width, y: accessoryButtonOffset), size: rightAccessoryButtonSize))
|
||||||
} else {
|
} else {
|
||||||
self.rightAccessoryButton = nil
|
self.rightAccessoryButton = nil
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user