Fix images on tags/users/instances.

This commit is contained in:
Marcin Czachursk 2023-03-14 18:45:41 +01:00
parent 3eb495abcc
commit a13265ca8f
4 changed files with 13 additions and 7 deletions

View File

@ -1261,7 +1261,7 @@
CODE_SIGN_ENTITLEMENTS = VernissageWidget/VernissageWidgetExtension.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 70;
CURRENT_PROJECT_VERSION = 71;
DEVELOPMENT_TEAM = B2U9FEKYP8;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = VernissageWidget/Info.plist;
@ -1289,7 +1289,7 @@
ASSETCATALOG_COMPILER_WIDGET_BACKGROUND_COLOR_NAME = WidgetBackground;
CODE_SIGN_ENTITLEMENTS = VernissageWidget/VernissageWidgetExtension.entitlements;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 70;
CURRENT_PROJECT_VERSION = 71;
DEVELOPMENT_TEAM = B2U9FEKYP8;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = VernissageWidget/Info.plist;
@ -1435,7 +1435,7 @@
CODE_SIGN_ENTITLEMENTS = Vernissage/Vernissage.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 70;
CURRENT_PROJECT_VERSION = 71;
DEVELOPMENT_ASSET_PATHS = "\"Vernissage/Preview Content\"";
DEVELOPMENT_TEAM = B2U9FEKYP8;
ENABLE_PREVIEWS = YES;
@ -1473,7 +1473,7 @@
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_ENTITLEMENTS = Vernissage/Vernissage.entitlements;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 70;
CURRENT_PROJECT_VERSION = 71;
DEVELOPMENT_ASSET_PATHS = "\"Vernissage/Preview Content\"";
DEVELOPMENT_TEAM = B2U9FEKYP8;
ENABLE_PREVIEWS = YES;

View File

@ -26,8 +26,10 @@ struct InstanceRowView: View {
if let image = state.image {
image
.resizable()
.aspectRatio(contentMode: .fit)
.aspectRatio(contentMode: .fill)
.frame(width: 50, height: 50)
.clipShape(RoundedRectangle(cornerRadius: 4))
.clipped()
} else if state.isLoading {
placeholderView
} else {

View File

@ -10,7 +10,9 @@ import NukeUI
struct ImageGrid: View {
@EnvironmentObject var applicationState: ApplicationState
@EnvironmentObject var routerPath: RouterPath
@StateObject var photoUrl: PhotoUrl
@State var maxHeight = 120.0
var body: some View {
if self.photoUrl.sensitive && !self.applicationState.showSensitive {
@ -27,8 +29,10 @@ struct ImageGrid: View {
if let image = state.image {
image
.resizable()
.aspectRatio(contentMode: .fit)
.aspectRatio(contentMode: .fill)
.frame(width: self.maxHeight, height: self.maxHeight)
.clipShape(RoundedRectangle(cornerRadius: 10))
.clipped()
.onTapGesture {
if let statusId = self.photoUrl.statusId {
self.routerPath.navigate(to: .status(id: statusId))

View File

@ -34,7 +34,7 @@ struct ImagesGrid: View {
ScrollView(.horizontal) {
LazyHGrid(rows: [GridItem(.fixed(self.maxHeight))]) {
ForEach(self.photoUrls) { photoUrl in
ImageGrid(photoUrl: photoUrl)
ImageGrid(photoUrl: photoUrl, maxHeight: self.maxHeight)
}
Text("more...")