From abc8fd7911b901706074b1404e667d058d145c8b Mon Sep 17 00:00:00 2001 From: maxkadushkin Date: Wed, 15 Nov 2023 17:47:44 +0300 Subject: [PATCH] [macos] fix bug 65074 --- .../Controllers/About/ASCAboutController.m | 32 ++++++++++++------- 1 file changed, 21 insertions(+), 11 deletions(-) diff --git a/macos/ONLYOFFICE/Code/Controllers/About/ASCAboutController.m b/macos/ONLYOFFICE/Code/Controllers/About/ASCAboutController.m index 2f9b8ea6c..2dc9df3e1 100644 --- a/macos/ONLYOFFICE/Code/Controllers/About/ASCAboutController.m +++ b/macos/ONLYOFFICE/Code/Controllers/About/ASCAboutController.m @@ -116,18 +116,11 @@ [self.appNameText setStringValue:locProductName]; // Version - [self.versionText setStringValue:[NSString stringWithFormat:NSLocalizedString(@"Version %@ (%@.%@)", nil), - [infoDictionary objectForKey:@"CFBundleShortVersionString"], - [infoDictionary objectForKey:@"CFBundleVersion"], - [infoDictionary objectForKey:@"ASCBundleBuildNumber"]]]; + [self.versionText setStringValue:[NSString stringWithFormat:NSLocalizedString(@"Version %@", nil), + [infoDictionary objectForKey:@"CFBundleShortVersionString"]]]; -#if _V8_VERSION - [self.versionText setStringValue:[NSString stringWithFormat:@"%@ x86", [self.versionText stringValue]]]; -#elif _X86_64_ONLY - [self.versionText setStringValue:[NSString stringWithFormat:@"%@ x86_64", [self.versionText stringValue]]]; -#elif _ARM_ONLY - [self.versionText setStringValue:[NSString stringWithFormat:@"%@ Apple Silicon", [self.versionText stringValue]]]; -#endif + NSClickGestureRecognizer *click = [[NSClickGestureRecognizer alloc] initWithTarget:self action:@selector(onVersionClick:)]; + [self.versionText addGestureRecognizer:click]; // If has extra features if ([[[ASCSharedSettings sharedInstance] settingByKey:kSettingsHasExtraFeatures] boolValue]) { @@ -166,4 +159,21 @@ [NSApp stopModal]; } +- (void)onVersionClick:(NSTextField *)sender { + NSDictionary * infoDictionary = [[NSBundle mainBundle] infoDictionary]; + + [self.versionText setStringValue:[NSString stringWithFormat:NSLocalizedString(@"Version %@ (%@-%@)", nil), + [infoDictionary objectForKey:@"CFBundleShortVersionString"], + [infoDictionary objectForKey:@"CFBundleVersion"], + [infoDictionary objectForKey:@"ASCBundleBuildNumber"]]]; + +#if _V8_VERSION + [self.versionText setStringValue:[NSString stringWithFormat:@"%@ x86", [self.versionText stringValue]]]; +#elif _X86_64_ONLY + [self.versionText setStringValue:[NSString stringWithFormat:@"%@ x86_64", [self.versionText stringValue]]]; +#elif _ARM_ONLY + [self.versionText setStringValue:[NSString stringWithFormat:@"%@ Apple Silicon", [self.versionText stringValue]]]; +#endif +} + @end