Skip to content

Commit

Permalink
Merge pull request #16 from ohaiibuzzle/fix/ui-tweaks
Browse files Browse the repository at this point in the history
fix: some small UI tweaks
  • Loading branch information
ohaiibuzzle authored Jun 15, 2023
2 parents 6a97497 + 73519f7 commit eb25afe
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 22 deletions.
1 change: 1 addition & 0 deletions Harbor/UIElements/GPKDownload/BrewInstallView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ struct BrewInstallView: View {
}
}
.padding()
.frame(minHeight: 300)
}
}

Expand Down
5 changes: 3 additions & 2 deletions Harbor/UIElements/GPKDownload/GPKFastInstallView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ struct GPKFastInstallView: View {
panel.canChooseFiles = true
panel.canChooseDirectories = false
panel.allowsMultipleSelection = false
panel.allowedFileTypes = ["gz"]
panel.allowedContentTypes = [.gzip]
panel.begin { response in
if response == .OK {
let result = panel.url
Expand All @@ -79,7 +79,7 @@ struct GPKFastInstallView: View {
panel.canChooseFiles = true
panel.canChooseDirectories = false
panel.allowsMultipleSelection = false
panel.allowedFileTypes = ["dmg"]
panel.allowedContentTypes = [.diskImage]
panel.begin { response in
if response == .OK {
let result = panel.url
Expand Down Expand Up @@ -146,6 +146,7 @@ struct GPKFastInstallView: View {
}
}
.padding()
.frame(minHeight: 300)
}
}

Expand Down
3 changes: 2 additions & 1 deletion Harbor/UIElements/GPKDownload/GPKSafeInstallView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ struct GPKSafeInstallView: View {
panel.canChooseFiles = true
panel.canChooseDirectories = false
panel.allowsMultipleSelection = false
panel.allowedFileTypes = ["dmg"]
panel.allowedContentTypes = [.diskImage]
panel.begin { response in
if response == .OK {
let result = panel.url
Expand Down Expand Up @@ -108,6 +108,7 @@ struct GPKSafeInstallView: View {
}
}
.padding()
.frame(minHeight: 300)
}
}

Expand Down
1 change: 1 addition & 0 deletions Harbor/UIElements/GPKDownload/XCLIInstallView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ struct XCLIInstallView: View {
Spacer()
}
}
.frame(minHeight: 300)
}
}

Expand Down
37 changes: 18 additions & 19 deletions Harbor/Views/BottleManagementView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,24 +19,25 @@ struct BottleManagementView: View {
@State private var sortOrder = [KeyPathComparator(\HarborBottle.name)]
var body: some View {
VStack {
Text("home.bottles.title")
.font(.title)
.padding()

Text("home.bottles.subtitle")
.padding()
.multilineTextAlignment(.center)
}
VStack {
Text("home.bottles.title")
.font(.title)
.padding()
Text("home.bottles.subtitle")
.padding()
.multilineTextAlignment(.center)
}

Table(bottles, selection: $selectedBottle, sortOrder: $sortOrder) {
TableColumn("home.table.name", value: \.name)
TableColumn("home.table.path", value: \.path.relativeString)
TableColumn("home.table.primaryApp", value: \.primaryApplicationPath)
}
.padding()
.frame(minWidth: 500, minHeight: 200)
.onChange(of: sortOrder) { _, newOrder in
bottles.sort(using: newOrder)
Table(bottles, selection: $selectedBottle, sortOrder: $sortOrder) {
TableColumn("home.table.name", value: \.name)
TableColumn("home.table.path", value: \.path.relativeString)
TableColumn("home.table.primaryApp", value: \.primaryApplicationPath)
}
.padding()
.frame(minWidth: 500, minHeight: 200)
.onChange(of: sortOrder) { _, newOrder in
bottles.sort(using: newOrder)
}
}
.toolbar {
ToolbarItem(placement: .automatic) {
Expand Down Expand Up @@ -104,7 +105,6 @@ struct BottleManagementView: View {
alert.accessoryView = checkbox
alert.addButton(withTitle: String(localized: "btn.delete"))
alert.addButton(withTitle: String(localized: "btn.cancel"))

if alert.runModal() == .alertFirstButtonReturn {
// User clicked on "Delete"
if let thisBottle = bottles.first(where: { $0.id == selectedBottle }) {
Expand All @@ -123,7 +123,6 @@ struct BottleManagementView: View {
.disabled(selectedBottle == nil)
}
}

.sheet(isPresented: $showNewBottleSheet) {
NewBottleDropdown(isPresented: $showNewBottleSheet,
bottle: HarborBottle(id: UUID(), name: "", path: URL(fileURLWithPath: "")))
Expand Down

0 comments on commit eb25afe

Please sign in to comment.