feat: more appealing presentation + minor refac

This commit is contained in:
louis.pontoise authored and lwouis committed 2020-03-10 14:00:37 +09:00
1 parent 9fa0c06a9f
commit 67f291d1fe
3 files changed
+15 -8

No files matched your search

+1
View File
@@ -6,6 +6,7 @@ let cgsMainConnectionId = CGSMainConnectionID()
class App: NSApplication, NSApplicationDelegate, NSWindowDelegate {
static let name = "AltTab"
static let version = "#VERSION#"
static let repository = "https://github.com/lwouis/alt-tab-macos"
var statusItem: NSStatusItem?
var thumbnailsPanel: ThumbnailsPanel?
var preferencesWindow: PreferencesWindow?
+11 -5
View File
@@ -25,11 +25,17 @@ class FeedbackWindow: NSWindow, NSTextViewDelegate {
}
private func setupView() {
let intro = NSStackView(views: [
NSTextField(labelWithString: "Share improvement ideas, or report bugs."),
HyperlinkLabel("View existing tickets", "https://github.com/lwouis/alt-tab-macos/issues"),
let appIcon = NSImageView(image: App.shared.applicationIconImage)
appIcon.fit(80, 80)
let appText = NSStackView(views: [
BoldLabel("Share improvement ideas, or report bugs"),
HyperlinkLabel("View existing discussions", App.repository + "/issues"),
])
intro.spacing = 4
appText.orientation = .vertical
appText.alignment = .left
appText.spacing = GridView.interPadding / 2
let header = NSStackView(views: [appIcon, appText])
header.spacing = GridView.interPadding
sendButton = NSButton(title: "Send", target: nil, action: #selector(sendCallback))
sendButton.keyEquivalent = "\r"
sendButton.isEnabled = false
@@ -42,7 +48,7 @@ class FeedbackWindow: NSWindow, NSTextViewDelegate {
body.delegate = self
email = TextArea(80, 1.1, "Optional: email (if you want a reply)")
let view = GridView.make([
[intro],
[header],
[body],
[email],
[buttons],
@@ -8,7 +8,7 @@ class AboutTab {
private static func makeView() -> NSGridView {
let appIcon = NSImageView(image: App.shared.applicationIconImage)
appIcon.fit(64, 64)
appIcon.fit(80, 80)
let appText = NSStackView(views: [BoldLabel(App.name), NSTextField(wrappingLabelWithString: "Version \(App.version)")])
appText.orientation = .vertical
appText.alignment = .left
@@ -17,8 +17,8 @@ class AboutTab {
appInfo.spacing = GridView.interPadding
let view = GridView.make([
[appInfo],
[HyperlinkLabel("Source code repository", "https://github.com/lwouis/alt-tab-macos")],
[HyperlinkLabel("Latest releases", "https://github.com/lwouis/alt-tab-macos/releases")],
[HyperlinkLabel("Source code repository", App.repository)],
[HyperlinkLabel("Latest releases", App.repository + "/releases")],
])
view.fit()
return view