mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-17 03:40:18 +00:00
Disable effects in dark theme
This commit is contained in:
parent
fe72fde9dc
commit
4d1f0a057f
@ -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
|
||||||
@ -3672,18 +3681,25 @@ public final class EmojiPagerContentComponent: Component {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if self.vibrancyEffectView == nil {
|
if keyboardChildEnvironment.theme.overallDarkAppearance {
|
||||||
let style: UIBlurEffect.Style
|
if let vibrancyEffectView = self.vibrancyEffectView {
|
||||||
style = .extraLight
|
self.vibrancyEffectView = nil
|
||||||
let blurEffect = UIBlurEffect(style: style)
|
vibrancyEffectView.removeFromSuperview()
|
||||||
let vibrancyEffect = UIVibrancyEffect(blurEffect: blurEffect)
|
}
|
||||||
let vibrancyEffectView = UIVisualEffectView(effect: vibrancyEffect)
|
} else {
|
||||||
self.vibrancyEffectView = vibrancyEffectView
|
if self.vibrancyEffectView == nil {
|
||||||
self.backgroundView.addSubview(vibrancyEffectView)
|
let style: UIBlurEffect.Style
|
||||||
for subview in vibrancyEffectView.subviews {
|
style = .extraLight
|
||||||
let _ = subview
|
let blurEffect = UIBlurEffect(style: style)
|
||||||
|
let vibrancyEffect = UIVibrancyEffect(blurEffect: blurEffect)
|
||||||
|
let vibrancyEffectView = UIVisualEffectView(effect: vibrancyEffect)
|
||||||
|
self.vibrancyEffectView = vibrancyEffectView
|
||||||
|
self.backgroundView.addSubview(vibrancyEffectView)
|
||||||
|
for subview in vibrancyEffectView.subviews {
|
||||||
|
let _ = subview
|
||||||
|
}
|
||||||
|
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)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user