Skip to content

Commit

Permalink
UI tweaks (nit-picking)
Browse files Browse the repository at this point in the history
  • Loading branch information
cyanzhong committed Nov 20, 2024
1 parent 6ec5e46 commit 14e7988
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions LunarBarMac/Sources/Main/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ class AppDelegate: NSObject, NSApplicationDelegate {
private var popoverClosedTime: TimeInterval = 0

func applicationDidFinishLaunching(_ notification: Notification) {
// We rely on tooltips a lot, this changes the initial delay to 800ms to be faster
UserDefaults.standard.setValue(800, forKey: "NSInitialToolTipDelay")
// We rely on tooltips to display information, change the initial delay to 1s to be faster
UserDefaults.standard.setValue(1000, forKey: "NSInitialToolTipDelay")

// Prepare public holiday data
_ = HolidayManager.default
Expand Down
4 changes: 2 additions & 2 deletions LunarBarMac/Sources/Main/AppMainVC+Menu.swift
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ private extension AppMainVC {
item.setOn(AppPreferences.General.menuBarIcon == .date)

if let image = AppIconFactory.createDateIcon() {
item.image = image.resized(with: CGSize(width: 17, height: 12))
item.image = image.resized(with: CGSize(width: 16.8, height: 12)) // 1.4:1
} else {
Logger.assertFail("Failed to create the icon")
}
Expand All @@ -162,9 +162,9 @@ private extension AppMainVC {

// Dark mode preferences
[
(Localized.UI.menuTitleSystem, Appearance.system),
(Localized.UI.menuTitleLight, Appearance.light),
(Localized.UI.menuTitleDark, Appearance.dark),
(Localized.UI.menuTitleSystem, Appearance.system),
].forEach { (title: String, appearance: Appearance) in
menu.addItem(withTitle: title) { [weak self] in
self?.updateAppearance(appearance)
Expand Down
2 changes: 1 addition & 1 deletion LunarBarMac/Sources/Shared/AppDefinitions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ enum Localized {
static let menuTitleAppearance = String(localized: "Appearance", comment: "[Menu] Change dark mode preference")
static let menuTitleCalendarIcon = String(localized: "Calendar Icon", comment: "[Menu] Use a calendar icon as the menu bar icon")
static let menuTitleCurrentDate = String(localized: "Current Date", comment: "[Menu] Use the current date as the menu bar icon")
static let menuTitleSystem = String(localized: "System", comment: "[Menu] Follow the system appearance")
static let menuTitleLight = String(localized: "Light", comment: "[Menu] Use the light appearance")
static let menuTitleDark = String(localized: "Dark", comment: "[Menu] Use the dark appearance")
static let menuTitleSystem = String(localized: "System", comment: "[Menu] Follow the system appearance")
static let menuTitleReduceMotion = String(localized: "Reduce Motion", comment: "[Menu] Disable animations when presenting the calendar popover")
static let menuTitleReduceTransparency = String(localized: "Reduce Transparency", comment: "[Menu] Reduce transparency of the calendar panel")
static let menuTitleFloatOnTop = String(localized: "Float on Top", comment: "[Menu] Float the popover on top")
Expand Down
2 changes: 1 addition & 1 deletion LunarBarMac/Sources/Shared/AppIconFactory.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ enum AppIconFactory {

private class DateIconView: NSView {
private enum Constants {
static let iconSize = CGSize(width: 20, height: 14)
static let iconSize = CGSize(width: 21, height: 15)
static let fontSize: Double = 12
static let cornerRadius: Double = 2.5
}
Expand Down
8 changes: 4 additions & 4 deletions LunarBarMac/Sources/Shared/AppPreferences.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ enum AppPreferences {
@Storage(key: "general.initial-launch", defaultValue: true)
static var initialLaunch: Bool

@Storage(key: "general.menu-bar-icon", defaultValue: .calendar)
@Storage(key: "general.menu-bar-icon", defaultValue: .date)
static var menuBarIcon: MenuBarIcon {
didSet {
guard let delegate = NSApp.delegate as? AppDelegate else {
Expand Down Expand Up @@ -64,19 +64,19 @@ enum MenuBarIcon: Codable {
}

enum Appearance: Codable {
case system
case light
case dark
case system

@MainActor
func resolved(with appearance: NSAppearance = NSApp.effectiveAppearance) -> NSAppearance? {
switch self {
case .system:
return nil
case .light:
return NSAppearance(named: appearance.resolvedName(isDarkMode: false))
case .dark:
return NSAppearance(named: appearance.resolvedName(isDarkMode: true))
case .system:
return nil
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion LunarBarMac/Sources/Views/DateGridCell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ private extension DateGridCell {
}

let showDetails = {
try await Task.sleep(for: .seconds(0.8))
try await Task.sleep(for: .seconds(0.6))
let popover = DateDetailsView.createPopover(
title: self.mainInfo,
events: self.cellEvents
Expand Down

0 comments on commit 14e7988

Please sign in to comment.