mirror of
https://github.com/AgentSeal/codeburn.git
synced 2026-04-28 15:09:43 +00:00
fix(menubar): variable width for both compact and default mode
This commit is contained in:
parent
46f945fd72
commit
3355e3699e
1 changed files with 2 additions and 5 deletions
|
|
@ -5,9 +5,7 @@ import Observation
|
|||
private let refreshIntervalSeconds: UInt64 = 15
|
||||
private let nanosPerSecond: UInt64 = 1_000_000_000
|
||||
private let refreshIntervalNanos: UInt64 = refreshIntervalSeconds * nanosPerSecond
|
||||
/// Fixed so the popover's anchor point doesn't shift each time today's cost changes.
|
||||
private let statusItemFixedWidth: CGFloat = 130
|
||||
private let statusItemCompactWidth: CGFloat = NSStatusItem.variableLength
|
||||
private let statusItemWidth: CGFloat = NSStatusItem.variableLength
|
||||
private let popoverWidth: CGFloat = 360
|
||||
private let popoverHeight: CGFloat = 660
|
||||
private let menubarTitleFontSize: CGFloat = 13
|
||||
|
|
@ -127,8 +125,7 @@ final class AppDelegate: NSObject, NSApplicationDelegate, NSPopoverDelegate {
|
|||
}
|
||||
|
||||
private func setupStatusItem() {
|
||||
let width = isCompact ? statusItemCompactWidth : statusItemFixedWidth
|
||||
statusItem = NSStatusBar.system.statusItem(withLength: width)
|
||||
statusItem = NSStatusBar.system.statusItem(withLength: statusItemWidth)
|
||||
guard let button = statusItem.button else { return }
|
||||
button.target = self
|
||||
button.action = #selector(handleButtonClick(_:))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue