mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-11-29 11:25:38 +00:00
Various fixes
This commit is contained in:
parent
6566fc1822
commit
3eff8819ff
@ -932,15 +932,9 @@ public func createPollController(context: AccountContext, updatedPresentationDat
|
|||||||
weak var currentTooltipController: TooltipController?
|
weak var currentTooltipController: TooltipController?
|
||||||
let controller = CreatePollControllerImpl(context: context, state: signal)
|
let controller = CreatePollControllerImpl(context: context, state: signal)
|
||||||
controller.navigationPresentation = .modal
|
controller.navigationPresentation = .modal
|
||||||
// controller.visibleBottomContentOffsetChanged = { [weak controller] offset in
|
controller.visibleBottomContentOffsetChanged = { [weak controller] _ in
|
||||||
// switch offset {
|
controller?.updateTabBarAlpha(1.0, .immediate)
|
||||||
// case let .known(value):
|
}
|
||||||
// let backgroundAlpha: CGFloat = min(30.0, value) / 30.0
|
|
||||||
// controller?.updateTabBarAlpha(backgroundAlpha, .immediate)
|
|
||||||
// case .unknown, .none:
|
|
||||||
// controller?.updateTabBarAlpha(1.0, .immediate)
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
presentControllerImpl = { [weak controller] c, a in
|
presentControllerImpl = { [weak controller] c, a in
|
||||||
controller?.present(c, in: .window(.root), with: a)
|
controller?.present(c, in: .window(.root), with: a)
|
||||||
}
|
}
|
||||||
|
|||||||
@ -378,6 +378,7 @@ public func makeDefaultDarkPresentationTheme(extendingThemeReference: Presentati
|
|||||||
blocksBackgroundColor: UIColor(rgb: 0x000000),
|
blocksBackgroundColor: UIColor(rgb: 0x000000),
|
||||||
modalBlocksBackgroundColor: UIColor(rgb: 0x1c1c1d),
|
modalBlocksBackgroundColor: UIColor(rgb: 0x1c1c1d),
|
||||||
plainBackgroundColor: UIColor(rgb: 0x000000),
|
plainBackgroundColor: UIColor(rgb: 0x000000),
|
||||||
|
modalPlainBackgroundColor: UIColor(rgb: 0x1c1c1d),
|
||||||
itemPrimaryTextColor: UIColor(rgb: 0xffffff),
|
itemPrimaryTextColor: UIColor(rgb: 0xffffff),
|
||||||
itemSecondaryTextColor: UIColor(rgb: 0x98989e),
|
itemSecondaryTextColor: UIColor(rgb: 0x98989e),
|
||||||
itemDisabledTextColor: UIColor(rgb: 0x8f8f8f),
|
itemDisabledTextColor: UIColor(rgb: 0x8f8f8f),
|
||||||
|
|||||||
@ -606,6 +606,7 @@ public func makeDefaultDarkTintedPresentationTheme(extendingThemeReference: Pres
|
|||||||
blocksBackgroundColor: additionalBackgroundColor,
|
blocksBackgroundColor: additionalBackgroundColor,
|
||||||
modalBlocksBackgroundColor: additionalBackgroundColor,
|
modalBlocksBackgroundColor: additionalBackgroundColor,
|
||||||
plainBackgroundColor: additionalBackgroundColor,
|
plainBackgroundColor: additionalBackgroundColor,
|
||||||
|
modalPlainBackgroundColor: mainBackgroundColor,
|
||||||
itemPrimaryTextColor: UIColor(rgb: 0xffffff),
|
itemPrimaryTextColor: UIColor(rgb: 0xffffff),
|
||||||
itemSecondaryTextColor: mainSecondaryTextColor.withAlphaComponent(0.5),
|
itemSecondaryTextColor: mainSecondaryTextColor.withAlphaComponent(0.5),
|
||||||
itemDisabledTextColor: mainSecondaryTextColor.withAlphaComponent(0.5),
|
itemDisabledTextColor: mainSecondaryTextColor.withAlphaComponent(0.5),
|
||||||
|
|||||||
@ -449,6 +449,7 @@ public func makeDefaultDayPresentationTheme(extendingThemeReference: Presentatio
|
|||||||
blocksBackgroundColor: UIColor(rgb: 0xefeff4),
|
blocksBackgroundColor: UIColor(rgb: 0xefeff4),
|
||||||
modalBlocksBackgroundColor: UIColor(rgb: 0xefeff4),
|
modalBlocksBackgroundColor: UIColor(rgb: 0xefeff4),
|
||||||
plainBackgroundColor: UIColor(rgb: 0xffffff),
|
plainBackgroundColor: UIColor(rgb: 0xffffff),
|
||||||
|
modalPlainBackgroundColor: UIColor(rgb: 0xffffff),
|
||||||
itemPrimaryTextColor: UIColor(rgb: 0x000000),
|
itemPrimaryTextColor: UIColor(rgb: 0x000000),
|
||||||
itemSecondaryTextColor: UIColor(rgb: 0x8e8e93),
|
itemSecondaryTextColor: UIColor(rgb: 0x8e8e93),
|
||||||
itemDisabledTextColor: UIColor(rgb: 0x8e8e93),
|
itemDisabledTextColor: UIColor(rgb: 0x8e8e93),
|
||||||
|
|||||||
@ -427,8 +427,9 @@ public final class PresentationThemeList {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public let blocksBackgroundColor: UIColor
|
public let blocksBackgroundColor: UIColor
|
||||||
public let plainBackgroundColor: UIColor
|
|
||||||
public let modalBlocksBackgroundColor: UIColor
|
public let modalBlocksBackgroundColor: UIColor
|
||||||
|
public let plainBackgroundColor: UIColor
|
||||||
|
public let modalPlainBackgroundColor: UIColor
|
||||||
public let itemPrimaryTextColor: UIColor
|
public let itemPrimaryTextColor: UIColor
|
||||||
public let itemSecondaryTextColor: UIColor
|
public let itemSecondaryTextColor: UIColor
|
||||||
public let itemDisabledTextColor: UIColor
|
public let itemDisabledTextColor: UIColor
|
||||||
@ -465,6 +466,7 @@ public final class PresentationThemeList {
|
|||||||
blocksBackgroundColor: UIColor,
|
blocksBackgroundColor: UIColor,
|
||||||
modalBlocksBackgroundColor: UIColor,
|
modalBlocksBackgroundColor: UIColor,
|
||||||
plainBackgroundColor: UIColor,
|
plainBackgroundColor: UIColor,
|
||||||
|
modalPlainBackgroundColor: UIColor,
|
||||||
itemPrimaryTextColor: UIColor,
|
itemPrimaryTextColor: UIColor,
|
||||||
itemSecondaryTextColor: UIColor,
|
itemSecondaryTextColor: UIColor,
|
||||||
itemDisabledTextColor: UIColor,
|
itemDisabledTextColor: UIColor,
|
||||||
@ -500,6 +502,7 @@ public final class PresentationThemeList {
|
|||||||
self.blocksBackgroundColor = blocksBackgroundColor
|
self.blocksBackgroundColor = blocksBackgroundColor
|
||||||
self.modalBlocksBackgroundColor = modalBlocksBackgroundColor
|
self.modalBlocksBackgroundColor = modalBlocksBackgroundColor
|
||||||
self.plainBackgroundColor = plainBackgroundColor
|
self.plainBackgroundColor = plainBackgroundColor
|
||||||
|
self.modalPlainBackgroundColor = modalPlainBackgroundColor
|
||||||
self.itemPrimaryTextColor = itemPrimaryTextColor
|
self.itemPrimaryTextColor = itemPrimaryTextColor
|
||||||
self.itemSecondaryTextColor = itemSecondaryTextColor
|
self.itemSecondaryTextColor = itemSecondaryTextColor
|
||||||
self.itemDisabledTextColor = itemDisabledTextColor
|
self.itemDisabledTextColor = itemDisabledTextColor
|
||||||
@ -533,8 +536,8 @@ public final class PresentationThemeList {
|
|||||||
self.paymentOption = paymentOption
|
self.paymentOption = paymentOption
|
||||||
}
|
}
|
||||||
|
|
||||||
public func withUpdated(blocksBackgroundColor: UIColor? = nil, modalBlocksBackgroundColor: UIColor? = nil, plainBackgroundColor: UIColor? = nil, itemPrimaryTextColor: UIColor? = nil, itemSecondaryTextColor: UIColor? = nil, itemDisabledTextColor: UIColor? = nil, itemAccentColor: UIColor? = nil, itemHighlightedColor: UIColor? = nil, itemDestructiveColor: UIColor? = nil, itemPlaceholderTextColor: UIColor? = nil, itemBlocksBackgroundColor: UIColor? = nil, itemModalBlocksBackgroundColor: UIColor? = nil, itemHighlightedBackgroundColor: UIColor? = nil, itemBlocksSeparatorColor: UIColor? = nil, itemPlainSeparatorColor: UIColor? = nil, disclosureArrowColor: UIColor? = nil, sectionHeaderTextColor: UIColor? = nil, freeTextColor: UIColor? = nil, freeTextErrorColor: UIColor? = nil, freeTextSuccessColor: UIColor? = nil, freeMonoIconColor: UIColor? = nil, itemSwitchColors: PresentationThemeSwitch? = nil, itemDisclosureActions: PresentationThemeItemDisclosureActions? = nil, itemCheckColors: PresentationThemeFillStrokeForeground? = nil, controlSecondaryColor: UIColor? = nil, freeInputField: PresentationInputFieldTheme? = nil, freePlainInputField: PresentationInputFieldTheme? = nil, mediaPlaceholderColor: UIColor? = nil, scrollIndicatorColor: UIColor? = nil, pageIndicatorInactiveColor: UIColor? = nil, inputClearButtonColor: UIColor? = nil, itemBarChart: PresentationThemeItemBarChart? = nil, itemInputField: PresentationInputFieldTheme? = nil, paymentOption: PaymentOption? = nil) -> PresentationThemeList {
|
public func withUpdated(blocksBackgroundColor: UIColor? = nil, modalBlocksBackgroundColor: UIColor? = nil, plainBackgroundColor: UIColor? = nil, modalPlainBackgroundColor: UIColor? = nil, itemPrimaryTextColor: UIColor? = nil, itemSecondaryTextColor: UIColor? = nil, itemDisabledTextColor: UIColor? = nil, itemAccentColor: UIColor? = nil, itemHighlightedColor: UIColor? = nil, itemDestructiveColor: UIColor? = nil, itemPlaceholderTextColor: UIColor? = nil, itemBlocksBackgroundColor: UIColor? = nil, itemModalBlocksBackgroundColor: UIColor? = nil, itemHighlightedBackgroundColor: UIColor? = nil, itemBlocksSeparatorColor: UIColor? = nil, itemPlainSeparatorColor: UIColor? = nil, disclosureArrowColor: UIColor? = nil, sectionHeaderTextColor: UIColor? = nil, freeTextColor: UIColor? = nil, freeTextErrorColor: UIColor? = nil, freeTextSuccessColor: UIColor? = nil, freeMonoIconColor: UIColor? = nil, itemSwitchColors: PresentationThemeSwitch? = nil, itemDisclosureActions: PresentationThemeItemDisclosureActions? = nil, itemCheckColors: PresentationThemeFillStrokeForeground? = nil, controlSecondaryColor: UIColor? = nil, freeInputField: PresentationInputFieldTheme? = nil, freePlainInputField: PresentationInputFieldTheme? = nil, mediaPlaceholderColor: UIColor? = nil, scrollIndicatorColor: UIColor? = nil, pageIndicatorInactiveColor: UIColor? = nil, inputClearButtonColor: UIColor? = nil, itemBarChart: PresentationThemeItemBarChart? = nil, itemInputField: PresentationInputFieldTheme? = nil, paymentOption: PaymentOption? = nil) -> PresentationThemeList {
|
||||||
return PresentationThemeList(blocksBackgroundColor: blocksBackgroundColor ?? self.blocksBackgroundColor, modalBlocksBackgroundColor: modalBlocksBackgroundColor ?? self.modalBlocksBackgroundColor, plainBackgroundColor: plainBackgroundColor ?? self.plainBackgroundColor, itemPrimaryTextColor: itemPrimaryTextColor ?? self.itemPrimaryTextColor, itemSecondaryTextColor: itemSecondaryTextColor ?? self.itemSecondaryTextColor, itemDisabledTextColor: itemDisabledTextColor ?? self.itemDisabledTextColor, itemAccentColor: itemAccentColor ?? self.itemAccentColor, itemHighlightedColor: itemHighlightedColor ?? self.itemHighlightedColor, itemDestructiveColor: itemDestructiveColor ?? self.itemDestructiveColor, itemPlaceholderTextColor: itemPlaceholderTextColor ?? self.itemPlaceholderTextColor, itemBlocksBackgroundColor: itemBlocksBackgroundColor ?? self.itemBlocksBackgroundColor, itemModalBlocksBackgroundColor: itemModalBlocksBackgroundColor ?? self.itemModalBlocksBackgroundColor, itemHighlightedBackgroundColor: itemHighlightedBackgroundColor ?? self.itemHighlightedBackgroundColor, itemBlocksSeparatorColor: itemBlocksSeparatorColor ?? self.itemBlocksSeparatorColor, itemPlainSeparatorColor: itemPlainSeparatorColor ?? self.itemPlainSeparatorColor, disclosureArrowColor: disclosureArrowColor ?? self.disclosureArrowColor, sectionHeaderTextColor: sectionHeaderTextColor ?? self.sectionHeaderTextColor, freeTextColor: freeTextColor ?? self.freeTextColor, freeTextErrorColor: freeTextErrorColor ?? self.freeTextErrorColor, freeTextSuccessColor: freeTextSuccessColor ?? self.freeTextSuccessColor, freeMonoIconColor: freeMonoIconColor ?? self.freeMonoIconColor, itemSwitchColors: itemSwitchColors ?? self.itemSwitchColors, itemDisclosureActions: itemDisclosureActions ?? self.itemDisclosureActions, itemCheckColors: itemCheckColors ?? self.itemCheckColors, controlSecondaryColor: controlSecondaryColor ?? self.controlSecondaryColor, freeInputField: freeInputField ?? self.freeInputField, freePlainInputField: freePlainInputField ?? self.freePlainInputField, mediaPlaceholderColor: mediaPlaceholderColor ?? self.mediaPlaceholderColor, scrollIndicatorColor: scrollIndicatorColor ?? self.scrollIndicatorColor, pageIndicatorInactiveColor: pageIndicatorInactiveColor ?? self.pageIndicatorInactiveColor, inputClearButtonColor: inputClearButtonColor ?? self.inputClearButtonColor, itemBarChart: itemBarChart ?? self.itemBarChart, itemInputField: itemInputField ?? self.itemInputField, paymentOption: paymentOption ?? self.paymentOption)
|
return PresentationThemeList(blocksBackgroundColor: blocksBackgroundColor ?? self.blocksBackgroundColor, modalBlocksBackgroundColor: modalBlocksBackgroundColor ?? self.modalBlocksBackgroundColor, plainBackgroundColor: plainBackgroundColor ?? self.plainBackgroundColor, modalPlainBackgroundColor: modalPlainBackgroundColor ?? self.modalPlainBackgroundColor, itemPrimaryTextColor: itemPrimaryTextColor ?? self.itemPrimaryTextColor, itemSecondaryTextColor: itemSecondaryTextColor ?? self.itemSecondaryTextColor, itemDisabledTextColor: itemDisabledTextColor ?? self.itemDisabledTextColor, itemAccentColor: itemAccentColor ?? self.itemAccentColor, itemHighlightedColor: itemHighlightedColor ?? self.itemHighlightedColor, itemDestructiveColor: itemDestructiveColor ?? self.itemDestructiveColor, itemPlaceholderTextColor: itemPlaceholderTextColor ?? self.itemPlaceholderTextColor, itemBlocksBackgroundColor: itemBlocksBackgroundColor ?? self.itemBlocksBackgroundColor, itemModalBlocksBackgroundColor: itemModalBlocksBackgroundColor ?? self.itemModalBlocksBackgroundColor, itemHighlightedBackgroundColor: itemHighlightedBackgroundColor ?? self.itemHighlightedBackgroundColor, itemBlocksSeparatorColor: itemBlocksSeparatorColor ?? self.itemBlocksSeparatorColor, itemPlainSeparatorColor: itemPlainSeparatorColor ?? self.itemPlainSeparatorColor, disclosureArrowColor: disclosureArrowColor ?? self.disclosureArrowColor, sectionHeaderTextColor: sectionHeaderTextColor ?? self.sectionHeaderTextColor, freeTextColor: freeTextColor ?? self.freeTextColor, freeTextErrorColor: freeTextErrorColor ?? self.freeTextErrorColor, freeTextSuccessColor: freeTextSuccessColor ?? self.freeTextSuccessColor, freeMonoIconColor: freeMonoIconColor ?? self.freeMonoIconColor, itemSwitchColors: itemSwitchColors ?? self.itemSwitchColors, itemDisclosureActions: itemDisclosureActions ?? self.itemDisclosureActions, itemCheckColors: itemCheckColors ?? self.itemCheckColors, controlSecondaryColor: controlSecondaryColor ?? self.controlSecondaryColor, freeInputField: freeInputField ?? self.freeInputField, freePlainInputField: freePlainInputField ?? self.freePlainInputField, mediaPlaceholderColor: mediaPlaceholderColor ?? self.mediaPlaceholderColor, scrollIndicatorColor: scrollIndicatorColor ?? self.scrollIndicatorColor, pageIndicatorInactiveColor: pageIndicatorInactiveColor ?? self.pageIndicatorInactiveColor, inputClearButtonColor: inputClearButtonColor ?? self.inputClearButtonColor, itemBarChart: itemBarChart ?? self.itemBarChart, itemInputField: itemInputField ?? self.itemInputField, paymentOption: paymentOption ?? self.paymentOption)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -815,6 +815,7 @@ extension PresentationThemeList: Codable {
|
|||||||
case blocksBg
|
case blocksBg
|
||||||
case modalBlocksBg
|
case modalBlocksBg
|
||||||
case plainBg
|
case plainBg
|
||||||
|
case modalPlainBg
|
||||||
case primaryText
|
case primaryText
|
||||||
case secondaryText
|
case secondaryText
|
||||||
case disabledText
|
case disabledText
|
||||||
@ -864,6 +865,7 @@ extension PresentationThemeList: Codable {
|
|||||||
blocksBackgroundColor: try decodeColor(values, .blocksBg),
|
blocksBackgroundColor: try decodeColor(values, .blocksBg),
|
||||||
modalBlocksBackgroundColor: try decodeColor(values, .modalBlocksBg, decoder: decoder, fallbackKey: "list.blocksBg"),
|
modalBlocksBackgroundColor: try decodeColor(values, .modalBlocksBg, decoder: decoder, fallbackKey: "list.blocksBg"),
|
||||||
plainBackgroundColor: try decodeColor(values, .plainBg),
|
plainBackgroundColor: try decodeColor(values, .plainBg),
|
||||||
|
modalPlainBackgroundColor: try decodeColor(values, .modalPlainBg, decoder: decoder, fallbackKey: "list.plainBg"),
|
||||||
itemPrimaryTextColor: try decodeColor(values, .primaryText),
|
itemPrimaryTextColor: try decodeColor(values, .primaryText),
|
||||||
itemSecondaryTextColor: try decodeColor(values, .secondaryText),
|
itemSecondaryTextColor: try decodeColor(values, .secondaryText),
|
||||||
itemDisabledTextColor: try decodeColor(values, .disabledText),
|
itemDisabledTextColor: try decodeColor(values, .disabledText),
|
||||||
|
|||||||
@ -310,7 +310,7 @@ public func attachmentFileController(context: AccountContext, updatedPresentatio
|
|||||||
controller.visibleBottomContentOffsetChanged = { [weak controller] offset in
|
controller.visibleBottomContentOffsetChanged = { [weak controller] offset in
|
||||||
switch offset {
|
switch offset {
|
||||||
case let .known(value):
|
case let .known(value):
|
||||||
let backgroundAlpha: CGFloat = min(30.0, max(0.0, value)) / 30.0
|
let backgroundAlpha: CGFloat = min(30.0, max(0.0, value)) / 30.0
|
||||||
if backgroundAlpha.isZero && controller?.delayDisappear == true {
|
if backgroundAlpha.isZero && controller?.delayDisappear == true {
|
||||||
Queue.mainQueue().after(0.25, {
|
Queue.mainQueue().after(0.25, {
|
||||||
controller?.updateTabBarAlpha(backgroundAlpha, .animated(duration: 0.1, curve: .easeInOut))
|
controller?.updateTabBarAlpha(backgroundAlpha, .animated(duration: 0.1, curve: .easeInOut))
|
||||||
@ -320,7 +320,7 @@ public func attachmentFileController(context: AccountContext, updatedPresentatio
|
|||||||
}
|
}
|
||||||
case .unknown, .none:
|
case .unknown, .none:
|
||||||
controller?.updateTabBarAlpha(1.0, .immediate)
|
controller?.updateTabBarAlpha(1.0, .immediate)
|
||||||
controller?.delayDisappear = false
|
controller?.delayDisappear = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
controller.resetForReuseImpl = {
|
controller.resetForReuseImpl = {
|
||||||
|
|||||||
@ -162,7 +162,7 @@ public func generateWebAppThemeParams(_ presentationTheme: PresentationTheme) ->
|
|||||||
var backgroundColor = presentationTheme.list.plainBackgroundColor.rgb
|
var backgroundColor = presentationTheme.list.plainBackgroundColor.rgb
|
||||||
var secondaryBackgroundColor = presentationTheme.list.blocksBackgroundColor.rgb
|
var secondaryBackgroundColor = presentationTheme.list.blocksBackgroundColor.rgb
|
||||||
if presentationTheme.list.blocksBackgroundColor.rgb == presentationTheme.list.plainBackgroundColor.rgb {
|
if presentationTheme.list.blocksBackgroundColor.rgb == presentationTheme.list.plainBackgroundColor.rgb {
|
||||||
backgroundColor = presentationTheme.list.modalBlocksBackgroundColor.rgb
|
backgroundColor = presentationTheme.list.modalPlainBackgroundColor.rgb
|
||||||
secondaryBackgroundColor = presentationTheme.list.plainBackgroundColor.rgb
|
secondaryBackgroundColor = presentationTheme.list.plainBackgroundColor.rgb
|
||||||
}
|
}
|
||||||
return [
|
return [
|
||||||
@ -734,7 +734,7 @@ public final class WebAppController: ViewController, AttachmentContainable {
|
|||||||
var backgroundColor = self.presentationData.theme.list.plainBackgroundColor
|
var backgroundColor = self.presentationData.theme.list.plainBackgroundColor
|
||||||
var secondaryBackgroundColor = self.presentationData.theme.list.blocksBackgroundColor
|
var secondaryBackgroundColor = self.presentationData.theme.list.blocksBackgroundColor
|
||||||
if self.presentationData.theme.list.blocksBackgroundColor.rgb == self.presentationData.theme.list.plainBackgroundColor.rgb {
|
if self.presentationData.theme.list.blocksBackgroundColor.rgb == self.presentationData.theme.list.plainBackgroundColor.rgb {
|
||||||
backgroundColor = self.presentationData.theme.list.modalBlocksBackgroundColor
|
backgroundColor = self.presentationData.theme.list.modalPlainBackgroundColor
|
||||||
secondaryBackgroundColor = self.presentationData.theme.list.plainBackgroundColor
|
secondaryBackgroundColor = self.presentationData.theme.list.plainBackgroundColor
|
||||||
}
|
}
|
||||||
if let headerColorKey = self.headerColorKey {
|
if let headerColorKey = self.headerColorKey {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user