From d75c281d82694c83960e6b4cf07401ac6b18876b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=A1rady=20Mil=C3=A1n?= <61704770+MilanVarady@users.noreply.github.com> Date: Mon, 13 Jan 2025 20:25:21 +0100 Subject: [PATCH] Update some buttons --- .../App Views/App View/AppView+GetInfoButton.swift | 1 + .../App View/AppView+OpenAndManageView.swift | 1 + Applite/Views/App Views/AppliteAppView.swift | 2 +- .../Detail Views/Update/UpdateView+ToolbarItems.swift | 11 ++--------- Applite/Views/Detail Views/Update/UpdateView.swift | 1 - 5 files changed, 5 insertions(+), 11 deletions(-) diff --git a/Applite/Views/App Views/App View/AppView+GetInfoButton.swift b/Applite/Views/App Views/App View/AppView+GetInfoButton.swift index 8461ce9..baa3e5b 100644 --- a/Applite/Views/App Views/App View/AppView+GetInfoButton.swift +++ b/Applite/Views/App Views/App View/AppView+GetInfoButton.swift @@ -30,6 +30,7 @@ extension AppView { alert.show(error: error, title: "Failed to gather cask info") logger.error("Failed to gather additional cask info: \(error.localizedDescription)") } + .asyncButtonStyle(.trailing) .alertManager(alert) } } diff --git a/Applite/Views/App Views/App View/AppView+OpenAndManageView.swift b/Applite/Views/App Views/App View/AppView+OpenAndManageView.swift index 8caa2ad..c7cd788 100644 --- a/Applite/Views/App Views/App View/AppView+OpenAndManageView.swift +++ b/Applite/Views/App Views/App View/AppView+OpenAndManageView.swift @@ -32,6 +32,7 @@ extension AppView { .onButtonError { error in showAppNotFoundAlert = true } + .asyncButtonStyle(.none) .alert("Applite couldn't open \(cask.info.name)", isPresented: $showAppNotFoundAlert) {} if deleteButton { diff --git a/Applite/Views/App Views/AppliteAppView.swift b/Applite/Views/App Views/AppliteAppView.swift index bd4efc2..7747476 100755 --- a/Applite/Views/App Views/AppliteAppView.swift +++ b/Applite/Views/App Views/AppliteAppView.swift @@ -37,7 +37,7 @@ struct AppliteAppView: View { CheckForUpdatesView(updater: updaterController.updater) { Label("Update", systemImage: "arrow.uturn.down") - .foregroundColor(.blue) + .buttonStyle(.borderedProminent) } .clipShape(Capsule()) diff --git a/Applite/Views/Detail Views/Update/UpdateView+ToolbarItems.swift b/Applite/Views/Detail Views/Update/UpdateView+ToolbarItems.swift index a4f1452..5ae61b7 100644 --- a/Applite/Views/Detail Views/Update/UpdateView+ToolbarItems.swift +++ b/Applite/Views/Detail Views/Update/UpdateView+ToolbarItems.swift @@ -12,13 +12,7 @@ extension UpdateView { var toolbarItems: some ToolbarContent { ToolbarItemGroup { greedyUpdateButton - - // Refresh outdated casks - if refreshing { - SmallProgressView() - } else { - refreshButton - } + refreshButton } } @@ -36,6 +30,7 @@ extension UpdateView { .onButtonError { error in loadAlert.show(title: "Failed to load updates", message: error.localizedDescription) } + .asyncButtonStyle(.none) Button("Cancel", role: .cancel) {} } message: { @@ -48,9 +43,7 @@ extension UpdateView { private var refreshButton: some View { AsyncButton { - refreshing = true try await caskManager.refreshOutdated() - refreshing = false } label: { Image(systemName: "arrow.clockwise") } diff --git a/Applite/Views/Detail Views/Update/UpdateView.swift b/Applite/Views/Detail Views/Update/UpdateView.swift index e320c58..6761748 100755 --- a/Applite/Views/Detail Views/Update/UpdateView.swift +++ b/Applite/Views/Detail Views/Update/UpdateView.swift @@ -14,7 +14,6 @@ struct UpdateView: View { @EnvironmentObject var caskManager: CaskManager @State var searchText = "" - @State var refreshing = false @State var isUpdatingAll = false @State var updateAllButtonRotation = 0.0