commit 98d11fb71e6e3bff64cfaa347bf885ea46cfe733
parent 9ca959d8d323364765c05f3821de5a4dff21232a
Author: William Casarin <jb55@jb55.com>
Date: Tue, 4 Apr 2023 10:58:16 -0700
Show full bleed images on selected events in threads
Changelog-Changed: Show full bleed images on selected events in threads
Diffstat:
3 files changed, 18 insertions(+), 8 deletions(-)
diff --git a/damus/Views/Events/SelectedEventView.swift b/damus/Views/Events/SelectedEventView.swift
@@ -39,21 +39,24 @@ struct SelectedEventView: View {
.padding([.bottom], 4)
}
+ .padding(.horizontal)
.minimumScaleFactor(0.75)
.lineLimit(1)
if event_is_reply(event, privkey: damus.keypair.privkey) {
ReplyDescription(event: event, profiles: damus.profiles)
+ .padding(.horizontal)
}
- EventBody(damus_state: damus, event: event, size: size, options: [])
+ EventBody(damus_state: damus, event: event, size: size, options: [.pad_content])
if let mention = first_eref_mention(ev: event, privkey: damus.keypair.privkey) {
BuilderEventView(damus: damus, event_id: mention.ref.id)
+ .padding(.horizontal)
}
Text(verbatim: "\(format_date(event.created_at))")
- .padding(.top, 10)
+ .padding([.top, .leading, .trailing])
.font(.footnote)
.foregroundColor(.gray)
@@ -62,11 +65,13 @@ struct SelectedEventView: View {
if !bar.is_empty {
EventDetailBar(state: damus, target: event.id, target_pk: event.pubkey)
+ .padding(.horizontal)
Divider()
}
EventActionBar(damus_state: damus, event: event)
.padding([.top], 4)
+ .padding(.horizontal)
Divider()
.padding([.top], 4)
@@ -76,7 +81,6 @@ struct SelectedEventView: View {
guard target == self.event.id else { return }
self.bar.update(damus: self.damus, evid: target)
}
- .padding([.leading], 2)
.compositingGroup()
}
}
diff --git a/damus/Views/NoteContentView.swift b/damus/Views/NoteContentView.swift
@@ -85,7 +85,12 @@ struct NoteContentView: View {
var MainContent: some View {
VStack(alignment: .leading) {
if size == .selected {
- SelectableText(attributedString: artifacts.content, size: self.size)
+ if with_padding {
+ SelectableText(attributedString: artifacts.content, size: self.size)
+ .padding(.horizontal)
+ } else {
+ SelectableText(attributedString: artifacts.content, size: self.size)
+ }
} else {
if with_padding {
truncatedText
diff --git a/damus/Views/ThreadView.swift b/damus/Views/ThreadView.swift
@@ -30,8 +30,8 @@ struct ThreadView: View {
MutedEventView(damus_state: state,
event: parent_event,
scroller: reader,
- selected: false
- )
+ selected: false)
+ .padding(.horizontal)
.onTapGesture {
thread.set_active_event(parent_event, privkey: state.keypair.privkey)
scroll_to_event(scroller: reader, id: parent_event.id, delay: 0.1, animate: false)
@@ -49,7 +49,7 @@ struct ThreadView: View {
Rectangle()
.fill(Color.gray.opacity(0.25))
.frame(width: 2, height: eventHeight)
- .offset(x: 25, y: 40)
+ .offset(x: 40, y: 40)
})
// MARK: - Actual event view
@@ -68,6 +68,7 @@ struct ThreadView: View {
scroller: nil,
selected: false
)
+ .padding(.horizontal)
.onTapGesture {
thread.set_active_event(child_event, privkey: state.keypair.privkey)
scroll_to_event(scroller: reader, id: child_event.id, delay: 0.1, animate: false)
@@ -76,7 +77,7 @@ struct ThreadView: View {
Divider()
.padding([.top], 4)
}
- }.padding()
+ }
}.navigationBarTitle(NSLocalizedString("Thread", comment: "Navigation bar title for note thread."))
.onAppear {
thread.subscribe()