feat: make illustration clearer

This commit is contained in:
allsochen committed 2024-07-31 16:56:38 +08:00
1 parent 9a37bfb160
commit 5dc8932a34
38 files changed
+24 -23

No files matched your search

Binary file not shown.

Before

Width:  |  Height:  |  Size: 130 KiB

After

Width:  |  Height:  |  Size: 961 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 96 KiB

After

Width:  |  Height:  |  Size: 707 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 109 KiB

After

Width:  |  Height:  |  Size: 796 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 127 KiB

After

Width:  |  Height:  |  Size: 952 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 130 KiB

After

Width:  |  Height:  |  Size: 961 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 131 KiB

After

Width:  |  Height:  |  Size: 961 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 112 KiB

After

Width:  |  Height:  |  Size: 780 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 108 KiB

After

Width:  |  Height:  |  Size: 764 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 130 KiB

After

Width:  |  Height:  |  Size: 961 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 122 KiB

After

Width:  |  Height:  |  Size: 831 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 120 KiB

After

Width:  |  Height:  |  Size: 828 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 89 KiB

After

Width:  |  Height:  |  Size: 637 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 121 KiB

After

Width:  |  Height:  |  Size: 830 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 121 KiB

After

Width:  |  Height:  |  Size: 830 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 108 KiB

After

Width:  |  Height:  |  Size: 821 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 115 KiB

After

Width:  |  Height:  |  Size: 863 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 125 KiB

After

Width:  |  Height:  |  Size: 943 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 122 KiB

After

Width:  |  Height:  |  Size: 831 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 122 KiB

After

Width:  |  Height:  |  Size: 831 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 104 KiB

After

Width:  |  Height:  |  Size: 710 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 122 KiB

After

Width:  |  Height:  |  Size: 832 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 122 KiB

After

Width:  |  Height:  |  Size: 832 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 119 KiB

After

Width:  |  Height:  |  Size: 884 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 119 KiB

After

Width:  |  Height:  |  Size: 876 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 132 KiB

After

Width:  |  Height:  |  Size: 963 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 102 KiB

After

Width:  |  Height:  |  Size: 760 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 130 KiB

After

Width:  |  Height:  |  Size: 958 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 130 KiB

After

Width:  |  Height:  |  Size: 960 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 105 KiB

After

Width:  |  Height:  |  Size: 769 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 125 KiB

After

Width:  |  Height:  |  Size: 920 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 132 KiB

After

Width:  |  Height:  |  Size: 963 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 132 KiB

After

Width:  |  Height:  |  Size: 962 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 118 KiB

After

Width:  |  Height:  |  Size: 833 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 131 KiB

After

Width:  |  Height:  |  Size: 961 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 131 KiB

After

Width:  |  Height:  |  Size: 961 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 120 KiB

After

Width:  |  Height:  |  Size: 848 KiB

Binary file not shown.

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 {