Hide "Restore to Defaults" button if needless

This commit is contained in:
1024jp 2018-11-24 04:05:55 +09:00
parent ab91035c20
commit 7012f50c3b
3 changed files with 8 additions and 3 deletions

View File

@ -10,6 +10,7 @@ Change Log
- Change not to highlight occurrences of the selection when there are more than 100.
- Update validation pane in the syntax style editor:
- Now, validation is performed automatically when the pane switched to “Valitation”.
- [trivial] Remove “Restore to Defaults” button in the syntax style editor if the style has no defaults.
### Fixes

View File

@ -262,7 +262,7 @@
<constraints>
<constraint firstAttribute="width" relation="greaterThanOrEqual" constant="140" id="i12-7i-sAj"/>
</constraints>
<buttonCell key="cell" type="push" title="Restore Defaults" bezelStyle="rounded" alignment="center" enabled="NO" borderStyle="border" inset="2" id="1020">
<buttonCell key="cell" type="push" title="Restore Defaults" bezelStyle="rounded" alignment="center" borderStyle="border" inset="2" id="1020">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="system"/>
<connections>
@ -271,6 +271,11 @@
</buttonCell>
<connections>
<action selector="setToFactoryDefaults:" target="8Mx-zQ-ItP" id="b5I-xl-dUQ"/>
<binding destination="8Mx-zQ-ItP" name="hidden" keyPath="isBundledStyle" id="qs6-2z-iwf">
<dictionary key="options">
<string key="NSValueTransformerName">NSNegateBoolean</string>
</dictionary>
</binding>
</connections>
</button>
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="dje-ga-BFL">

View File

@ -70,7 +70,7 @@ final class SyntaxEditViewController: NSViewController, NSTextFieldDelegate, NST
@objc private dynamic var message: String?
@objc private dynamic var isStyleNameValid = true
@objc private dynamic var isRestoreble = false
private var isBundledStyle = false
@objc private dynamic var isBundledStyle = false
private var tabViewController: NSTabViewController?
@ -170,7 +170,6 @@ final class SyntaxEditViewController: NSViewController, NSTextFieldDelegate, NST
else { return }
self.style.setDictionary(style)
self.isRestoreble = false
// update validation result if displayed
let tabViewController = self.tabViewController!