feat: more appealing presentation + minor refac
This commit is contained in:
1 parent
9fa0c06a9f
commit
67f291d1fe
3 files changed
+15
-8
No files matched your search
@@ -6,6 +6,7 @@ let cgsMainConnectionId = CGSMainConnectionID()
|
|||||||
class App: NSApplication, NSApplicationDelegate, NSWindowDelegate {
|
class App: NSApplication, NSApplicationDelegate, NSWindowDelegate {
|
||||||
static let name = "AltTab"
|
static let name = "AltTab"
|
||||||
static let version = "#VERSION#"
|
static let version = "#VERSION#"
|
||||||
|
static let repository = "https://github.com/lwouis/alt-tab-macos"
|
||||||
var statusItem: NSStatusItem?
|
var statusItem: NSStatusItem?
|
||||||
var thumbnailsPanel: ThumbnailsPanel?
|
var thumbnailsPanel: ThumbnailsPanel?
|
||||||
var preferencesWindow: PreferencesWindow?
|
var preferencesWindow: PreferencesWindow?
|
||||||
|
|||||||
@@ -25,11 +25,17 @@ class FeedbackWindow: NSWindow, NSTextViewDelegate {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private func setupView() {
|
private func setupView() {
|
||||||
let intro = NSStackView(views: [
|
let appIcon = NSImageView(image: App.shared.applicationIconImage)
|
||||||
NSTextField(labelWithString: "Share improvement ideas, or report bugs."),
|
appIcon.fit(80, 80)
|
||||||
HyperlinkLabel("View existing tickets", "https://github.com/lwouis/alt-tab-macos/issues"),
|
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 = NSButton(title: "Send", target: nil, action: #selector(sendCallback))
|
||||||
sendButton.keyEquivalent = "\r"
|
sendButton.keyEquivalent = "\r"
|
||||||
sendButton.isEnabled = false
|
sendButton.isEnabled = false
|
||||||
@@ -42,7 +48,7 @@ class FeedbackWindow: NSWindow, NSTextViewDelegate {
|
|||||||
body.delegate = self
|
body.delegate = self
|
||||||
email = TextArea(80, 1.1, "Optional: email (if you want a reply)")
|
email = TextArea(80, 1.1, "Optional: email (if you want a reply)")
|
||||||
let view = GridView.make([
|
let view = GridView.make([
|
||||||
[intro],
|
[header],
|
||||||
[body],
|
[body],
|
||||||
[email],
|
[email],
|
||||||
[buttons],
|
[buttons],
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ class AboutTab {
|
|||||||
|
|
||||||
private static func makeView() -> NSGridView {
|
private static func makeView() -> NSGridView {
|
||||||
let appIcon = NSImageView(image: App.shared.applicationIconImage)
|
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)")])
|
let appText = NSStackView(views: [BoldLabel(App.name), NSTextField(wrappingLabelWithString: "Version \(App.version)")])
|
||||||
appText.orientation = .vertical
|
appText.orientation = .vertical
|
||||||
appText.alignment = .left
|
appText.alignment = .left
|
||||||
@@ -17,8 +17,8 @@ class AboutTab {
|
|||||||
appInfo.spacing = GridView.interPadding
|
appInfo.spacing = GridView.interPadding
|
||||||
let view = GridView.make([
|
let view = GridView.make([
|
||||||
[appInfo],
|
[appInfo],
|
||||||
[HyperlinkLabel("Source code repository", "https://github.com/lwouis/alt-tab-macos")],
|
[HyperlinkLabel("Source code repository", App.repository)],
|
||||||
[HyperlinkLabel("Latest releases", "https://github.com/lwouis/alt-tab-macos/releases")],
|
[HyperlinkLabel("Latest releases", App.repository + "/releases")],
|
||||||
])
|
])
|
||||||
view.fit()
|
view.fit()
|
||||||
return view
|
return view
|
||||||
|
|||||||
Reference in new issue
Block a user