From 29618e9bd620eb82316278dfc8e186ffc5438431 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=94=9C=E6=AA=B8Cirtron?= <45784494+lcandy2@users.noreply.github.com> Date: Tue, 24 Dec 2024 16:34:23 +0800 Subject: [PATCH] feat: add open output folder button --- TinyPNG4Mac/TinyPNG4Mac/views/TaskRowView.swift | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/TinyPNG4Mac/TinyPNG4Mac/views/TaskRowView.swift b/TinyPNG4Mac/TinyPNG4Mac/views/TaskRowView.swift index d69e975..2c408d2 100644 --- a/TinyPNG4Mac/TinyPNG4Mac/views/TaskRowView.swift +++ b/TinyPNG4Mac/TinyPNG4Mac/views/TaskRowView.swift @@ -78,6 +78,18 @@ struct TaskRowView: View { Text(task.statusText()) .font(.system(size: 12, weight: statusTextWeight(task.status))) .foregroundStyle(statusTextColor(task.status)) + + if task.status == .completed, let outputUrl = task.outputUrl { + Button { + NSWorkspace.shared.open(outputUrl.deletingLastPathComponent()) + } label: { + Image(systemName: "folder.fill") + .font(.system(size: 14)) + .foregroundStyle(Color("textSecondary")) + } + .buttonStyle(BorderlessButtonStyle()) + .help("Open Output Folder") + } } } }