Improve buttons

This commit is contained in:
Christoph Hagen
2025-05-04 20:59:45 +02:00
parent f968ccad29
commit d779b7a42c
6 changed files with 31 additions and 41 deletions

View File

@ -51,20 +51,24 @@ struct FileDetailView: View {
text: "A file that can be used in a post or page")
GenericPropertyView(title: "Actions") {
HStack(spacing: 10) {
ButtonIcon(.folder, action: showFileInFinder)
ButtonIcon(.arrowClockwise, action: markFileAsChanged)
if file.isExternallyStored {
ButtonIcon(.squareAndArrowDown, action: replaceFile)
} else {
ButtonIcon(.arrowLeftArrowRight, action: replaceFile)
ButtonIcon(.squareDashed, action: convertToExternal)
}
ButtonIcon(.trash, action: deleteFile)
.foregroundStyle(.red)
ColoredButton(icon: .folder, text: "Show in folder", action: showFileInFinder)
ColoredButton(icon: .arrowClockwise, text: "Mark file as changed", action: markFileAsChanged)
if file.isExternallyStored {
ColoredButton(
icon: .squareAndArrowDown,
text: "Convert to internal file",
action: replaceFile)
} else {
ColoredButton(
icon: .arrowLeftArrowRight,
text: "Replace file",
action: replaceFile)
ColoredButton(
icon: .squareDashed,
text: "Convert to external file",
action: convertToExternal)
}
.buttonStyle(.plain)
.foregroundStyle(.blue)
ColoredButton(delete: deleteFile)
}
IdPropertyView(