Skip to content

Commit 3355e36

Browse files
committed
fix(menubar): variable width for both compact and default mode
1 parent 46f945f commit 3355e36

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

mac/Sources/CodeBurnMenubar/CodeBurnApp.swift

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,7 @@ import Observation
55
private let refreshIntervalSeconds: UInt64 = 15
66
private let nanosPerSecond: UInt64 = 1_000_000_000
77
private let refreshIntervalNanos: UInt64 = refreshIntervalSeconds * nanosPerSecond
8-
/// Fixed so the popover's anchor point doesn't shift each time today's cost changes.
9-
private let statusItemFixedWidth: CGFloat = 130
10-
private let statusItemCompactWidth: CGFloat = NSStatusItem.variableLength
8+
private let statusItemWidth: CGFloat = NSStatusItem.variableLength
119
private let popoverWidth: CGFloat = 360
1210
private let popoverHeight: CGFloat = 660
1311
private let menubarTitleFontSize: CGFloat = 13
@@ -127,8 +125,7 @@ final class AppDelegate: NSObject, NSApplicationDelegate, NSPopoverDelegate {
127125
}
128126

129127
private func setupStatusItem() {
130-
let width = isCompact ? statusItemCompactWidth : statusItemFixedWidth
131-
statusItem = NSStatusBar.system.statusItem(withLength: width)
128+
statusItem = NSStatusBar.system.statusItem(withLength: statusItemWidth)
132129
guard let button = statusItem.button else { return }
133130
button.target = self
134131
button.action = #selector(handleButtonClick(_:))

0 commit comments

Comments
 (0)