mirror of
https://github.com/qvacua/vimr.git
synced 2024-11-29 03:53:38 +03:00
Merge remote-tracking branch 'origin/develop' into update-neovim
This commit is contained in:
commit
5755d6694d
@ -17,9 +17,9 @@
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>SNAPSHOT-211</string>
|
||||
<string>SNAPSHOT-212</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>211</string>
|
||||
<string>212</string>
|
||||
<key>LSApplicationCategoryType</key>
|
||||
<string>public.app-category.productivity</string>
|
||||
<key>LSMinimumSystemVersion</key>
|
||||
|
@ -15,11 +15,11 @@
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>FMWK</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>SNAPSHOT-211</string>
|
||||
<string>SNAPSHOT-212</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>211</string>
|
||||
<string>212</string>
|
||||
<key>NSHumanReadableCopyright</key>
|
||||
<string>Copyright © 2016 Tae Won Ha. All rights reserved.</string>
|
||||
<key>NSPrincipalClass</key>
|
||||
|
@ -15,10 +15,10 @@
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>BNDL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>SNAPSHOT-211</string>
|
||||
<string>SNAPSHOT-212</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>211</string>
|
||||
<string>212</string>
|
||||
</dict>
|
||||
</plist>
|
||||
|
@ -17,11 +17,11 @@
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>SNAPSHOT-211</string>
|
||||
<string>SNAPSHOT-212</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>211</string>
|
||||
<string>212</string>
|
||||
<key>LSMinimumSystemVersion</key>
|
||||
<string>$(MACOSX_DEPLOYMENT_TARGET)</string>
|
||||
<key>NSHumanReadableCopyright</key>
|
||||
|
@ -54,6 +54,7 @@
|
||||
1929B7993C8DB7F59447DF5F /* NeoVimView+Draw.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1929B19207FBC2EBDF1B88F3 /* NeoVimView+Draw.swift */; };
|
||||
1929B8E90A1378E494D481E7 /* PrefUtilsTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1929B7BB3E4B3DC96284B686 /* PrefUtilsTest.swift */; };
|
||||
1929B8FB248D71BF88A35761 /* PreviewTool.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1929B6C6C7792B05164B0216 /* PreviewTool.swift */; };
|
||||
1929B9318D32146D58BB38EC /* AppKitCommons.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B6A70931D60E04200E12030 /* AppKitCommons.swift */; };
|
||||
1929B94083273D4B321AD848 /* FileItemUtils.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1929B56C8ED31834BA9D8543 /* FileItemUtils.swift */; };
|
||||
1929B98F94536E3912AD9F3B /* ArrayCommonsTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1929BAF13FAD5DA8D3762367 /* ArrayCommonsTest.swift */; };
|
||||
1929B990A143763A56CFCED0 /* PrefService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1929B364460D86F17E80943C /* PrefService.swift */; };
|
||||
@ -117,6 +118,7 @@
|
||||
4B401B141D0454DC00D99EDC /* PureLayout.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4B401B131D0454DC00D99EDC /* PureLayout.framework */; };
|
||||
4B401B161D0454E900D99EDC /* PureLayout.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 4B401B131D0454DC00D99EDC /* PureLayout.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
4B401B1A1D046E0600D99EDC /* NeoVimViewDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B401B191D046E0600D99EDC /* NeoVimViewDelegate.swift */; };
|
||||
4B40C64F1F05A05B00040B1B /* CocoaMarkdown.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4B183E0D1E06E2940079E8A8 /* CocoaMarkdown.framework */; };
|
||||
4B4147A31D97361400DD4A2C /* WorkspaceToolButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4BB489411D952CF6005BB0E8 /* WorkspaceToolButton.swift */; };
|
||||
4B4192181D0C52D700A0BEB2 /* Grid.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B4192171D0C52D700A0BEB2 /* Grid.swift */; };
|
||||
4B5011F81EBA67EB00F76C46 /* RxTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4B5011F71EBA67EB00F76C46 /* RxTest.framework */; };
|
||||
@ -155,6 +157,7 @@
|
||||
4B81B3D91DE882D500ED1672 /* AppKitCommons.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B6A70931D60E04200E12030 /* AppKitCommons.swift */; };
|
||||
4B854A1D1D31447C00E08DE1 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B854A1C1D31447C00E08DE1 /* main.m */; };
|
||||
4B8AC0441DBCB3A2007CCC9B /* NeoVimObjectsExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B8AC0431DBCB3A1007CCC9B /* NeoVimObjectsExtensions.swift */; };
|
||||
4B8C7C761F05A04400F25BE8 /* CocoaMarkdown.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 4B183E0D1E06E2940079E8A8 /* CocoaMarkdown.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
4B91FFF41DEB772200447068 /* CocoaFontAwesome.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 4B337FBA1DEB76F20020ADD2 /* CocoaFontAwesome.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
4B91FFF61DEB772B00447068 /* CocoaFontAwesome.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 4B337FBA1DEB76F20020ADD2 /* CocoaFontAwesome.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
4B96384C1ED9793B001C556F /* NeoVimAutoCommandEvent.generated.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B96384B1ED9793B001C556F /* NeoVimAutoCommandEvent.generated.m */; };
|
||||
@ -316,6 +319,7 @@
|
||||
dstPath = "";
|
||||
dstSubfolderSpec = 10;
|
||||
files = (
|
||||
4B8C7C761F05A04400F25BE8 /* CocoaMarkdown.framework in CopyFiles */,
|
||||
4B96FB451EBBC6EA00E4E164 /* RxSwift.framework in CopyFiles */,
|
||||
4B96FB441EBBC5E300E4E164 /* SwiftNeoVim.framework in CopyFiles */,
|
||||
4B5011F91EBA69E200F76C46 /* RxTest.framework in CopyFiles */,
|
||||
@ -660,6 +664,7 @@
|
||||
4B96FB431EBBC5C300E4E164 /* SwiftNeoVim.framework in Frameworks */,
|
||||
4B96FB461EBBC6EE00E4E164 /* RxSwift.framework in Frameworks */,
|
||||
4B6A70991D65058A00E12030 /* Nimble.framework in Frameworks */,
|
||||
4B40C64F1F05A05B00040B1B /* CocoaMarkdown.framework in Frameworks */,
|
||||
4B5011F81EBA67EB00F76C46 /* RxTest.framework in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
@ -1676,6 +1681,7 @@
|
||||
1929B8E90A1378E494D481E7 /* PrefUtilsTest.swift in Sources */,
|
||||
1929BCA03A420A83174FD7E7 /* Logger.swift in Sources */,
|
||||
1929B20CE35B43BB1CE023BA /* Theme.swift in Sources */,
|
||||
1929B9318D32146D58BB38EC /* AppKitCommons.swift in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
@ -1793,7 +1799,7 @@
|
||||
COMBINE_HIDPI_IMAGES = YES;
|
||||
DEFINES_MODULE = YES;
|
||||
DYLIB_COMPATIBILITY_VERSION = 1;
|
||||
DYLIB_CURRENT_VERSION = 211;
|
||||
DYLIB_CURRENT_VERSION = 212;
|
||||
DYLIB_INSTALL_NAME_BASE = "@rpath";
|
||||
FRAMEWORK_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
@ -1818,7 +1824,7 @@
|
||||
COMBINE_HIDPI_IMAGES = YES;
|
||||
DEFINES_MODULE = YES;
|
||||
DYLIB_COMPATIBILITY_VERSION = 1;
|
||||
DYLIB_CURRENT_VERSION = 211;
|
||||
DYLIB_CURRENT_VERSION = 212;
|
||||
DYLIB_INSTALL_NAME_BASE = "@rpath";
|
||||
FRAMEWORK_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
@ -2055,7 +2061,7 @@
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
COPY_PHASE_STRIP = NO;
|
||||
CURRENT_PROJECT_VERSION = 211;
|
||||
CURRENT_PROJECT_VERSION = 212;
|
||||
DEBUG_INFORMATION_FORMAT = dwarf;
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
ENABLE_TESTABILITY = YES;
|
||||
@ -2105,7 +2111,7 @@
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
COPY_PHASE_STRIP = NO;
|
||||
CURRENT_PROJECT_VERSION = 211;
|
||||
CURRENT_PROJECT_VERSION = 212;
|
||||
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||
ENABLE_NS_ASSERTIONS = NO;
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
|
@ -13,8 +13,9 @@ class AppearancePref: PrefPane, NSComboBoxDelegate, NSControlTextEditingDelegate
|
||||
|
||||
enum Action {
|
||||
|
||||
case setUsesLigatures(Bool)
|
||||
case setUsesColorscheme(Bool)
|
||||
case setShowsFileIcon(Bool)
|
||||
case setUsesLigatures(Bool)
|
||||
case setFont(NSFont)
|
||||
case setLinespacing(CGFloat)
|
||||
}
|
||||
@ -38,6 +39,7 @@ class AppearancePref: PrefPane, NSComboBoxDelegate, NSControlTextEditingDelegate
|
||||
self.linespacing = state.mainWindowTemplate.appearance.linespacing
|
||||
self.usesLigatures = state.mainWindowTemplate.appearance.usesLigatures
|
||||
self.usesColorscheme = state.mainWindowTemplate.appearance.usesTheme
|
||||
self.showsFileIcon = state.mainWindowTemplate.appearance.showsFileIcon
|
||||
|
||||
super.init(frame: .zero)
|
||||
|
||||
@ -49,16 +51,22 @@ class AppearancePref: PrefPane, NSComboBoxDelegate, NSControlTextEditingDelegate
|
||||
.subscribe(onNext: { state in
|
||||
let appearance = state.mainWindowTemplate.appearance
|
||||
|
||||
if self.font != appearance.font
|
||||
|| self.linespacing != appearance.linespacing
|
||||
|| self.usesLigatures != appearance.usesLigatures {
|
||||
self.font = appearance.font
|
||||
self.linespacing = appearance.linespacing
|
||||
self.usesLigatures = appearance.usesLigatures
|
||||
self.usesColorscheme = appearance.usesTheme
|
||||
guard self.font != appearance.font
|
||||
|| self.linespacing != appearance.linespacing
|
||||
|| self.usesLigatures != appearance.usesLigatures
|
||||
|| self.usesColorscheme != appearance.usesTheme
|
||||
|| self.showsFileIcon != appearance.showsFileIcon else {
|
||||
|
||||
self.updateViews()
|
||||
return
|
||||
}
|
||||
|
||||
self.font = appearance.font
|
||||
self.linespacing = appearance.linespacing
|
||||
self.usesLigatures = appearance.usesLigatures
|
||||
self.usesColorscheme = appearance.usesTheme
|
||||
self.showsFileIcon = appearance.showsFileIcon
|
||||
|
||||
self.updateViews()
|
||||
})
|
||||
.disposed(by: self.disposeBag)
|
||||
}
|
||||
@ -72,8 +80,10 @@ class AppearancePref: PrefPane, NSComboBoxDelegate, NSControlTextEditingDelegate
|
||||
fileprivate var linespacing: CGFloat
|
||||
fileprivate var usesLigatures: Bool
|
||||
fileprivate var usesColorscheme: Bool
|
||||
fileprivate var showsFileIcon: Bool
|
||||
|
||||
fileprivate let colorschemeCheckbox = NSButton(forAutoLayout: ())
|
||||
fileprivate let fileIconCheckbox = NSButton(forAutoLayout: ())
|
||||
|
||||
fileprivate let sizes = [9, 10, 11, 12, 13, 14, 16, 18, 24, 36, 48, 64]
|
||||
fileprivate let sizeCombo = NSComboBox(forAutoLayout: ())
|
||||
@ -99,7 +109,7 @@ class AppearancePref: PrefPane, NSComboBoxDelegate, NSControlTextEditingDelegate
|
||||
|
||||
let useColorscheme = self.colorschemeCheckbox
|
||||
self.configureCheckbox(button: useColorscheme,
|
||||
title: "Use Neovim's color scheme for tools.",
|
||||
title: "Use Neovim's color scheme for main window and tools.",
|
||||
action: #selector(AppearancePref.usesColorschemeAction(_:)))
|
||||
|
||||
let useColorschemeInfo = self.infoTextField(
|
||||
@ -107,6 +117,16 @@ class AppearancePref: PrefPane, NSComboBoxDelegate, NSControlTextEditingDelegate
|
||||
"used to render tools, e.g. the file browser."
|
||||
)
|
||||
|
||||
let fileIcon = self.fileIconCheckbox
|
||||
self.configureCheckbox(button: fileIcon,
|
||||
title: "Show file icons",
|
||||
action: #selector(AppearancePref.fileIconAction(_:)))
|
||||
|
||||
let fileIconInfo = self.infoTextField(
|
||||
markdown: "In case the selected `colorscheme` does not play well with the file icons \n" +
|
||||
"in the file browser and the buffer list, you can turn them off."
|
||||
)
|
||||
|
||||
let fontTitle = self.titleTextField(title: "Default Font:")
|
||||
|
||||
let fontPopup = self.fontPopup
|
||||
@ -159,6 +179,8 @@ class AppearancePref: PrefPane, NSComboBoxDelegate, NSControlTextEditingDelegate
|
||||
|
||||
self.addSubview(useColorscheme)
|
||||
self.addSubview(useColorschemeInfo)
|
||||
self.addSubview(fileIcon)
|
||||
self.addSubview(fileIconInfo)
|
||||
self.addSubview(fontTitle)
|
||||
self.addSubview(fontPopup)
|
||||
self.addSubview(sizeCombo)
|
||||
@ -176,10 +198,16 @@ class AppearancePref: PrefPane, NSComboBoxDelegate, NSControlTextEditingDelegate
|
||||
useColorschemeInfo.autoPinEdge(.top, to: .bottom, of: useColorscheme, withOffset: 5)
|
||||
useColorschemeInfo.autoPinEdge(.left, to: .left, of: useColorscheme)
|
||||
|
||||
fileIcon.autoPinEdge(.left, to: .right, of: fontTitle, withOffset: 5)
|
||||
fileIcon.autoPinEdge(.top, to: .bottom, of: useColorschemeInfo, withOffset: 18)
|
||||
|
||||
fileIconInfo.autoPinEdge(.top, to: .bottom, of: fileIcon, withOffset: 5)
|
||||
fileIconInfo.autoPinEdge(.left, to: .left, of: fileIcon)
|
||||
|
||||
fontTitle.autoPinEdge(toSuperviewEdge: .left, withInset: 18, relation: .greaterThanOrEqual)
|
||||
fontTitle.autoAlignAxis(.baseline, toSameAxisOf: fontPopup)
|
||||
|
||||
fontPopup.autoPinEdge(.top, to: .bottom, of: useColorschemeInfo, withOffset: 18)
|
||||
fontPopup.autoPinEdge(.top, to: .bottom, of: fileIconInfo, withOffset: 18)
|
||||
fontPopup.autoPinEdge(.left, to: .right, of: fontTitle, withOffset: 5)
|
||||
fontPopup.autoSetDimension(.width, toSize: 240)
|
||||
|
||||
@ -218,6 +246,7 @@ class AppearancePref: PrefPane, NSComboBoxDelegate, NSControlTextEditingDelegate
|
||||
self.ligatureCheckbox.boolState = self.usesLigatures
|
||||
self.previewArea.font = self.font
|
||||
self.colorschemeCheckbox.boolState = self.usesColorscheme
|
||||
self.fileIconCheckbox.boolState = self.showsFileIcon
|
||||
|
||||
if self.usesLigatures {
|
||||
self.previewArea.useAllLigatures(self)
|
||||
@ -234,6 +263,10 @@ extension AppearancePref {
|
||||
self.emit(.setUsesColorscheme(sender.boolState))
|
||||
}
|
||||
|
||||
func fileIconAction(_ sender: NSButton) {
|
||||
self.emit(.setShowsFileIcon(sender.boolState))
|
||||
}
|
||||
|
||||
func usesLigaturesAction(_ sender: NSButton) {
|
||||
self.emit(.setUsesLigatures(sender.boolState))
|
||||
}
|
||||
|
@ -15,12 +15,15 @@ class AppearancePrefReducer {
|
||||
|
||||
switch pair.action {
|
||||
|
||||
case let .setUsesLigatures(value):
|
||||
appearance.usesLigatures = value
|
||||
|
||||
case let .setUsesColorscheme(value):
|
||||
appearance.usesTheme = value
|
||||
|
||||
case let .setShowsFileIcon(value):
|
||||
appearance.showsFileIcon = value
|
||||
|
||||
case let .setUsesLigatures(value):
|
||||
appearance.usesLigatures = value
|
||||
|
||||
case let .setFont(font):
|
||||
appearance.font = font
|
||||
|
||||
|
@ -26,6 +26,7 @@ class FileOutlineView: NSOutlineView,
|
||||
self.isShowHidden = state.fileBrowserShowHidden
|
||||
|
||||
self.usesTheme = state.appearance.usesTheme
|
||||
self.showsFileIcon = state.appearance.showsFileIcon
|
||||
|
||||
super.init(frame: .zero)
|
||||
NSOutlineView.configure(toStandard: self)
|
||||
@ -79,6 +80,7 @@ class FileOutlineView: NSOutlineView,
|
||||
return
|
||||
}
|
||||
|
||||
self.showsFileIcon = state.appearance.showsFileIcon
|
||||
self.isShowHidden = state.fileBrowserShowHidden
|
||||
self.lastFileSystemUpdateMark = state.lastFileSystemUpdate.mark
|
||||
self.root = FileBrowserItem(state.cwd)
|
||||
@ -114,7 +116,7 @@ class FileOutlineView: NSOutlineView,
|
||||
fileprivate var lastFileSystemUpdateMark = Token()
|
||||
fileprivate var usesTheme: Bool
|
||||
fileprivate var lastThemeMark = Token()
|
||||
|
||||
fileprivate var showsFileIcon: Bool
|
||||
|
||||
fileprivate var cwd: URL {
|
||||
return self.root.url
|
||||
@ -143,6 +145,10 @@ class FileOutlineView: NSOutlineView,
|
||||
return true
|
||||
}
|
||||
|
||||
if self.showsFileIcon != state.appearance.showsFileIcon {
|
||||
return true
|
||||
}
|
||||
|
||||
if state.cwd != self.cwd {
|
||||
return true
|
||||
}
|
||||
@ -376,12 +382,16 @@ extension FileOutlineView {
|
||||
let cell = (self.make(withIdentifier: "file-cell-view", owner: self) as? ThemedTableCell)?.reset()
|
||||
?? ThemedTableCell(withIdentifier: "file-cell-view")
|
||||
|
||||
cell.isDir = fileBrowserItem.isDir
|
||||
cell.text = fileBrowserItem.url.lastPathComponent
|
||||
|
||||
guard self.showsFileIcon else {
|
||||
return cell
|
||||
}
|
||||
|
||||
let icon = FileUtils.icon(forUrl: fileBrowserItem.url)
|
||||
cell.image = fileBrowserItem.isHidden ? icon?.tinting(with: NSColor.white.withAlphaComponent(0.4)) : icon
|
||||
|
||||
cell.isDir = fileBrowserItem.isDir
|
||||
|
||||
return cell
|
||||
}
|
||||
|
||||
|
@ -32,7 +32,7 @@
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>SNAPSHOT-211</string>
|
||||
<string>SNAPSHOT-212</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleURLTypes</key>
|
||||
@ -49,7 +49,7 @@
|
||||
</dict>
|
||||
</array>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>211</string>
|
||||
<string>212</string>
|
||||
<key>LSApplicationCategoryType</key>
|
||||
<string>public.app-category.productivity</string>
|
||||
<key>LSMinimumSystemVersion</key>
|
||||
|
@ -237,10 +237,15 @@ class MainWindow: NSObject,
|
||||
_ = changeTheme(
|
||||
themePrefChanged: themePrefChanged, themeChanged: themeChanged, usesTheme: usesTheme,
|
||||
forTheme: {
|
||||
self.window.titlebarAppearsTransparent = true
|
||||
self.window.backgroundColor = state.appearance.theme.payload.background.brightening(by: 0.9)
|
||||
|
||||
self.setWorkspaceTheme(with: state.appearance.theme.payload)
|
||||
self.lastThemeMark = state.appearance.theme.mark
|
||||
},
|
||||
forDefaultTheme: {
|
||||
self.window.titlebarAppearsTransparent = false
|
||||
self.window.backgroundColor = NSColor.windowBackgroundColor
|
||||
self.workspace.theme = Workspace.Theme.default
|
||||
})
|
||||
|
||||
|
@ -30,6 +30,7 @@ class OpenedFileList: NSView,
|
||||
self.genericIcon = FileUtils.icon(forType: "public.data")
|
||||
|
||||
self.usesTheme = state.appearance.usesTheme
|
||||
self.showsFileIcon = state.appearance.showsFileIcon
|
||||
|
||||
super.init(frame: .zero)
|
||||
|
||||
@ -54,10 +55,11 @@ class OpenedFileList: NSView,
|
||||
self.usesTheme = state.appearance.usesTheme
|
||||
|
||||
let buffers = state.buffers.removingDuplicatesPreservingFromBeginning()
|
||||
if self.buffers == buffers && !themeChanged {
|
||||
if self.buffers == buffers && !themeChanged && self.showsFileIcon == state.appearance.showsFileIcon {
|
||||
return
|
||||
}
|
||||
|
||||
self.showsFileIcon = state.appearance.showsFileIcon
|
||||
self.buffers = buffers
|
||||
self.bufferList.reloadData()
|
||||
self.adjustFileViewWidth()
|
||||
@ -71,6 +73,7 @@ class OpenedFileList: NSView,
|
||||
fileprivate let uuid: String
|
||||
fileprivate var usesTheme: Bool
|
||||
fileprivate var lastThemeMark = Token()
|
||||
fileprivate var showsFileIcon: Bool
|
||||
|
||||
fileprivate let bufferList = NSTableView.standardTableView()
|
||||
fileprivate let genericIcon: NSImage
|
||||
@ -144,6 +147,11 @@ extension OpenedFileList {
|
||||
|
||||
let buffer = self.buffers[row]
|
||||
cell.attributedText = self.text(for: buffer)
|
||||
|
||||
guard self.showsFileIcon else {
|
||||
return cell
|
||||
}
|
||||
|
||||
cell.image = self.icon(for: buffer)
|
||||
|
||||
return cell
|
||||
|
@ -31,6 +31,7 @@ class Keys {
|
||||
static let key = "appearance"
|
||||
|
||||
static let usesTheme = "uses-theme"
|
||||
static let showsFileIcon = "shows-file-icon"
|
||||
static let editorFontName = "editor-font-name"
|
||||
static let editorFontSize = "editor-font-size"
|
||||
static let editorLinespacing = "editor-linespacing"
|
||||
|
@ -166,6 +166,7 @@ struct AppearanceState: SerializableState {
|
||||
var usesLigatures = false
|
||||
|
||||
var usesTheme = true
|
||||
var showsFileIcon = true
|
||||
var theme = Marked(Theme.default)
|
||||
|
||||
init() {
|
||||
@ -182,6 +183,7 @@ struct AppearanceState: SerializableState {
|
||||
}
|
||||
|
||||
self.usesTheme = PrefUtils.bool(from: dict, for: Keys.Appearance.usesTheme, default: true)
|
||||
self.showsFileIcon = PrefUtils.bool(from: dict, for: Keys.Appearance.showsFileIcon, default: true)
|
||||
|
||||
self.font = PrefUtils.saneFont(editorFontName, fontSize: CGFloat(fEditorFontSize))
|
||||
self.linespacing = CGFloat(fEditorLinespacing)
|
||||
@ -191,6 +193,7 @@ struct AppearanceState: SerializableState {
|
||||
func dict() -> [String: Any] {
|
||||
return [
|
||||
Keys.Appearance.usesTheme: self.usesTheme,
|
||||
Keys.Appearance.showsFileIcon: self.showsFileIcon,
|
||||
Keys.Appearance.editorFontName: self.font.fontName,
|
||||
Keys.Appearance.editorFontSize: Float(self.font.pointSize),
|
||||
Keys.Appearance.editorLinespacing: Float(self.linespacing),
|
||||
|
@ -77,6 +77,7 @@ class ThemedTableCell: NSTableCellView {
|
||||
|
||||
set {
|
||||
self.textField?.attributedStringValue = newValue
|
||||
self.addTextField()
|
||||
}
|
||||
}
|
||||
|
||||
@ -87,6 +88,7 @@ class ThemedTableCell: NSTableCellView {
|
||||
|
||||
set {
|
||||
self.textField?.stringValue = newValue
|
||||
self.addTextField()
|
||||
}
|
||||
}
|
||||
|
||||
@ -97,6 +99,24 @@ class ThemedTableCell: NSTableCellView {
|
||||
|
||||
set {
|
||||
self.imageView?.image = newValue
|
||||
|
||||
self.removeAllSubviews()
|
||||
|
||||
let textField = self._textField
|
||||
let imageView = self._imageView
|
||||
|
||||
self.addSubview(textField)
|
||||
self.addSubview(imageView)
|
||||
|
||||
imageView.autoPinEdge(toSuperviewEdge: .top, withInset: 2)
|
||||
imageView.autoPinEdge(toSuperviewEdge: .left, withInset: 2)
|
||||
imageView.autoSetDimension(.width, toSize: 16)
|
||||
imageView.autoSetDimension(.height, toSize: 16)
|
||||
|
||||
textField.autoPinEdge(toSuperviewEdge: .top, withInset: 2)
|
||||
textField.autoPinEdge(toSuperviewEdge: .right, withInset: 2)
|
||||
textField.autoPinEdge(toSuperviewEdge: .bottom, withInset: 2)
|
||||
textField.autoPinEdge(.left, to: .right, of: imageView, withOffset: 4)
|
||||
}
|
||||
}
|
||||
|
||||
@ -116,21 +136,6 @@ class ThemedTableCell: NSTableCellView {
|
||||
textField.isEditable = false
|
||||
textField.usesSingleLineMode = true
|
||||
textField.drawsBackground = false
|
||||
|
||||
let imageView = self._imageView
|
||||
|
||||
self.addSubview(textField)
|
||||
self.addSubview(imageView)
|
||||
|
||||
imageView.autoPinEdge(toSuperviewEdge: .top, withInset: 2)
|
||||
imageView.autoPinEdge(toSuperviewEdge: .left, withInset: 2)
|
||||
imageView.autoSetDimension(.width, toSize: 16)
|
||||
imageView.autoSetDimension(.height, toSize: 16)
|
||||
|
||||
textField.autoPinEdge(toSuperviewEdge: .top, withInset: 2)
|
||||
textField.autoPinEdge(toSuperviewEdge: .right, withInset: 2)
|
||||
textField.autoPinEdge(toSuperviewEdge: .bottom, withInset: 2)
|
||||
textField.autoPinEdge(.left, to: .right, of: imageView, withOffset: 4)
|
||||
}
|
||||
|
||||
func reset() -> ThemedTableCell {
|
||||
@ -138,9 +143,20 @@ class ThemedTableCell: NSTableCellView {
|
||||
self.image = nil
|
||||
self.isDir = false
|
||||
|
||||
self.removeAllSubviews()
|
||||
|
||||
return self
|
||||
}
|
||||
|
||||
fileprivate func addTextField() {
|
||||
let textField = self._textField
|
||||
|
||||
textField.removeFromSuperview()
|
||||
self.addSubview(textField)
|
||||
|
||||
textField.autoPinEdgesToSuperviewEdges(with: EdgeInsets(top: 2, left: 2, bottom: 2, right: 2))
|
||||
}
|
||||
|
||||
fileprivate let _textField = NSTextField(forAutoLayout: ())
|
||||
fileprivate let _imageView = NSImageView(forAutoLayout: ())
|
||||
|
||||
|
@ -15,10 +15,10 @@
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>BNDL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>SNAPSHOT-211</string>
|
||||
<string>SNAPSHOT-212</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>211</string>
|
||||
<string>212</string>
|
||||
</dict>
|
||||
</plist>
|
||||
|
@ -7,25 +7,26 @@
|
||||
<description>Most recent changes with links to updates for VimR.</description>
|
||||
<language>en</language>
|
||||
<item>
|
||||
<title>SNAPSHOT-211</title>
|
||||
<title>SNAPSHOT-212</title>
|
||||
<description><![CDATA[
|
||||
<ul>
|
||||
<li>GH-436: Use colors from the selected <code>colorscheme</code> for tools, e.g. the file browser.<ul>
|
||||
<li>Use <code>directory</code> color of the selected <code>colorscheme</code> for folders in the file browser</li>
|
||||
<li>Use slightly darker version of the <code>background</code> color for the window title bar.</li>
|
||||
<li>Add an option to turn off file icons in the file browser and in the buffer list in case the <code>colorscheme</code> does not play well with them, cf. GH-479.</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
]]></description>
|
||||
<releaseNotesLink>
|
||||
https://github.com/qvacua/vimr/releases/tag/snapshot/211
|
||||
https://github.com/qvacua/vimr/releases/tag/snapshot/212
|
||||
</releaseNotesLink>
|
||||
<pubDate>2017-06-29T18:04:13.475054</pubDate>
|
||||
<pubDate>2017-06-30T07:01:34.030982</pubDate>
|
||||
<minimumSystemVersion>10.10.0</minimumSystemVersion>
|
||||
<enclosure url="https://github.com/qvacua/vimr/releases/download/snapshot/211/VimR-SNAPSHOT-211.tar.bz2"
|
||||
sparkle:version="211"
|
||||
sparkle:shortVersionString="SNAPSHOT-211"
|
||||
sparkle:dsaSignature="MCwCFBfkMVj9gA0Jo0oezaToCEoKTn0kAhRYoAaumpaFun7kpto8IWPK5kfQNg=="
|
||||
length="10688763"
|
||||
<enclosure url="https://github.com/qvacua/vimr/releases/download/snapshot/212/VimR-SNAPSHOT-212.tar.bz2"
|
||||
sparkle:version="212"
|
||||
sparkle:shortVersionString="SNAPSHOT-212"
|
||||
sparkle:dsaSignature="MCwCFAwd1ymF+w06C6w2v0llTZDOiSAIAhR2Dob7tTVk/ZwG09se+wcDAI/pNw=="
|
||||
length="10694624"
|
||||
type="application/octet-stream"/>
|
||||
</item>
|
||||
</channel>
|
||||
|
@ -1,7 +1,9 @@
|
||||
# next
|
||||
|
||||
* GH-436: Use colors from the selected `colorscheme` for tools, e.g. the file browser.
|
||||
* ...
|
||||
* GH-436: Use colors from the selected `colorscheme` for tools, e.g. the file browser:
|
||||
- Use the `directory` color for folders in the file browser.
|
||||
- Use slightly darker version of the `background` color for the window title bar.
|
||||
- Add an option to turn off file icons in the file browser and in the buffer list in case the `colorscheme` does not play well with them, cf. GH-479.
|
||||
|
||||
# 0.16.2-210
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user