Skip to content

Commit

Permalink
feat: more appealing presentation + minor refac
Browse files Browse the repository at this point in the history
  • Loading branch information
louis.pontoise authored and lwouis committed Mar 10, 2020
1 parent 9fa0c06 commit 67f291d
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 8 deletions.
1 change: 1 addition & 0 deletions alt-tab-macos/ui/App.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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?
Expand Down
16 changes: 11 additions & 5 deletions alt-tab-macos/ui/FeedbackWindow.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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],
Expand Down
6 changes: 3 additions & 3 deletions alt-tab-macos/ui/preferences-window/tabs/AboutTab.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 67f291d

Please sign in to comment.