Allow account cell selection only if no other cell is selected

This commit is contained in:
Ivan Grachyov 2021-07-19 01:00:06 +03:00
parent 5f03723223
commit 7ea60657ed
2 changed files with 2 additions and 1 deletions

View File

@ -823,7 +823,7 @@ DQ
<rect key="frame" x="1" y="1" width="248" height="270"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<tableView verticalHuggingPriority="750" ambiguous="YES" allowsExpansionToolTips="YES" columnAutoresizingStyle="lastColumnOnly" multipleSelection="NO" autosaveColumns="NO" typeSelect="NO" rowHeight="40" rowSizeStyle="automatic" viewBased="YES" id="glA-FK-Kdd" customClass="RightClickTableView" customModule="Encrypted_Ink" customModuleProvider="target">
<tableView verticalHuggingPriority="750" ambiguous="YES" allowsExpansionToolTips="YES" columnAutoresizingStyle="lastColumnOnly" columnReordering="NO" columnResizing="NO" multipleSelection="NO" autosaveColumns="NO" typeSelect="NO" rowHeight="40" rowSizeStyle="automatic" viewBased="YES" id="glA-FK-Kdd" customClass="RightClickTableView" customModule="Encrypted_Ink" customModuleProvider="target">
<rect key="frame" x="0.0" y="0.0" width="248" height="270"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>

View File

@ -188,6 +188,7 @@ class AccountsListViewController: NSViewController {
extension AccountsListViewController: NSTableViewDelegate {
func tableView(_ tableView: NSTableView, shouldSelectRow row: Int) -> Bool {
guard tableView.selectedRow < 0 else { return false }
if let onSelectedAccount = onSelectedAccount {
let account = accounts[row]
onSelectedAccount(account)