summaryrefslogtreecommitdiffstats
path: root/ios/LibreOfficeLight/LibreOfficeLight/DocumentController.swift
diff options
context:
space:
mode:
Diffstat (limited to 'ios/LibreOfficeLight/LibreOfficeLight/DocumentController.swift')
-rwxr-xr-xios/LibreOfficeLight/LibreOfficeLight/DocumentController.swift56
1 files changed, 39 insertions, 17 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
{
}