mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-23 22:55:00 +00:00
[WIP] UI
This commit is contained in:
@@ -11,6 +11,7 @@ enum RootNavigationLayout {
|
||||
struct ModalContainerLayout {
|
||||
var controllers: [ViewController]
|
||||
var isFlat: Bool
|
||||
var flatReceivesModalTransition: Bool
|
||||
var isStandalone: Bool
|
||||
}
|
||||
|
||||
@@ -26,6 +27,7 @@ func makeNavigationLayout(mode: NavigationControllerMode, layout: ContainerViewL
|
||||
let requiresModal: Bool
|
||||
var beginsModal: Bool = false
|
||||
var isFlat: Bool = false
|
||||
var flatReceivesModalTransition: Bool = false
|
||||
var isStandalone: Bool = false
|
||||
switch controller.navigationPresentation {
|
||||
case .default:
|
||||
@@ -39,6 +41,7 @@ func makeNavigationLayout(mode: NavigationControllerMode, layout: ContainerViewL
|
||||
requiresModal = true
|
||||
beginsModal = true
|
||||
isFlat = true
|
||||
flatReceivesModalTransition = controller.flatReceivesModalTransition
|
||||
case .standaloneModal:
|
||||
requiresModal = true
|
||||
beginsModal = true
|
||||
@@ -68,7 +71,7 @@ func makeNavigationLayout(mode: NavigationControllerMode, layout: ContainerViewL
|
||||
if requiresModal {
|
||||
controller._presentedInModal = true
|
||||
if beginsModal || modalStack.isEmpty || modalStack[modalStack.count - 1].isStandalone {
|
||||
modalStack.append(ModalContainerLayout(controllers: [controller], isFlat: isFlat, isStandalone: isStandalone))
|
||||
modalStack.append(ModalContainerLayout(controllers: [controller], isFlat: isFlat, flatReceivesModalTransition: flatReceivesModalTransition, isStandalone: isStandalone))
|
||||
} else {
|
||||
modalStack[modalStack.count - 1].controllers.append(controller)
|
||||
}
|
||||
@@ -78,7 +81,7 @@ func makeNavigationLayout(mode: NavigationControllerMode, layout: ContainerViewL
|
||||
controller._presentedInModal = true
|
||||
}
|
||||
if modalStack[modalStack.count - 1].isStandalone {
|
||||
modalStack.append(ModalContainerLayout(controllers: [controller], isFlat: isFlat, isStandalone: isStandalone))
|
||||
modalStack.append(ModalContainerLayout(controllers: [controller], isFlat: isFlat, flatReceivesModalTransition: flatReceivesModalTransition, isStandalone: isStandalone))
|
||||
} else {
|
||||
modalStack[modalStack.count - 1].controllers.append(controller)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user