Fix color panel for theme editing

This commit is contained in:
1024jp 2019-10-06 23:22:11 +09:00
parent ef67d070cc
commit ec190c45c5
4 changed files with 9 additions and 1 deletions

View File

@ -28,6 +28,7 @@ Change Log
- Fix the selection movement direction after `⌥⇧←` or `⌥⇧→` shortcut.
- Fix an issue where scripting commands `convert` and `reinterpret` failed.
- Fix an issue where the color panel for theme editing could occasionally not change.
- Fix an issue where the appearance of Acknowledgements window was not updated when user changed the system appearance after the launch.

View File

@ -62,6 +62,7 @@
<ul>
<li>Fix the selection movement direction after <kbd>⌥⇧←</kbd> or <kbd>⌥⇧→</kbd> shortcut.</li>
<li>Fix an issue where scripting commands <code>convert</code> and <code>reinterpret</code> failed.</li>
<li>Fix an issue where the color panel for theme editing could occasionally not change.</li>
<li>Fix an issue where the appearance of Acknowledgements window was not updated when user changed the system appearance after the launch.</li>
</ul>
</section>

View File

@ -62,6 +62,7 @@
<ul>
<li><kbd>⌥⇧←</kbd>または<kbd>⌥⇧→</kbd>のあとの選択範囲移動方向を修正</li>
<li>AppleScriptコマンド<code>convert</code><code>reinterpret</code>が機能していなかった不具合を修正</li>
<li>テーマ編集時のカラーパネルで色が変更できなくなることがあった不具合を修正</li>
<li>起動後にシステムの外観モードが変更されたときに謝辞ウインドウの外観が更新されなかった不具合を修正</li>
</ul>
</section>

View File

@ -1337,9 +1337,14 @@ final class EditorTextView: NSTextView, Themable, CurrentLineHighlighting, Multi
(self.window as? DocumentWindow)?.contentBackgroundColor = theme.background.color
// set textColor only when really required
// to avoid returning textColor to NSColorPanel (especially for theme editor). (macOS 10.14)
if theme.text.color != self.textColor {
self.textColor = theme.text.color
}
self.backgroundColor = theme.background.color
self.enclosingScrollView?.backgroundColor = theme.background.color
self.textColor = theme.text.color
self.lineHighLightColor = theme.lineHighlight.color
self.insertionPointColor = theme.insertionPoint.color.withAlphaComponent(self.cursorType == .block ? 0.5 : 1)
self.selectedTextAttributes = [.backgroundColor: theme.selection.usesSystemSetting ? .selectedTextBackgroundColor : theme.selection.color]