Skip to content

Commit

Permalink
- Fixes and improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
glushchenko committed Jul 14, 2024
1 parent d6dbe92 commit 702fa82
Show file tree
Hide file tree
Showing 7 changed files with 141 additions and 126 deletions.
16 changes: 16 additions & 0 deletions FSNotes iOS/ViewController+More.swift
Original file line number Diff line number Diff line change
Expand Up @@ -510,6 +510,8 @@ extension ViewController: UIDocumentPickerDelegate {
items.append(UIBarButtonItem.flexibleSpace())
items.append(UIBarButtonItem(image: moveImage, style: .plain, target: self, action: #selector(moveNotes)))
toolbarItems = items

hideNewButton()
}

navigationController?.toolbar.tintColor = UIColor.mainTheme
Expand All @@ -518,6 +520,14 @@ extension ViewController: UIDocumentPickerDelegate {
}
}

public func hideNewButton() {
getButton(tag: 1)?.isHidden = true
}

public func showNewButton() {
getButton(tag: 1)?.isHidden = false
}

public func configureSidebarNavMenu() {
if let sidebarItem = UIApplication.getVC().lastSidebarItem {
configureNavMenu(for: sidebarItem)
Expand All @@ -530,6 +540,7 @@ extension ViewController: UIDocumentPickerDelegate {
notesTable.turnOffEditing()

configureSidebarNavMenu()
showNewButton()

navigationController?.setToolbarHidden(true, animated: true)
}
Expand All @@ -540,6 +551,7 @@ extension ViewController: UIDocumentPickerDelegate {
notesTable.turnOffEditing()

configureSidebarNavMenu()
showNewButton()

navigationController?.setToolbarHidden(true, animated: true)
}
Expand All @@ -550,6 +562,7 @@ extension ViewController: UIDocumentPickerDelegate {
notesTable.turnOffEditing()

configureSidebarNavMenu()
showNewButton()

navigationController?.setToolbarHidden(true, animated: true)
}
Expand All @@ -560,6 +573,7 @@ extension ViewController: UIDocumentPickerDelegate {
notesTable.turnOffEditing()

configureSidebarNavMenu()
showNewButton()

navigationController?.setToolbarHidden(true, animated: true)
}
Expand All @@ -570,6 +584,8 @@ extension ViewController: UIDocumentPickerDelegate {
configureSidebarNavMenu()

navigationController?.setToolbarHidden(true, animated: true)

showNewButton()
}

private func createFolder(selectedProject: Project?) {
Expand Down
4 changes: 2 additions & 2 deletions FSNotes iOS/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -452,9 +452,9 @@ class ViewController: UIViewController, UISearchBarDelegate, UIGestureRecognizer

let projectsLoading = Date()
let results = storage.getProjectDiffs()
storage.loadNotesCloudPins()

OperationQueue.main.addOperation {
storage.loadNotesCloudPins()
self.sidebarTableView.removeRows(projects: results.0)
self.sidebarTableView.insertRows(projects: results.1)
}
Expand Down Expand Up @@ -1031,7 +1031,7 @@ class ViewController: UIViewController, UISearchBarDelegate, UIGestureRecognizer
self.view.addSubview(button)
}

private func getButton(tag: Int) -> UIButton? {
public func getButton(tag: Int) -> UIButton? {
for sub in self.view.subviews {

if sub.tag == tag {
Expand Down
4 changes: 2 additions & 2 deletions FSNotes.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -4557,7 +4557,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 632;
CURRENT_PROJECT_VERSION = 633;
DEVELOPMENT_TEAM = 866P6MTE92;
EMBED_ASSET_PACKS_IN_PRODUCT_BUNDLE = YES;
ENABLE_HARDENED_RUNTIME = YES;
Expand Down Expand Up @@ -4597,7 +4597,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 632;
CURRENT_PROJECT_VERSION = 633;
DEPLOYMENT_LOCATION = NO;
DEVELOPMENT_TEAM = 866P6MTE92;
EMBED_ASSET_PACKS_IN_PRODUCT_BUNDLE = YES;
Expand Down
Loading

0 comments on commit 702fa82

Please sign in to comment.