Skip to content

Commit

Permalink
Improve ui of some views
Browse files Browse the repository at this point in the history
  • Loading branch information
zorikon committed Apr 9, 2024
1 parent bd81905 commit 753412c
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 24 deletions.
19 changes: 10 additions & 9 deletions Whisky/Views/Bottle/BottleCreationView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -45,19 +45,22 @@ struct BottleCreationView: View {
}
}

HStack {
HStack(alignment: .top) {
VStack(alignment: .leading) {
Text("create.path")
.foregroundStyle(.primary)
Text(bottlePath)
.foregroundStyle(.secondary)
.truncationMode(.middle)
.lineLimit(2)
.help(bottlePath)
if !bottlePath.isEmpty {
Text(bottlePath)
.font(.callout)
.foregroundStyle(.secondary)
.truncationMode(.middle)
.lineLimit(2)
.help(bottlePath)
}
}

Spacer()
Button {
Button("create.browse") {
let panel = NSOpenPanel()
panel.canChooseFiles = false
panel.canChooseDirectories = true
Expand All @@ -71,8 +74,6 @@ struct BottleCreationView: View {
}
}
}
} label: {
Text("create.browse")
}
}
}
Expand Down
15 changes: 9 additions & 6 deletions Whisky/Views/Bottle/Pins/PinCreationView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,18 @@ struct PinCreationView: View {
Form {
TextField("pin.name", text: $newPinName)

HStack {
HStack(alignment: .top) {
VStack(alignment: .leading) {
Text("pin.path")
.foregroundStyle(.primary)
Text(pinPath)
.foregroundStyle(.secondary)
.truncationMode(.middle)
.lineLimit(2)
.help(pinPath)
if !pinPath.isEmpty {
Text(pinPath)
.font(.callout)
.foregroundStyle(.secondary)
.truncationMode(.middle)
.lineLimit(2)
.help(pinPath)
}
}

Spacer()
Expand Down
19 changes: 10 additions & 9 deletions Whisky/Views/Settings/SettingsView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -31,19 +31,22 @@ struct SettingsView: View {
Form {
Section("settings.general") {
Toggle("settings.toggle.kill.on.terminate", isOn: $killOnTerminate)
HStack {
HStack(alignment: .top) {
VStack(alignment: .leading) {
Text("settings.path")
.foregroundStyle(.primary)
Text(bottlePath)
.foregroundStyle(.secondary)
.truncationMode(.middle)
.lineLimit(2)
.help(bottlePath)
if !bottlePath.isEmpty {
Text(bottlePath)
.font(.callout)
.foregroundStyle(.secondary)
.truncationMode(.middle)
.lineLimit(2)
.help(bottlePath)
}
}

Spacer()
Button {
Button("create.browse") {
let panel = NSOpenPanel()
panel.canChooseFiles = false
panel.canChooseDirectories = true
Expand All @@ -57,8 +60,6 @@ struct SettingsView: View {
}
}
}
} label: {
Text("create.browse")
}
}
}
Expand Down

0 comments on commit 753412c

Please sign in to comment.