mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-04 10:33:45 +00:00
Content Scanning View (#5831)
* implement a MediaView to delegate at the view level the usage of the content scanner service, to determine how to render the media. * fix for a small design mismatch * fix for greedy error state * updated naming * just making some screenshot that have been affected by a string change on Localazy * pr suggestions + updated strings
This commit is contained in:
@@ -14,12 +14,15 @@ extension View {
|
||||
/// - isOutgoing: rounds the corners according to the side it shows on, defaults to true
|
||||
/// - insets: defaults to what we use for file timeline items, text uses custom values
|
||||
/// - color: self explanatory, defaults to subtle secondary
|
||||
/// - borderColor: an optional colour for a border around the bubble
|
||||
func bubbleBackground(isOutgoing: Bool = true,
|
||||
insets: EdgeInsets = .init(top: 8, leading: 12, bottom: 8, trailing: 12),
|
||||
color: @autoclosure @MainActor () -> Color? = .compound.bgSubtleSecondary) -> some View {
|
||||
color: @autoclosure @MainActor () -> Color? = .compound.bgSubtleSecondary,
|
||||
borderColor: @autoclosure @MainActor () -> Color? = nil) -> some View {
|
||||
modifier(TimelineItemBubbleBackgroundModifier(isOutgoing: isOutgoing,
|
||||
insets: insets,
|
||||
color: color()))
|
||||
color: color(),
|
||||
borderColor: borderColor()))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,12 +32,19 @@ private struct TimelineItemBubbleBackgroundModifier: ViewModifier {
|
||||
let isOutgoing: Bool
|
||||
let insets: EdgeInsets
|
||||
var color: Color?
|
||||
var borderColor: Color?
|
||||
|
||||
func body(content: Content) -> some View {
|
||||
content
|
||||
.padding(insets)
|
||||
.background(color)
|
||||
.cornerRadius(12, corners: roundedCorners)
|
||||
.overlay {
|
||||
if let borderColor {
|
||||
RoundedCornerShape(radius: 12, corners: roundedCorners)
|
||||
.stroke(borderColor)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private var roundedCorners: UIRectCorner {
|
||||
|
||||
Reference in New Issue
Block a user