-
-
Notifications
You must be signed in to change notification settings - Fork 330
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: nicer layout for about preferences
- Loading branch information
Showing
7 changed files
with
68 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import Cocoa | ||
|
||
class BoldLabel: NSTextField { | ||
convenience init(_ string: String) { | ||
self.init(labelWithString: string) | ||
allowsEditingTextAttributes = true | ||
attributedStringValue = NSAttributedString(string: string, attributes: [ | ||
NSAttributedString.Key.font: NSFont.boldSystemFont(ofSize: NSFont.systemFontSize), | ||
]) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,18 @@ | ||
import Cocoa | ||
|
||
class HyperlinkLabel: NSTextField { | ||
|
||
public convenience init(labelWithUrl stringValue: String, nsUrl: NSURL) { | ||
self.init(labelWithString: stringValue) | ||
convenience init(_ string: String, _ url: NSURL) { | ||
self.init(labelWithString: string) | ||
isSelectable = true | ||
allowsEditingTextAttributes = true | ||
let linkTextAttributes: [NSAttributedString.Key: Any] = [ | ||
NSAttributedString.Key.link: nsUrl as Any, | ||
attributedStringValue = NSAttributedString(string: string, attributes: [ | ||
NSAttributedString.Key.link: url as Any, | ||
NSAttributedString.Key.font: NSFont.labelFont(ofSize: NSFont.systemFontSize), | ||
] | ||
|
||
attributedStringValue = NSAttributedString(string: stringValue, attributes: linkTextAttributes) | ||
]) | ||
} | ||
|
||
// the whole point for this sub-class: always display a pointing-hand cursor (not only when the TextField is focused) | ||
override func resetCursorRects() { | ||
addCursorRect(bounds, cursor: NSCursor.pointingHand) | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters