Fix issues with account image being stretched
This commit is contained in:
parent
ea3149d5bc
commit
8fb95f7900
@ -13,17 +13,23 @@ struct AccountHeaderImageView: View {
|
|||||||
var image: RSImage
|
var image: RSImage
|
||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
Image(rsImage: image)
|
HStack(alignment: .center) {
|
||||||
.resizable()
|
Image(rsImage: image)
|
||||||
.aspectRatio(1, contentMode: .fit)
|
.resizable()
|
||||||
.frame(height: 48, alignment: .center)
|
.scaledToFit()
|
||||||
.padding()
|
.frame(height: 48, alignment: .center)
|
||||||
|
.padding()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
struct AccountHeaderImageView_Previews: PreviewProvider {
|
struct AccountHeaderImageView_Previews: PreviewProvider {
|
||||||
static var previews: some View {
|
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 {
|
HStack {
|
||||||
Image(rsImage: accountImage!)
|
Image(rsImage: accountImage!)
|
||||||
.resizable()
|
.resizable()
|
||||||
.aspectRatio(1, contentMode: .fit)
|
.scaledToFit()
|
||||||
.frame(height: 32)
|
.frame(width: 32, height: 32)
|
||||||
Text(verbatim: accountLabel).font(.title)
|
Text(verbatim: accountLabel).font(.title)
|
||||||
}
|
}
|
||||||
.foregroundColor(.primary).padding(4.0)
|
.foregroundColor(.primary).padding(4.0)
|
||||||
@ -27,10 +27,23 @@ struct SettingsAccountLabelView: View {
|
|||||||
|
|
||||||
struct SettingsAccountLabelView_Previews: PreviewProvider {
|
struct SettingsAccountLabelView_Previews: PreviewProvider {
|
||||||
static var previews: some View {
|
static var previews: some View {
|
||||||
SettingsAccountLabelView(
|
List {
|
||||||
accountImage: AppAssets.image(for: .onMyMac),
|
SettingsAccountLabelView(
|
||||||
accountLabel: "On My Device"
|
accountImage: AppAssets.image(for: .onMyMac),
|
||||||
)
|
accountLabel: "On My Device"
|
||||||
.previewLayout(.fixed(width: 300, height: 44))
|
)
|
||||||
|
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…
x
Reference in New Issue
Block a user