@@ -346,17 +346,27 @@ final class FooterSection {
346346
347347 // Production builds show marketing version without build number;
348348 // dev/test builds (0.0.0) show only build number
349- let versionText : String
350- if AppInfo . shortVersion == " 0.0.0 " {
351- versionText = " build \( AppInfo . buildNumber) · llama.cpp \( AppInfo . llamaCppVersion) "
352- } else {
353- versionText = " \( AppInfo . shortVersion) · llama.cpp \( AppInfo . llamaCppVersion) "
354- }
355-
356- let versionLabel = Typography . makePrimaryLabel ( versionText)
357- versionLabel. textColor = . tertiaryLabelColor
358- versionLabel. lineBreakMode = . byTruncatingMiddle
359- versionLabel. translatesAutoresizingMaskIntoConstraints = false
349+ let appVersionText =
350+ AppInfo . shortVersion == " 0.0.0 "
351+ ? " build \( AppInfo . buildNumber) "
352+ : AppInfo . shortVersion
353+
354+ let versionButton = NSButton ( title: " " , target: self , action: #selector( checkForUpdates) )
355+ versionButton. isBordered = false
356+ versionButton. translatesAutoresizingMaskIntoConstraints = false
357+ versionButton. lineBreakMode = . byTruncatingMiddle
358+ versionButton. attributedTitle = NSAttributedString (
359+ string: appVersionText,
360+ attributes: [
361+ . font: Typography . primary,
362+ . foregroundColor: NSColor . tertiaryLabelColor,
363+ ] )
364+ ( versionButton. cell as? NSButtonCell ) ? . highlightsBy = [ ]
365+
366+ let llamaCppLabel = Typography . makePrimaryLabel ( " · llama.cpp \( AppInfo . llamaCppVersion) " )
367+ llamaCppLabel. textColor = . tertiaryLabelColor
368+ llamaCppLabel. lineBreakMode = . byTruncatingMiddle
369+ llamaCppLabel. translatesAutoresizingMaskIntoConstraints = false
360370
361371 let settingsButton = NSButton (
362372 title: " Settings " , target: self , action: #selector( toggleSettings) )
@@ -370,7 +380,8 @@ final class FooterSection {
370380 quitButton. bezelStyle = . texturedRounded
371381 quitButton. translatesAutoresizingMaskIntoConstraints = false
372382
373- container. addSubview ( versionLabel)
383+ container. addSubview ( versionButton)
384+ container. addSubview ( llamaCppLabel)
374385 container. addSubview ( settingsButton)
375386 container. addSubview ( quitButton)
376387
@@ -379,9 +390,12 @@ final class FooterSection {
379390 NSLayoutConstraint . activate ( [
380391 container. widthAnchor. constraint ( equalToConstant: Layout . menuWidth) ,
381392 container. heightAnchor. constraint ( greaterThanOrEqualToConstant: 28 ) ,
382- versionLabel . leadingAnchor. constraint (
393+ versionButton . leadingAnchor. constraint (
383394 equalTo: container. leadingAnchor, constant: horizontalPadding) ,
384- versionLabel. centerYAnchor. constraint ( equalTo: container. centerYAnchor) ,
395+ versionButton. centerYAnchor. constraint ( equalTo: container. centerYAnchor) ,
396+
397+ llamaCppLabel. leadingAnchor. constraint ( equalTo: versionButton. trailingAnchor) ,
398+ llamaCppLabel. centerYAnchor. constraint ( equalTo: container. centerYAnchor) ,
385399
386400 settingsButton. trailingAnchor. constraint (
387401 equalTo: quitButton. leadingAnchor, constant: - 8 ) ,
@@ -391,7 +405,7 @@ final class FooterSection {
391405 equalTo: container. trailingAnchor, constant: - horizontalPadding) ,
392406 quitButton. centerYAnchor. constraint ( equalTo: container. centerYAnchor) ,
393407
394- versionLabel . trailingAnchor. constraint (
408+ llamaCppLabel . trailingAnchor. constraint (
395409 lessThanOrEqualTo: settingsButton. leadingAnchor, constant: - 8 ) ,
396410 ] )
397411
@@ -400,6 +414,10 @@ final class FooterSection {
400414 menu. addItem ( item)
401415 }
402416
417+ @objc private func checkForUpdates( ) {
418+ NotificationCenter . default. post ( name: . LBCheckForUpdates, object: nil )
419+ }
420+
403421 @objc private func toggleSettings( ) {
404422 NotificationCenter . default. post ( name: . LBToggleSettingsVisibility, object: nil )
405423 }
0 commit comments