diff options
author | jan Iversen <jani@libreoffice.org> | 2017-10-29 10:45:46 +0100 |
---|---|---|
committer | jan Iversen <jani@libreoffice.org> | 2017-10-29 10:46:58 +0100 |
commit | 82cd9f8efd8cc8fd8e5bafbdaf39c94efda6a030 (patch) | |
tree | 6ecaabedd406101d503a3d6c96827f1886bb392f /ios | |
parent | 351d83c357093ac0ec6d3768355df9ee1b224d02 (diff) |
iOS, document handle sidebar
Change-Id: I4df15312f1174009d7d34b02241c129abc27c0b7
Diffstat (limited to 'ios')
-rwxr-xr-x | ios/LibreOfficeLight/LibreOfficeLight/DocumentController.swift | 56 | ||||
-rwxr-xr-x | ios/LibreOfficeLight/LibreOfficeLight/en.lproj/Main.storyboard | 4 |
2 files changed, 41 insertions, 19 deletions
diff --git a/ios/LibreOfficeLight/LibreOfficeLight/DocumentController.swift b/ios/LibreOfficeLight/LibreOfficeLight/DocumentController.swift index 0190ad946666..39a49d2a01eb 100755 --- a/ios/LibreOfficeLight/LibreOfficeLight/DocumentController.swift +++ b/ios/LibreOfficeLight/LibreOfficeLight/DocumentController.swift @@ -15,14 +15,24 @@ import UIKit // It is a delegate class to recieve Menu events as well as file handling events class DocumentController: UIViewController, MenuDelegate, UIDocumentBrowserViewControllerDelegate { - // Show sidemenu (part of documentcontroller) + // handling of PropertiesController + // The PropertiesController is a left sidebar, that will scroll in when activated + // The Controller handles manipulation of properties in the document + + // Activate/Deactivate PropertiesController (from navigationController, see storyboard) @IBAction func doProperties(_ sender: UIBarButtonItem) { + // Check if deactivation if (sender.tag == 99) { + // Deactivate + + // Mark it as deactivated (it stays loaded) sender.tag = 0; + // get handle of PropertiesController let viewMenuBack : UIView = view.subviews.last! + // Blend out sidebar UIView.animate(withDuration: 0.3, animations: { () -> Void in var frameMenu : CGRect = viewMenuBack.frame frameMenu.origin.x = -1 * UIScreen.main.bounds.size.width @@ -32,27 +42,39 @@ class DocumentController: UIViewController, MenuDelegate, UIDocumentBrowserViewC }, completion: { (finished) -> Void in viewMenuBack.removeFromSuperview() }) - return } - - sender.isEnabled = false - sender.tag = 99 - - let properties : PropertiesController = self.storyboard!.instantiateViewController(withIdentifier: "PropertiesController") as! PropertiesController - view.addSubview(properties.view) - addChildViewController(properties) - properties.view.layoutIfNeeded() - - properties.view.frame=CGRect(x: 0 - UIScreen.main.bounds.size.width, y: 0, width: UIScreen.main.bounds.size.width, height: UIScreen.main.bounds.size.height); - - UIView.animate(withDuration: 0.3, animations: { () -> Void in - properties.view.frame=CGRect(x: 0, y: 0, width: UIScreen.main.bounds.size.width, height: UIScreen.main.bounds.size.height); - sender.isEnabled = true - }, completion:nil) + else { + // Activate + + // Mark as activated + sender.isEnabled = false + sender.tag = 99 + + // make instance of PropertiesController + let prop : PropertiesController = self.storyboard!.instantiateViewController( + withIdentifier: "PropertiesController") as! PropertiesController + view.addSubview(prop.view) + addChildViewController(prop) + prop.view.layoutIfNeeded() + prop.view.frame=CGRect(x: 0 - UIScreen.main.bounds.size.width, + y: 0, + width: UIScreen.main.bounds.size.width, + height: UIScreen.main.bounds.size.height); + + // Blend in sidebar + UIView.animate(withDuration: 0.3, animations: { () -> Void in + prop.view.frame=CGRect(x: 0, + y: 0, + width: UIScreen.main.bounds.size.width, + height: UIScreen.main.bounds.size.height); + sender.isEnabled = true + }, completion:nil) + } } + // Handling of Background (hipernate) public func Hipernate() -> Void { } diff --git a/ios/LibreOfficeLight/LibreOfficeLight/en.lproj/Main.storyboard b/ios/LibreOfficeLight/LibreOfficeLight/en.lproj/Main.storyboard index 81a2b4b5376c..925ce28c9b27 100755 --- a/ios/LibreOfficeLight/LibreOfficeLight/en.lproj/Main.storyboard +++ b/ios/LibreOfficeLight/LibreOfficeLight/en.lproj/Main.storyboard @@ -117,10 +117,10 @@ </objects> <point key="canvasLocation" x="259.19999999999999" y="305.84707646176912"/> </scene> - <!--Sidebar Controller--> + <!--Properties Controller--> <scene sceneID="moB-At-Om8"> <objects> - <viewController storyboardIdentifier="SidebarController" useStoryboardIdentifierAsRestorationIdentifier="YES" id="E9y-3m-fEc" customClass="SidebarController" customModule="LibreOfficeLight" customModuleProvider="target" sceneMemberID="viewController"> + <viewController storyboardIdentifier="PropertiesController" useStoryboardIdentifierAsRestorationIdentifier="YES" id="E9y-3m-fEc" userLabel="Properties Controller" customClass="PropertiesController" customModule="LibreOfficeLight" customModuleProvider="target" sceneMemberID="viewController"> <layoutGuides> <viewControllerLayoutGuide type="top" id="qJv-1E-iEi"/> <viewControllerLayoutGuide type="bottom" id="syI-80-ufe"/> |