Skip to content

Commit

Permalink
Add enumeration managment
Browse files Browse the repository at this point in the history
  • Loading branch information
akaDuality committed Dec 19, 2022
1 parent 9098c49 commit 31e0386
Showing 1 changed file with 24 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,14 @@ class ContainerSettingsViewController: NSViewController {
override func viewDidLoad() {
super.viewDidLoad()

renderSettings()
}

private func renderSettings() {
view().isModal = presenter.container.isModal
view().isTabTrait = presenter.container.isTabTrait
view().isEnumerated = presenter.container.isEnumerated
view().isEnumeratedEnabled = !presenter.container.isTabTrait
}

@IBAction func didChangeContainerType(sender: Any) {
Expand All @@ -44,7 +49,15 @@ class ContainerSettingsViewController: NSViewController {
}

@IBAction func isTabDidChanged(sender: Any) {
presenter.container.isTabTrait = view().isTabTrait
let isTab = view().isTabTrait
presenter.container.isTabTrait = isTab

if isTab {
// Tab trait enumerates itself
presenter.container.isEnumerated = false
}

renderSettings()
}

@IBAction func isEnumerateDidChanged(sender: Any) {
Expand Down Expand Up @@ -107,6 +120,16 @@ class ContainerSettingsView: NSView {
}
}

var isEnumeratedEnabled: Bool {
set {
isEnumeratedButton.isEnabled = newValue
}

get {
isEnumeratedButton.isEnabled
}
}

@IBOutlet private var containerTypeSegmentedControl: NSSegmentedControl!
@IBOutlet private var navigationStyleSegmentedControl: NSSegmentedControl!
@IBOutlet private var isModalButton: NSButton!
Expand Down

0 comments on commit 31e0386

Please sign in to comment.