CoCalc provides the best real-time collaborative environment for Jupyter Notebooks, LaTeX documents, and SageMath, scalable from individual users to large groups and classes!
CoCalc provides the best real-time collaborative environment for Jupyter Notebooks, LaTeX documents, and SageMath, scalable from individual users to large groups and classes!
Path: blob/master/SDL/PPSSPPAboutViewController.m
Views: 1401
//1// PPSSPPAboutViewController.m2// PPSSPP3//4// Created by Serena on 23/04/2023.5//67#import <Cocoa/Cocoa.h> // AppKit ftw8#import "PPSSPPAboutViewController.h"910#if !__has_feature(objc_arc)11#error Caveman detected (warning emoji) please enable arc with -fobjc-arc12#endif1314extern const char *PPSSPP_GIT_VERSION;1516@implementation PPSSPPAboutViewController17- (void)loadView {18self.view = [[NSView alloc] init];19[self.view setFrameSize:CGSizeMake(500, 180)];20}2122- (void)viewDidLoad {23[super viewDidLoad];2425NSImageView *imageView = [[NSImageView alloc] init];26imageView.translatesAutoresizingMaskIntoConstraints = NO;27imageView.image = [NSImage imageNamed:@"ppsspp.icns"];;28[self.view addSubview:imageView];2930NSTextField *titleLabel = [NSTextField labelWithString:@"PPSSPP"];31titleLabel.translatesAutoresizingMaskIntoConstraints = NO;32titleLabel.font = [NSFont systemFontOfSize:38];33[self.view addSubview:titleLabel];3435NSTextField *versionLabel = [NSTextField labelWithString:@(PPSSPP_GIT_VERSION)];36versionLabel.translatesAutoresizingMaskIntoConstraints = NO;37versionLabel.textColor = [NSColor secondaryLabelColor];38versionLabel.selectable = YES; /* in case someone wants to copy the version */39[self.view addSubview:versionLabel];4041NSTextField *descriptionLabel = [NSTextField wrappingLabelWithString:@"A PSP emulator for Android, Windows, Mac and Linux, written in C++"];42descriptionLabel.translatesAutoresizingMaskIntoConstraints = NO;4344if (@available(macOS 11.0, *)) {45descriptionLabel.font = [NSFont preferredFontForTextStyle:NSFontTextStyleSubheadline options:@{}];46} else {47descriptionLabel.font = [NSFont systemFontOfSize:10];48}4950descriptionLabel.textColor = [NSColor colorWithRed:0.60 green:0.60 blue:0.60 alpha:1.0];51[self.view addSubview:descriptionLabel];5253NSButton *sourceCodeButton = [NSButton buttonWithTitle:@"Source Code" target:self action:@selector(sourceCodeButtonTapped)];54sourceCodeButton.bezelStyle = NSBezelStyleRounded;5556NSButton *discordButton = [NSButton buttonWithTitle:@"Join Discord" target:self action: @selector(joinDiscord)];57discordButton.bezelStyle = NSBezelStyleRounded;5859NSStackView *stackView = [NSStackView stackViewWithViews:@[discordButton, sourceCodeButton]];60stackView.translatesAutoresizingMaskIntoConstraints = NO;61[self.view addSubview:stackView];6263[NSLayoutConstraint activateConstraints:@[64[imageView.centerYAnchor constraintEqualToAnchor:self.view.centerYAnchor],65[imageView.leadingAnchor constraintEqualToAnchor:self.view.leadingAnchor constant:40],6667[titleLabel.leadingAnchor constraintEqualToAnchor:imageView.trailingAnchor constant:15],68[titleLabel.centerYAnchor constraintEqualToAnchor:imageView.topAnchor constant:25],6970[versionLabel.leadingAnchor constraintEqualToAnchor:titleLabel.leadingAnchor],71[versionLabel.centerYAnchor constraintEqualToAnchor:titleLabel.bottomAnchor constant:5],7273[descriptionLabel.leadingAnchor constraintEqualToAnchor:versionLabel.leadingAnchor],74[descriptionLabel.trailingAnchor constraintLessThanOrEqualToAnchor: self.view.trailingAnchor],75[descriptionLabel.centerYAnchor constraintEqualToAnchor:versionLabel.bottomAnchor constant:20],7677[stackView.trailingAnchor constraintEqualToAnchor:self.view.trailingAnchor constant:-26.4],78[stackView.centerYAnchor constraintEqualToAnchor:self.view.bottomAnchor constant:-25]79]];80}8182-(void)sourceCodeButtonTapped {83[[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:@"https://github.com/hrydgard/ppsspp"]];84}8586-(void)joinDiscord {87[[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:@"https://discord.gg/5NJB6dD"]];88}8990@end919293