From 1fc0efcfd522bee31a320702335c019b9a5c437f Mon Sep 17 00:00:00 2001 From: Chris Li Date: Thu, 5 Jan 2017 15:06:41 -0500 Subject: [PATCH] toc finished --- Kiwix-iOS/Controller/Main/MainDelegates.swift | 6 +- Kiwix-iOS/Storyboard/Main.storyboard | 85 +++++++++---------- Kiwix-iOS/Storyboard/Welcome.storyboard | 12 ++- Kiwix-iOS/View/Others.swift | 18 ++++ 4 files changed, 72 insertions(+), 49 deletions(-) diff --git a/Kiwix-iOS/Controller/Main/MainDelegates.swift b/Kiwix-iOS/Controller/Main/MainDelegates.swift index 14be85d9..b473a683 100644 --- a/Kiwix-iOS/Controller/Main/MainDelegates.swift +++ b/Kiwix-iOS/Controller/Main/MainDelegates.swift @@ -266,15 +266,15 @@ extension MainController: TableOfContentsDelegate { func configureTOCConstraints() { switch traitCollection.horizontalSizeClass { case .compact: + let toolBarHeight: CGFloat = traitCollection.horizontalSizeClass == .regular ? 0.0 : (traitCollection.verticalSizeClass == .compact ? 32.0 : 44.0) let tocHeight: CGFloat = { guard let controller = tableOfContentsController else {return floor(view.frame.height * 0.4)} let tocContentHeight = controller.tableView.contentSize.height guard controller.headings.count != 0 else {return floor(view.frame.height * 0.4)} - let toolBarHeight: CGFloat = traitCollection.horizontalSizeClass == .regular ? 0.0 : (traitCollection.verticalSizeClass == .compact ? 32.0 : 44.0) - return min(tocContentHeight + toolBarHeight, floor(view.frame.height * 0.65)) + return min(tocContentHeight, floor(view.frame.height * 0.65)) }() tocHeightConstraint.constant = tocHeight - tocTopToSuperViewBottomSpacing.constant = isShowingTableOfContents ? tocHeight : 0.0 + tocTopToSuperViewBottomSpacing.constant = isShowingTableOfContents ? tocHeight + toolBarHeight + 10 : 0.0 case .regular: tocLeadSpacing.constant = isShowingTableOfContents ? 0.0 : 270 default: diff --git a/Kiwix-iOS/Storyboard/Main.storyboard b/Kiwix-iOS/Storyboard/Main.storyboard index 92985fd6..2f759788 100644 --- a/Kiwix-iOS/Storyboard/Main.storyboard +++ b/Kiwix-iOS/Storyboard/Main.storyboard @@ -1,11 +1,12 @@ - + - + + @@ -23,7 +24,7 @@ - + @@ -47,22 +48,22 @@ - + - + - + - + - + - + - + - + @@ -210,14 +206,22 @@ -