mirror of
https://github.com/qvacua/vimr.git
synced 2024-11-25 06:06:21 +03:00
GH-436 Refactor slightly
This commit is contained in:
parent
f6662620be
commit
77cc5cdb53
@ -70,18 +70,8 @@ class FileOutlineView: NSOutlineView,
|
||||
themePrefChanged: state.appearance.usesTheme != self.usesTheme,
|
||||
themeChanged: state.appearance.theme.mark != self.lastThemeMark,
|
||||
usesTheme: state.appearance.usesTheme,
|
||||
forTheme: {
|
||||
self.theme = state.appearance.theme.payload
|
||||
self.enclosingScrollView?.backgroundColor = self.theme.background
|
||||
self.backgroundColor = self.theme.background
|
||||
self.lastThemeMark = state.appearance.theme.mark
|
||||
},
|
||||
forDefaultTheme: {
|
||||
self.theme = Theme.default
|
||||
self.enclosingScrollView?.backgroundColor = self.theme.background
|
||||
self.backgroundColor = self.theme.background
|
||||
self.lastThemeMark = state.appearance.theme.mark
|
||||
})
|
||||
forTheme: { self.updateTheme(state.appearance.theme) },
|
||||
forDefaultTheme: { self.updateTheme(Marked(Theme.default)) })
|
||||
|
||||
self.usesTheme = state.appearance.usesTheme
|
||||
|
||||
@ -137,6 +127,13 @@ class FileOutlineView: NSOutlineView,
|
||||
fatalError("init(coder:) has not been implemented")
|
||||
}
|
||||
|
||||
fileprivate func updateTheme(_ theme: Marked<Theme>) {
|
||||
self.theme = theme.payload
|
||||
self.enclosingScrollView?.backgroundColor = self.theme.background
|
||||
self.backgroundColor = self.theme.background
|
||||
self.lastThemeMark = theme.mark
|
||||
}
|
||||
|
||||
fileprivate func shouldReloadData(for state: StateType, themeChanged: Bool = false) -> Bool {
|
||||
if self.isShowHidden != state.fileBrowserShowHidden {
|
||||
return true
|
||||
|
@ -48,18 +48,8 @@ class OpenedFileList: NSView,
|
||||
themePrefChanged: state.appearance.usesTheme != self.usesTheme,
|
||||
themeChanged: state.appearance.theme.mark != self.lastThemeMark,
|
||||
usesTheme: state.appearance.usesTheme,
|
||||
forTheme: {
|
||||
self.theme = state.appearance.theme.payload
|
||||
self.bufferList.enclosingScrollView?.backgroundColor = self.theme.background
|
||||
self.bufferList.backgroundColor = self.theme.background
|
||||
self.lastThemeMark = state.appearance.theme.mark
|
||||
},
|
||||
forDefaultTheme: {
|
||||
self.theme = Theme.default
|
||||
self.bufferList.enclosingScrollView?.backgroundColor = self.theme.background
|
||||
self.bufferList.backgroundColor = self.theme.background
|
||||
self.lastThemeMark = state.appearance.theme.mark
|
||||
})
|
||||
forTheme: { self.updateTheme(state.appearance.theme) },
|
||||
forDefaultTheme: { self.updateTheme(Marked(Theme.default)) })
|
||||
|
||||
self.usesTheme = state.appearance.usesTheme
|
||||
|
||||
@ -91,6 +81,13 @@ class OpenedFileList: NSView,
|
||||
fatalError("init(coder:) has not been implemented")
|
||||
}
|
||||
|
||||
fileprivate func updateTheme(_ theme: Marked<Theme>) {
|
||||
self.theme = theme.payload
|
||||
self.bufferList.enclosingScrollView?.backgroundColor = self.theme.background
|
||||
self.bufferList.backgroundColor = self.theme.background
|
||||
self.lastThemeMark = theme.mark
|
||||
}
|
||||
|
||||
fileprivate func addViews() {
|
||||
let scrollView = NSScrollView.standardScrollView()
|
||||
scrollView.borderType = .noBorder
|
||||
|
Loading…
Reference in New Issue
Block a user