File tree 1 file changed +20
-14
lines changed
Adamant/Modules/PartnerQR
1 file changed +20
-14
lines changed Original file line number Diff line number Diff line change @@ -12,33 +12,37 @@ struct PartnerQRView: View {
12
12
@ObservedObject var viewModel : PartnerQRViewModel
13
13
14
14
var body : some View {
15
- Form {
16
- infoSection ( )
17
- toggleSection ( )
18
- buttonSection ( )
19
- }
20
- . navigationBarTitleDisplayMode ( . inline)
21
- . toolbar {
22
- ToolbarItem ( placement: . principal) {
23
- toolbar ( )
15
+ GeometryReader { geometry in
16
+ Form {
17
+ infoSection ( )
18
+ toggleSection ( )
19
+ buttonSection ( )
20
+ }
21
+ . navigationBarTitleDisplayMode ( . inline)
22
+ . toolbar {
23
+ ToolbarItem ( placement: . principal) {
24
+ toolbar ( maxWidth: geometry. size. width)
25
+ }
24
26
}
25
27
}
26
28
}
27
29
}
28
30
29
31
private extension PartnerQRView {
30
- func toolbar( ) -> some View {
31
- Button ( action: {
32
- viewModel. renameContact ( )
33
- } ) {
32
+ func toolbar( maxWidth: CGFloat ) -> some View {
33
+ Button ( action: viewModel. renameContact) {
34
34
HStack {
35
35
if let uiImage = viewModel. partnerImage {
36
36
Image ( uiImage: uiImage)
37
37
. resizable ( )
38
38
. frame ( squareSize: viewModel. partnerImageSize)
39
39
}
40
- Text ( viewModel. partnerName) . font ( . headline)
40
+ Text ( viewModel. partnerName)
41
+ . font ( . headline)
42
+ . minimumScaleFactor ( 0.7 )
43
+ . lineLimit ( 1 )
41
44
}
45
+ . frame ( maxWidth: maxWidth - toolbarSpace, alignment: . center)
42
46
}
43
47
}
44
48
@@ -101,3 +105,5 @@ private extension PartnerQRView {
101
105
}
102
106
}
103
107
}
108
+
109
+ private let toolbarSpace : CGFloat = 150
You can’t perform that action at this time.
0 commit comments