mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-02 20:55:48 +00:00
UI Fixes
This commit is contained in:
parent
0f15c05c1a
commit
c73a96845e
@ -46,9 +46,6 @@ public final class ThemePreviewController: ViewController {
|
||||
self.presentationData = context.sharedContext.currentPresentationData.with { $0 }
|
||||
self.presentationTheme.set(.single(previewTheme))
|
||||
|
||||
let titleView = CounterContollerTitleView(theme: self.previewTheme)
|
||||
self.titleView = titleView
|
||||
|
||||
super.init(navigationBarPresentationData: NavigationBarPresentationData(presentationTheme: self.previewTheme, presentationStrings: self.presentationData.strings))
|
||||
|
||||
let themeName: String
|
||||
@ -85,8 +82,9 @@ public final class ThemePreviewController: ViewController {
|
||||
themeName = previewTheme.name.string
|
||||
}
|
||||
|
||||
self.navigationItem.titleView = titleView
|
||||
let titleView = CounterContollerTitleView(theme: self.previewTheme)
|
||||
titleView.title = CounterContollerTitle(title: themeName, counter: " ")
|
||||
self.navigationItem.titleView = titleView
|
||||
|
||||
self.statusBar.statusBarStyle = self.previewTheme.rootController.statusBarStyle.style
|
||||
self.supportedOrientations = ViewControllerSupportedOrientations(regularSize: .all, compactSize: .portrait)
|
||||
|
||||
@ -100,6 +100,7 @@ private func makeDarkPresentationTheme(accentColor: UIColor, baseColor: Presenta
|
||||
)
|
||||
|
||||
let intro = PresentationThemeIntro(
|
||||
statusBarStyle: .white,
|
||||
startButtonColor: accentColor,
|
||||
dotColor: UIColor(rgb: 0x5e5e5e)
|
||||
)
|
||||
|
||||
@ -76,6 +76,7 @@ private func makeDarkPresentationTheme(accentColor: UIColor, baseColor: Presenta
|
||||
)
|
||||
|
||||
let intro = PresentationThemeIntro(
|
||||
statusBarStyle: .white,
|
||||
startButtonColor: accentColor,
|
||||
dotColor: mainSecondaryColor
|
||||
)
|
||||
|
||||
@ -83,6 +83,7 @@ private func makeDefaultDayPresentationTheme(accentColor: UIColor, serviceBackgr
|
||||
)
|
||||
|
||||
let intro = PresentationThemeIntro(
|
||||
statusBarStyle: .black,
|
||||
startButtonColor: UIColor(rgb: 0x2ca5e0),
|
||||
dotColor: UIColor(rgb: 0xd9d9d9)
|
||||
)
|
||||
|
||||
@ -19,10 +19,12 @@ public final class PresentationThemeGradientColors {
|
||||
}
|
||||
|
||||
public final class PresentationThemeIntro {
|
||||
public let statusBarStyle: PresentationThemeStatusBarStyle
|
||||
public let startButtonColor: UIColor
|
||||
public let dotColor: UIColor
|
||||
|
||||
public init(startButtonColor: UIColor, dotColor: UIColor) {
|
||||
public init(statusBarStyle: PresentationThemeStatusBarStyle, startButtonColor: UIColor, dotColor: UIColor) {
|
||||
self.statusBarStyle = statusBarStyle
|
||||
self.startButtonColor = startButtonColor
|
||||
self.dotColor = dotColor
|
||||
}
|
||||
|
||||
@ -237,18 +237,21 @@ extension PresentationThemeGradientColors: Codable {
|
||||
|
||||
extension PresentationThemeIntro: Codable {
|
||||
enum CodingKeys: String, CodingKey {
|
||||
case statusBar
|
||||
case startButton
|
||||
case dot
|
||||
}
|
||||
|
||||
public convenience init(from decoder: Decoder) throws {
|
||||
let values = try decoder.container(keyedBy: CodingKeys.self)
|
||||
self.init(startButtonColor: try decodeColor(values, .startButton),
|
||||
self.init(statusBarStyle: try values.decode(PresentationThemeStatusBarStyle.self, forKey: .statusBar),
|
||||
startButtonColor: try decodeColor(values, .startButton),
|
||||
dotColor: try decodeColor(values, .dot))
|
||||
}
|
||||
|
||||
public func encode(to encoder: Encoder) throws {
|
||||
var values = encoder.container(keyedBy: CodingKeys.self)
|
||||
try values.encode(self.statusBarStyle, forKey: .statusBar)
|
||||
try encodeColor(&values, self.startButtonColor, .startButton)
|
||||
try encodeColor(&values, self.dotColor, .dot)
|
||||
}
|
||||
|
||||
@ -38,7 +38,7 @@ final class AuthorizationSequenceAwaitingAccountResetController: ViewController
|
||||
|
||||
self.supportedOrientations = ViewControllerSupportedOrientations(regularSize: .all, compactSize: .portrait)
|
||||
|
||||
self.statusBar.statusBarStyle = theme.rootController.statusBarStyle.style
|
||||
self.statusBar.statusBarStyle = theme.intro.statusBarStyle.style
|
||||
|
||||
self.attemptNavigation = { _ in
|
||||
return false
|
||||
|
||||
@ -47,7 +47,7 @@ final class AuthorizationSequenceCodeEntryController: ViewController {
|
||||
|
||||
self.hasActiveInput = true
|
||||
|
||||
self.statusBar.statusBarStyle = theme.rootController.statusBarStyle.style
|
||||
self.statusBar.statusBarStyle = theme.intro.statusBarStyle.style
|
||||
|
||||
self.navigationItem.rightBarButtonItem = UIBarButtonItem(title: self.strings.Common_Next, style: .done, target: self, action: #selector(self.nextPressed))
|
||||
|
||||
|
||||
@ -54,7 +54,7 @@ final class AuthorizationSequencePasswordEntryController: ViewController {
|
||||
|
||||
self.hasActiveInput = true
|
||||
|
||||
self.statusBar.statusBarStyle = theme.rootController.statusBarStyle.style
|
||||
self.statusBar.statusBarStyle = theme.intro.statusBarStyle.style
|
||||
|
||||
self.attemptNavigation = { _ in
|
||||
return false
|
||||
|
||||
@ -42,7 +42,7 @@ final class AuthorizationSequencePasswordRecoveryController: ViewController {
|
||||
|
||||
self.hasActiveInput = true
|
||||
|
||||
self.statusBar.statusBarStyle = theme.rootController.statusBarStyle.style
|
||||
self.statusBar.statusBarStyle = theme.intro.statusBarStyle.style
|
||||
|
||||
self.attemptNavigation = { _ in
|
||||
return false
|
||||
|
||||
@ -61,7 +61,7 @@ final class AuthorizationSequencePhoneEntryController: ViewController {
|
||||
|
||||
self.hasActiveInput = true
|
||||
|
||||
self.statusBar.statusBarStyle = theme.rootController.statusBarStyle.style
|
||||
self.statusBar.statusBarStyle = theme.intro.statusBarStyle.style
|
||||
self.attemptNavigation = { _ in
|
||||
return false
|
||||
}
|
||||
|
||||
@ -47,7 +47,7 @@ final class AuthorizationSequenceSignUpController: ViewController {
|
||||
|
||||
self.supportedOrientations = ViewControllerSupportedOrientations(regularSize: .all, compactSize: .portrait)
|
||||
|
||||
self.statusBar.statusBarStyle = self.theme.rootController.statusBarStyle.style
|
||||
self.statusBar.statusBarStyle = theme.intro.statusBarStyle.style
|
||||
|
||||
self.navigationItem.rightBarButtonItem = UIBarButtonItem(title: self.strings.Common_Next, style: .done, target: self, action: #selector(self.nextPressed))
|
||||
|
||||
|
||||
@ -74,7 +74,7 @@ final class AuthorizationSequenceSplashController: ViewController {
|
||||
|
||||
self.supportedOrientations = ViewControllerSupportedOrientations(regularSize: .all, compactSize: .portrait)
|
||||
|
||||
self.statusBar.statusBarStyle = theme.rootController.statusBarStyle.style
|
||||
self.statusBar.statusBarStyle = theme.intro.statusBarStyle.style
|
||||
|
||||
self.controller.startMessaging = { [weak self] in
|
||||
self?.activateLocalization("en")
|
||||
|
||||
@ -157,8 +157,6 @@ final class ChatInfoTitlePanelNode: ChatTitleAccessoryPanelNode {
|
||||
} else {
|
||||
updatedButtons = []
|
||||
}
|
||||
/*case .group:
|
||||
updatedButtons = groupButtons()*/
|
||||
}
|
||||
|
||||
var buttonsUpdated = false
|
||||
@ -182,7 +180,7 @@ final class ChatInfoTitlePanelNode: ChatTitleAccessoryPanelNode {
|
||||
let buttonNode = ChatInfoTitlePanelButtonNode()
|
||||
buttonNode.laysOutHorizontally = false
|
||||
|
||||
buttonNode.setup(text: button.title(interfaceState.strings), color: interfaceState.theme.rootController.navigationBar.accentTextColor, icon: button.icon(interfaceState.theme))
|
||||
buttonNode.setup(text: button.title(interfaceState.strings), color: interfaceState.theme.chat.inputPanel.panelControlAccentColor, icon: button.icon(interfaceState.theme))
|
||||
|
||||
buttonNode.addTarget(self, action: #selector(self.buttonPressed(_:)), forControlEvents: [.touchUpInside])
|
||||
self.addSubnode(buttonNode)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user