Skip to content

Commit

Permalink
added more hack for ipad
Browse files Browse the repository at this point in the history
  • Loading branch information
EricBAndrews committed Sep 16, 2023
1 parent 522b499 commit aae96e5
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 11 deletions.
21 changes: 12 additions & 9 deletions Mlem/Views/Shared/Posts/Post Sizes/Large Post.swift
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,10 @@ struct LargePost: View {
}

// REMOVEME: needed for TF hack
@Environment(\.horizontalSizeClass) var horizontalSizeClass
var screenWidth: CGFloat = UIScreen.main.bounds.width - (AppConstants.postAndCommentSpacing * 2)
var imageWidth: CGFloat { horizontalSizeClass == .regular ? screenWidth * 0.8 : screenWidth }
var imageHeight: CGFloat { horizontalSizeClass == .regular ? 600 : screenWidth }

// initializer--used so we can set showNsfwFilterToggle to false when expanded or true when not
init(
Expand Down Expand Up @@ -207,18 +210,18 @@ struct LargePost: View {
url: url,
// maxHeight: layoutMode.getMaxHeight(limitHeight),
// CHANGEME: hack for TF release
fixedSize: CGSize(width: screenWidth, height: screenWidth),
fixedSize: CGSize(width: imageWidth, height: imageHeight),
dismissCallback: markPostAsRead,
cornerRadius: AppConstants.largeItemCornerRadius
)
.frame(
// CHANGEME: hack for TF release
width: screenWidth,
height: screenWidth,
// maxWidth: .infinity,
// maxHeight: layoutMode.getMaxHeight(limitHeight),
alignment: .top
)
// CHANGEME: hack for TF release
.frame(height: imageHeight)
.frame(maxWidth: .infinity, alignment: .center)
// .frame(
// maxWidth: .infinity,
// maxHeight: layoutMode.getMaxHeight(limitHeight),
// alignment: .top
// )
.applyNsfwOverlay(post.post.nsfw || post.community.nsfw, canTapFullImage: isExpanded)
.clipped()
}
Expand Down
7 changes: 5 additions & 2 deletions Mlem/Views/Shared/Website Icon Complex.swift
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,10 @@ struct WebsiteIconComplex: View {
}

// REMOVEME: needed for TF hack
@Environment(\.horizontalSizeClass) var horizontalSizeClass
var screenWidth: CGFloat = UIScreen.main.bounds.width - (AppConstants.postAndCommentSpacing * 2)
var imageWidth: CGFloat { horizontalSizeClass == .regular ? screenWidth * 0.8 : screenWidth }
var imageHeight: CGFloat { horizontalSizeClass == .regular ? 400 : screenWidth * 0.66 }

var body: some View {
VStack(spacing: 0) {
Expand All @@ -66,10 +69,10 @@ struct WebsiteIconComplex: View {
url: thumbnailURL,
shouldExpand: false,
// CHANGEME: hack for TF release
fixedSize: CGSize(width: screenWidth, height: screenWidth * 0.66)
fixedSize: CGSize(width: imageWidth, height: imageHeight)
)
// .frame(maxHeight: 400)
.frame(width: screenWidth, height: screenWidth * 0.66)
.frame(width: imageWidth, height: imageHeight)
.applyNsfwOverlay(post.nsfw)
.clipped()
}
Expand Down

0 comments on commit aae96e5

Please sign in to comment.