Skip to content

Commit 4726b6b

Browse files
authored
Merge pull request #5 from Shakshi3104/develop
Support M2 and improved features
2 parents 516255a + 4e4d16a commit 4726b6b

File tree

2 files changed

+17
-5
lines changed

2 files changed

+17
-5
lines changed

Gaufre.xcodeproj/project.pbxproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@
316316
"$(inherited)",
317317
"@executable_path/../Frameworks",
318318
);
319-
MARKETING_VERSION = 2.0.0;
319+
MARKETING_VERSION = 3.0.0;
320320
PRODUCT_BUNDLE_IDENTIFIER = com.shakshi.macos.Gaufre;
321321
PRODUCT_NAME = "$(TARGET_NAME)";
322322
SWIFT_EMIT_LOC_STRINGS = YES;
@@ -345,7 +345,7 @@
345345
"$(inherited)",
346346
"@executable_path/../Frameworks",
347347
);
348-
MARKETING_VERSION = 2.0.0;
348+
MARKETING_VERSION = 3.0.0;
349349
PRODUCT_BUNDLE_IDENTIFIER = com.shakshi.macos.Gaufre;
350350
PRODUCT_NAME = "$(TARGET_NAME)";
351351
SWIFT_EMIT_LOC_STRINGS = YES;

Gaufre/AppDelegate.swift

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,11 @@ class AppDelegate: NSObject, NSApplicationDelegate {
3535
// MARK: - Build status bar
3636
func buildMenu() {
3737

38+
// if Intel Mac, status bar icon is fill icon
39+
let statusBarSymbolName = MacDeviceHardware.deviceHardware.processorName.contains("Apple") ? "grid.circle" : "grid.circle.fill"
40+
3841
if let statusBarButton = statusItem.button {
39-
statusBarButton.image = NSImage(systemSymbolName: "grid.circle",
42+
statusBarButton.image = NSImage(systemSymbolName: statusBarSymbolName,
4043
accessibilityDescription: "app icon")
4144
statusBarButton.image?.size = NSSize(width: 18.0, height: 18.0)
4245
statusBarButton.image?.isTemplate = true
@@ -55,8 +58,8 @@ class AppDelegate: NSObject, NSApplicationDelegate {
5558
wafersView = NSHostingView(rootView: WafersView(processor: processor) .scaleEffect(0.55))
5659
#endif
5760

58-
let width = coreCount < 30 ? 20 * coreCount + 40 : 20 * coreCount / 2 + 40
59-
let height = coreCount < 30 ? 100 : 160
61+
let width = coreCount < 30 ? 20 * coreCount + 45 : 20 * coreCount / 2 + 45
62+
let height = coreCount < 30 ? 90 : 160
6063

6164
wafersView.frame = NSRect(x: 0, y: 0, width: width, height: height)
6265

@@ -67,6 +70,15 @@ class AppDelegate: NSObject, NSApplicationDelegate {
6770
let mainMenu = NSMenu()
6871
mainMenu.addItem(coreInfoItem)
6972

73+
// Processor name
74+
let processorName: String
75+
#if DEBUG
76+
processorName = "DEBUG"
77+
#else
78+
processorName = MacDeviceHardware.deviceHardware.processorName
79+
#endif
80+
mainMenu.addItem(withTitle: processorName, action: nil, keyEquivalent: "")
81+
7082
// separater
7183
mainMenu.addItem(NSMenuItem.separator())
7284

0 commit comments

Comments
 (0)