Skip to content

Commit

Permalink
Fix #484. Remove "Shadowsocks-NG" and keep the "SIP002" and "Legacy" …
Browse files Browse the repository at this point in the history
…on the qrcode.
  • Loading branch information
qiuyuzhou committed Sep 16, 2017
1 parent 19c8d04 commit a32bd42
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions ShadowsocksX-NG/SWBQRCodeWindowController.m
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ - (void)windowDidLoad {
[super windowDidLoad];

// Implement this method to handle any initialization after your window controller's window has been loaded from its nib file.
[self setQRCode:self.qrCode withOverlayText:@"Shadowsocks-NG SIP002"];
[self setQRCode:self.qrCode withOverlayText:@"SIP002"];
}

- (void)setQRCode:(NSString*) qrCode withOverlayText: (NSString*) text {
Expand All @@ -35,14 +35,9 @@ - (void)setQRCode:(NSString*) qrCode withOverlayText: (NSString*) text {
};
NSMutableAttributedString* attrsText = [[NSMutableAttributedString alloc] initWithString: text
attributes: attrs];
[attrsText setAttributes:@{
NSForegroundColorAttributeName: [NSColor darkGrayColor],
NSBackgroundColorAttributeName: [NSColor whiteColor],
NSFontAttributeName: [NSFont fontWithName:@"Helvetica" size:(CGFloat)16],
} range: NSMakeRange(0, 14)];

[image lockFocus];
[attrsText drawAtPoint: NSMakePoint(45, 8)];
[attrsText drawAtPoint: NSMakePoint(100, 5)];
[image unlockFocus];
}
self.imageView.image = image;
Expand Down Expand Up @@ -108,9 +103,9 @@ - (IBAction) copyQRCode: (id) sender{
- (void)flagsChanged:(NSEvent *)event {
NSUInteger modifiers = event.modifierFlags & NSDeviceIndependentModifierFlagsMask;
if (modifiers & NSAlternateKeyMask) {
[self setQRCode:self.legacyQRCode withOverlayText:@"Shadowsocks-NG Legacy"];
[self setQRCode:self.legacyQRCode withOverlayText:@"Legacy"];
} else {
[self setQRCode:self.qrCode withOverlayText:@"Shadowsocks-NG SIP002"];
[self setQRCode:self.qrCode withOverlayText:@"SIP002"];
}
}

Expand Down

0 comments on commit a32bd42

Please sign in to comment.