Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 30 additions & 13 deletions Clipy/Sources/Managers/MenuManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6340,48 +6340,65 @@ class BoardManPanel: NSPanel {
let contentWidth = max(120, width - (inset * 2))
let topY = height - inset

let titleLabelHeight: CGFloat = 17
let titleFieldHeight = LayoutMetrics.controlHeight
let titleLabelToFieldGap: CGFloat = 4
let titleFieldToStatusGap: CGFloat = 24
let statusHeight: CGFloat = 32
let statusToToggleGap: CGFloat = 14
let toggleHeight: CGFloat = 22
let toggleToContentLabelGap: CGFloat = 16
let contentLabelHeight: CGFloat = 17
let contentLabelToEditorGap: CGFloat = 10

let titleLabelY = topY - titleLabelHeight
let titleFieldY = titleLabelY - titleLabelToFieldGap - titleFieldHeight
let statusY = titleFieldY - titleFieldToStatusGap - statusHeight
let toggleY = statusY - statusToToggleGap - toggleHeight
let contentLabelY = toggleY - toggleToContentLabelGap - contentLabelHeight
let contentTop = contentLabelY - contentLabelToEditorGap

snippetEditorTitleLabel?.frame = NSIntegralRect(NSRect(
x: inset,
y: topY - 17,
y: titleLabelY,
width: contentWidth,
height: 17
height: titleLabelHeight
))
snippetEditorTitleField?.frame = NSIntegralRect(NSRect(
x: inset,
y: topY - 53,
y: titleFieldY,
width: contentWidth,
height: LayoutMetrics.controlHeight
height: titleFieldHeight
))
snippetEditorStatusLabel?.frame = NSIntegralRect(NSRect(
x: inset,
y: topY - 101,
y: statusY,
width: contentWidth,
height: 32
height: statusHeight
))

let toggleGap: CGFloat = 8
let toggleWidth = max(104, floor((contentWidth - toggleGap) / 2))
snippetFolderEnableButton?.frame = NSIntegralRect(NSRect(
x: inset,
y: topY - 133,
y: toggleY,
width: toggleWidth,
height: 22
height: toggleHeight
))
snippetEnableButton?.frame = NSIntegralRect(NSRect(
x: inset + toggleWidth + toggleGap,
y: topY - 133,
y: toggleY,
width: toggleWidth,
height: 22
height: toggleHeight
))

snippetEditorContentLabel?.frame = NSIntegralRect(NSRect(
x: inset,
y: topY - 166,
y: contentLabelY,
width: contentWidth,
height: 17
height: contentLabelHeight
))
let contentBottom = inset + LayoutMetrics.actionButtonHeight + 14
let contentTop = topY - 176
let contentHeight = max(90, contentTop - contentBottom)
snippetEditorScrollView?.frame = NSIntegralRect(NSRect(
x: inset,
Expand Down
8 changes: 4 additions & 4 deletions ClipyTests/EntitlementGateTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1218,10 +1218,10 @@ final class BoardManPanelLayoutTests {
#expect((titleField?.frame.width ?? 0) >= 250,
"Snippet title editor is still cramped.")
if let titleField, let statusLabel, let folderToggle, let snippetToggle {
#expect(titleField.frame.minY - statusLabel.frame.maxY >= 16,
"Snippet editor status needs deliberate breathing room below the title field.")
#expect(statusLabel.frame.minY - folderToggle.frame.maxY >= 10,
"Snippet editor status should have balanced spacing above the enable controls.")
#expect(titleField.frame.minY - statusLabel.frame.maxY >= 24,
"Snippet editor status needs a full spacing step below the title field.")
#expect(statusLabel.frame.minY - folderToggle.frame.maxY >= 14,
"Snippet editor status should keep visible breathing room above the enable controls.")
#expect(abs(folderToggle.frame.midY - snippetToggle.frame.midY) <= 0.5)
#expect(titleField.frame.maxY <= (titleField.superview?.bounds.maxY ?? titleField.frame.maxY) - 12,
"Snippet title needs deliberate top padding.")
Expand Down
Loading