mirror of
https://github.com/Ferrite-iOS/Ferrite.git
synced 2026-03-11 17:45:40 +00:00
Ferrite: Fix toast UI
Refactor the GroupBox style and make error fonts smaller to not impede the user's experience. Signed-off-by: kingbri <bdashore3@gmail.com>
This commit is contained in:
parent
e0daa453c3
commit
2df0ce7604
3 changed files with 31 additions and 3 deletions
|
|
@ -32,6 +32,7 @@
|
|||
0CA148EB288903F000DE2211 /* SearchResultsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0CA148D3288903F000DE2211 /* SearchResultsView.swift */; };
|
||||
0CA148EC288903F000DE2211 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0CA148D4288903F000DE2211 /* ContentView.swift */; };
|
||||
0CAF1C7B286F5C8600296F86 /* SwiftSoup in Frameworks */ = {isa = PBXBuildFile; productRef = 0CAF1C7A286F5C8600296F86 /* SwiftSoup */; };
|
||||
0CFEFCFD288A006200B3F490 /* GroupBoxStyle.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0CFEFCFC288A006200B3F490 /* GroupBoxStyle.swift */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
|
|
@ -57,6 +58,7 @@
|
|||
0CA148D3288903F000DE2211 /* SearchResultsView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SearchResultsView.swift; sourceTree = "<group>"; };
|
||||
0CA148D4288903F000DE2211 /* ContentView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = "<group>"; };
|
||||
0CAF1C68286F5C0E00296F86 /* Ferrite.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Ferrite.app; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
0CFEFCFC288A006200B3F490 /* GroupBoxStyle.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GroupBoxStyle.swift; sourceTree = "<group>"; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
|
|
@ -92,6 +94,7 @@
|
|||
isa = PBXGroup;
|
||||
children = (
|
||||
0CA148C1288903F000DE2211 /* NavView.swift */,
|
||||
0CFEFCFC288A006200B3F490 /* GroupBoxStyle.swift */,
|
||||
);
|
||||
path = CommonViews;
|
||||
sourceTree = "<group>";
|
||||
|
|
@ -265,6 +268,7 @@
|
|||
0CA148D8288903F000DE2211 /* MagnetChoiceView.swift in Sources */,
|
||||
0CA148E3288903F000DE2211 /* Task.swift in Sources */,
|
||||
0CA148E7288903F000DE2211 /* ToastViewModel.swift in Sources */,
|
||||
0CFEFCFD288A006200B3F490 /* GroupBoxStyle.swift in Sources */,
|
||||
0CA148E6288903F000DE2211 /* WebView.swift in Sources */,
|
||||
0CA148E2288903F000DE2211 /* Data.swift in Sources */,
|
||||
0CA148DE288903F000DE2211 /* RealDebridModels.swift in Sources */,
|
||||
|
|
|
|||
20
Ferrite/Views/CommonViews/GroupBoxStyle.swift
Normal file
20
Ferrite/Views/CommonViews/GroupBoxStyle.swift
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
//
|
||||
// GroupBoxStyle.swift
|
||||
// Ferrite
|
||||
//
|
||||
// Created by Brian Dashore on 7/21/22.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
|
||||
struct ErrorGroupBoxStyle: GroupBoxStyle {
|
||||
func makeBody(configuration: Configuration) -> some View {
|
||||
VStack {
|
||||
configuration.label
|
||||
configuration.content
|
||||
}
|
||||
.padding(10)
|
||||
.background(Color(uiColor: .secondarySystemGroupedBackground))
|
||||
.clipShape(RoundedRectangle(cornerRadius: 8, style: .continuous))
|
||||
}
|
||||
}
|
||||
|
|
@ -42,11 +42,15 @@ struct MainView: View {
|
|||
Text("Error: \(toastModel.toastDescription ?? "This shouldn't be showing up... Contact the dev!")")
|
||||
}
|
||||
}
|
||||
.groupBoxStyle(ErrorGroupBoxStyle())
|
||||
|
||||
Rectangle()
|
||||
.foregroundColor(.clear)
|
||||
.frame(height: 60)
|
||||
}
|
||||
}
|
||||
.transition(AnyTransition.move(edge: .bottom))
|
||||
.animation(.easeInOut(duration: 0.3), value: true)
|
||||
.padding()
|
||||
.font(.caption)
|
||||
.animation(.easeInOut(duration: 0.3), value: toastModel.showToast)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue