Skip to content

Commit

Permalink
add version number to icon tooltip
Browse files Browse the repository at this point in the history
  • Loading branch information
Zaid Kokaja committed Mar 12, 2023
1 parent f14a50d commit d0d49fb
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
4 changes: 2 additions & 2 deletions Brewlet.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@
"$(inherited)",
"@executable_path/../Frameworks",
);
MARKETING_VERSION = 1.7;
MARKETING_VERSION = 1.7.3;
PRODUCT_BUNDLE_IDENTIFIER = zzada.Brewlet;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
Expand All @@ -304,7 +304,7 @@
"$(inherited)",
"@executable_path/../Frameworks",
);
MARKETING_VERSION = 1.7;
MARKETING_VERSION = 1.7.3;
PRODUCT_BUNDLE_IDENTIFIER = zzada.Brewlet;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
Expand Down
6 changes: 4 additions & 2 deletions Brewlet/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ class AppDelegate: NSObject, NSApplicationDelegate, PreferencesDelegate {
let userDefaults = UserDefaults.standard
let statusItem: NSStatusItem = NSStatusBar.system.statusItem(withLength: NSStatusItem.variableLength)

let appVersion = Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String

var preferencesWindow: PreferencesController!

struct Service {
Expand All @@ -44,7 +46,7 @@ class AppDelegate: NSObject, NSApplicationDelegate, PreferencesDelegate {

// Set the icon
statusItem.menu = statusMenu
statusItem.button?.toolTip = "Brewlet"
statusItem.button?.toolTip = "Brewlet \(appVersion ?? "")"
statusItem.button?.image = NSImage(named: "BrewletIcon-Black")
statusItem.button?.image?.isTemplate = true

Expand Down Expand Up @@ -170,7 +172,7 @@ class AppDelegate: NSObject, NSApplicationDelegate, PreferencesDelegate {
}

let dateStr = formatDate()
statusItem.button?.toolTip = "Brewlet. Last updated \(dateStr)"
statusItem.button?.toolTip = "Brewlet \(appVersion ?? ""). Last updated \(dateStr)"
}

/**
Expand Down
2 changes: 1 addition & 1 deletion Brewlet/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<key>CFBundleShortVersionString</key>
<string>$(MARKETING_VERSION)</string>
<key>CFBundleVersion</key>
<string>1</string>
<string>$(MARKETING_VERSION).0</string>
<key>LSApplicationCategoryType</key>
<string>public.app-category.productivity</string>
<key>LSMinimumSystemVersion</key>
Expand Down

0 comments on commit d0d49fb

Please sign in to comment.