Skip to content

Commit d0d49fb

Browse files
author
Zaid Kokaja
committed
add version number to icon tooltip
1 parent f14a50d commit d0d49fb

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

Brewlet.xcodeproj/project.pbxproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@
285285
"$(inherited)",
286286
"@executable_path/../Frameworks",
287287
);
288-
MARKETING_VERSION = 1.7;
288+
MARKETING_VERSION = 1.7.3;
289289
PRODUCT_BUNDLE_IDENTIFIER = zzada.Brewlet;
290290
PRODUCT_NAME = "$(TARGET_NAME)";
291291
SWIFT_VERSION = 5.0;
@@ -304,7 +304,7 @@
304304
"$(inherited)",
305305
"@executable_path/../Frameworks",
306306
);
307-
MARKETING_VERSION = 1.7;
307+
MARKETING_VERSION = 1.7.3;
308308
PRODUCT_BUNDLE_IDENTIFIER = zzada.Brewlet;
309309
PRODUCT_NAME = "$(TARGET_NAME)";
310310
SWIFT_VERSION = 5.0;

Brewlet/AppDelegate.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ class AppDelegate: NSObject, NSApplicationDelegate, PreferencesDelegate {
2525
let userDefaults = UserDefaults.standard
2626
let statusItem: NSStatusItem = NSStatusBar.system.statusItem(withLength: NSStatusItem.variableLength)
2727

28+
let appVersion = Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String
29+
2830
var preferencesWindow: PreferencesController!
2931

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

4547
// Set the icon
4648
statusItem.menu = statusMenu
47-
statusItem.button?.toolTip = "Brewlet"
49+
statusItem.button?.toolTip = "Brewlet \(appVersion ?? "")"
4850
statusItem.button?.image = NSImage(named: "BrewletIcon-Black")
4951
statusItem.button?.image?.isTemplate = true
5052

@@ -170,7 +172,7 @@ class AppDelegate: NSObject, NSApplicationDelegate, PreferencesDelegate {
170172
}
171173

172174
let dateStr = formatDate()
173-
statusItem.button?.toolTip = "Brewlet. Last updated \(dateStr)"
175+
statusItem.button?.toolTip = "Brewlet \(appVersion ?? ""). Last updated \(dateStr)"
174176
}
175177

176178
/**

Brewlet/Info.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
<key>CFBundleShortVersionString</key>
2222
<string>$(MARKETING_VERSION)</string>
2323
<key>CFBundleVersion</key>
24-
<string>1</string>
24+
<string>$(MARKETING_VERSION).0</string>
2525
<key>LSApplicationCategoryType</key>
2626
<string>public.app-category.productivity</string>
2727
<key>LSMinimumSystemVersion</key>

0 commit comments

Comments
 (0)