feat: make illustration clearer
No files matched your search
|
Before Width: | Height: | Size: 130 KiB After Width: | Height: | Size: 961 KiB |
|
Before Width: | Height: | Size: 96 KiB After Width: | Height: | Size: 707 KiB |
|
Before Width: | Height: | Size: 109 KiB After Width: | Height: | Size: 796 KiB |
|
Before Width: | Height: | Size: 127 KiB After Width: | Height: | Size: 952 KiB |
|
Before Width: | Height: | Size: 130 KiB After Width: | Height: | Size: 961 KiB |
|
Before Width: | Height: | Size: 131 KiB After Width: | Height: | Size: 961 KiB |
|
Before Width: | Height: | Size: 112 KiB After Width: | Height: | Size: 780 KiB |
|
Before Width: | Height: | Size: 108 KiB After Width: | Height: | Size: 764 KiB |
|
Before Width: | Height: | Size: 130 KiB After Width: | Height: | Size: 961 KiB |
|
Before Width: | Height: | Size: 122 KiB After Width: | Height: | Size: 831 KiB |
|
Before Width: | Height: | Size: 120 KiB After Width: | Height: | Size: 828 KiB |
|
Before Width: | Height: | Size: 89 KiB After Width: | Height: | Size: 637 KiB |
|
Before Width: | Height: | Size: 121 KiB After Width: | Height: | Size: 830 KiB |
|
Before Width: | Height: | Size: 121 KiB After Width: | Height: | Size: 830 KiB |
|
Before Width: | Height: | Size: 108 KiB After Width: | Height: | Size: 821 KiB |
|
Before Width: | Height: | Size: 115 KiB After Width: | Height: | Size: 863 KiB |
|
Before Width: | Height: | Size: 125 KiB After Width: | Height: | Size: 943 KiB |
|
Before Width: | Height: | Size: 122 KiB After Width: | Height: | Size: 831 KiB |
|
Before Width: | Height: | Size: 122 KiB After Width: | Height: | Size: 831 KiB |
|
Before Width: | Height: | Size: 104 KiB After Width: | Height: | Size: 710 KiB |
|
Before Width: | Height: | Size: 122 KiB After Width: | Height: | Size: 832 KiB |
|
Before Width: | Height: | Size: 122 KiB After Width: | Height: | Size: 832 KiB |
|
Before Width: | Height: | Size: 119 KiB After Width: | Height: | Size: 884 KiB |
|
Before Width: | Height: | Size: 119 KiB After Width: | Height: | Size: 876 KiB |
|
Before Width: | Height: | Size: 132 KiB After Width: | Height: | Size: 963 KiB |
|
Before Width: | Height: | Size: 102 KiB After Width: | Height: | Size: 760 KiB |
|
Before Width: | Height: | Size: 130 KiB After Width: | Height: | Size: 958 KiB |
|
Before Width: | Height: | Size: 130 KiB After Width: | Height: | Size: 960 KiB |
|
Before Width: | Height: | Size: 105 KiB After Width: | Height: | Size: 769 KiB |
|
Before Width: | Height: | Size: 125 KiB After Width: | Height: | Size: 920 KiB |
|
Before Width: | Height: | Size: 132 KiB After Width: | Height: | Size: 963 KiB |
|
Before Width: | Height: | Size: 132 KiB After Width: | Height: | Size: 962 KiB |
|
Before Width: | Height: | Size: 118 KiB After Width: | Height: | Size: 833 KiB |
|
Before Width: | Height: | Size: 131 KiB After Width: | Height: | Size: 961 KiB |
|
Before Width: | Height: | Size: 131 KiB After Width: | Height: | Size: 961 KiB |
|
Before Width: | Height: | Size: 120 KiB After Width: | Height: | Size: 848 KiB |
|
Before Width: | Height: | Size: 132 KiB After Width: | Height: | Size: 962 KiB |
@@ -17,7 +17,7 @@ struct ShowHideRowInfo {
|
||||
class ShowHideIllustratedView {
|
||||
private let model: AppearanceModelPreference
|
||||
|
||||
private let showHideCellWidth = CGFloat(400)
|
||||
private let showHideCellWidth = CGFloat(600)
|
||||
private var showHideRows = [ShowHideRowInfo]()
|
||||
private var grid: GridView!
|
||||
|
||||
@@ -28,8 +28,9 @@ class ShowHideIllustratedView {
|
||||
|
||||
func setupView() -> GridView {
|
||||
// Add the illustrated image first
|
||||
let shrinkWidth: CGFloat = 50
|
||||
var settings: [[NSView]] = [
|
||||
[makeIllustratedImageView(model)],
|
||||
[makeIllustratedImageView(model, showHideCellWidth - shrinkWidth)],
|
||||
]
|
||||
var modelToRows = [Int: ShowHideRowInfo]()
|
||||
var index = 1
|
||||
@@ -187,7 +188,7 @@ class ShowHideIllustratedView {
|
||||
hoverView.addSubview(contentView)
|
||||
contentView.translatesAutoresizingMaskIntoConstraints = false
|
||||
NSLayoutConstraint.activate([
|
||||
hoverView.widthAnchor.constraint(equalToConstant: grid.column(at: 0).width - GridView.padding),
|
||||
hoverView.widthAnchor.constraint(equalToConstant: grid.column(at: 0).width),
|
||||
contentView.topAnchor.constraint(equalTo: hoverView.topAnchor, constant: 10),
|
||||
contentView.bottomAnchor.constraint(equalTo: hoverView.bottomAnchor, constant: -10),
|
||||
contentView.leadingAnchor.constraint(equalTo: hoverView.leadingAnchor, constant: 10),
|
||||
@@ -199,7 +200,7 @@ class ShowHideIllustratedView {
|
||||
}
|
||||
}
|
||||
|
||||
private func makeIllustratedImageView(_ model: AppearanceModelPreference) -> NSView {
|
||||
private func makeIllustratedImageView(_ model: AppearanceModelPreference, _ imageWidth: CGFloat) -> NSView {
|
||||
// TODO: The appearance theme functionality has not been implemented yet.
|
||||
// We will implement it later; for now, use the light theme.
|
||||
let imageName = model.image.name + "_light"
|
||||
@@ -217,7 +218,7 @@ class ShowHideIllustratedView {
|
||||
wrapView.layer?.borderColor = NSColor.lightGray.withAlphaComponent(0.2).cgColor
|
||||
wrapView.layer?.borderWidth = 2.0
|
||||
|
||||
let imageWidth = showHideCellWidth - 100
|
||||
let imageWidth = imageWidth
|
||||
let imageHeight = imageWidth / 1.6
|
||||
NSLayoutConstraint.activate([
|
||||
imageView.widthAnchor.constraint(equalToConstant: imageWidth),
|
||||
@@ -384,24 +385,24 @@ class ModelAdvancedSettingsWindow: NSWindow, NSTabViewDelegate {
|
||||
|
||||
// Delegate method for tab view, it will be called when new tab is selected.
|
||||
func tabView(_ tabView: NSTabView, didSelect tabViewItem: NSTabViewItem?) {
|
||||
if let grid = tabView.superview as? GridView, let tabView = tabView as? TabView {
|
||||
if let window = tabView.window as? ModelAdvancedSettingsWindow {
|
||||
// Adjust the size of the tabView to fit its content
|
||||
tabView.widthAnchor.constraint(equalToConstant: tabView.maxIntrinsicContentSize().width + GridView.padding).isActive = true
|
||||
let newSize = grid.fittingSize
|
||||
|
||||
if let parentWindow = window.sheetParent {
|
||||
// Get parent window frame
|
||||
let parentFrame = parentWindow.frame
|
||||
var frame = window.frame
|
||||
frame.size.height = newSize.height
|
||||
frame.origin.y = parentFrame.origin.y + parentFrame.height - newSize.height
|
||||
|
||||
window.setFrame(frame, display: true, animate: true)
|
||||
window.layoutIfNeeded()
|
||||
}
|
||||
}
|
||||
}
|
||||
// if let grid = tabView.superview as? GridView, let tabView = tabView as? TabView {
|
||||
// if let window = tabView.window as? ModelAdvancedSettingsWindow {
|
||||
// // Adjust the size of the tabView to fit its content
|
||||
// tabView.widthAnchor.constraint(equalToConstant: tabView.maxIntrinsicContentSize().width + GridView.padding).isActive = true
|
||||
// let newSize = grid.fittingSize
|
||||
//
|
||||
// if let parentWindow = window.sheetParent {
|
||||
// // Get parent window frame
|
||||
// let parentFrame = parentWindow.frame
|
||||
// var frame = window.frame
|
||||
// frame.size.height = newSize.height
|
||||
// frame.origin.y = parentFrame.origin.y + parentFrame.height - newSize.height
|
||||
//
|
||||
// window.setFrame(frame, display: true, animate: true)
|
||||
// window.layoutIfNeeded()
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
private func setupThumbnailsView() -> NSView {
|
||||
|
||||