Fix issues with account image being stretched
This commit is contained in:
parent
ea3149d5bc
commit
8fb95f7900
|
@ -11,19 +11,25 @@ import RSCore
|
|||
|
||||
struct AccountHeaderImageView: View {
|
||||
var image: RSImage
|
||||
|
||||
|
||||
var body: some View {
|
||||
Image(rsImage: image)
|
||||
.resizable()
|
||||
.aspectRatio(1, contentMode: .fit)
|
||||
.frame(height: 48, alignment: .center)
|
||||
.padding()
|
||||
|
||||
HStack(alignment: .center) {
|
||||
Image(rsImage: image)
|
||||
.resizable()
|
||||
.scaledToFit()
|
||||
.frame(height: 48, alignment: .center)
|
||||
.padding()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
struct AccountHeaderImageView_Previews: PreviewProvider {
|
||||
static var previews: some View {
|
||||
AccountHeaderImageView(image: AppAssets.image(for: .onMyMac)!)
|
||||
Group {
|
||||
AccountHeaderImageView(image: AppAssets.image(for: .onMyMac)!)
|
||||
AccountHeaderImageView(image: AppAssets.image(for: .feedbin)!)
|
||||
AccountHeaderImageView(image: AppAssets.accountLocalPadImage)
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -17,8 +17,8 @@ struct SettingsAccountLabelView: View {
|
|||
HStack {
|
||||
Image(rsImage: accountImage!)
|
||||
.resizable()
|
||||
.aspectRatio(1, contentMode: .fit)
|
||||
.frame(height: 32)
|
||||
.scaledToFit()
|
||||
.frame(width: 32, height: 32)
|
||||
Text(verbatim: accountLabel).font(.title)
|
||||
}
|
||||
.foregroundColor(.primary).padding(4.0)
|
||||
|
@ -27,10 +27,23 @@ struct SettingsAccountLabelView: View {
|
|||
|
||||
struct SettingsAccountLabelView_Previews: PreviewProvider {
|
||||
static var previews: some View {
|
||||
SettingsAccountLabelView(
|
||||
accountImage: AppAssets.image(for: .onMyMac),
|
||||
accountLabel: "On My Device"
|
||||
)
|
||||
.previewLayout(.fixed(width: 300, height: 44))
|
||||
List {
|
||||
SettingsAccountLabelView(
|
||||
accountImage: AppAssets.image(for: .onMyMac),
|
||||
accountLabel: "On My Device"
|
||||
)
|
||||
SettingsAccountLabelView(
|
||||
accountImage: AppAssets.image(for: .feedbin),
|
||||
accountLabel: "Feedbin"
|
||||
)
|
||||
SettingsAccountLabelView(
|
||||
accountImage: AppAssets.accountLocalPadImage,
|
||||
accountLabel: "On My iPad"
|
||||
)
|
||||
SettingsAccountLabelView(
|
||||
accountImage: AppAssets.accountLocalPhoneImage,
|
||||
accountLabel: "On My iPhone"
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue