From fafea73ea7ec15f91e5a0e7713d81b34dc6e4ea6 Mon Sep 17 00:00:00 2001 From: John Preston Date: Fri, 26 Mar 2021 17:05:31 +0400 Subject: [PATCH] Improve checkout main page design. --- .../icons/payments/payment_address.png | Bin 0 -> 802 bytes .../icons/payments/payment_address@2x.png | Bin 0 -> 1638 bytes .../icons/payments/payment_address@3x.png | Bin 0 -> 2402 bytes .../Resources/icons/payments/payment_card.png | Bin 0 -> 357 bytes .../icons/payments/payment_card@2x.png | Bin 0 -> 560 bytes .../icons/payments/payment_card@3x.png | Bin 0 -> 985 bytes .../icons/payments/payment_email.png | Bin 0 -> 949 bytes .../icons/payments/payment_email@2x.png | Bin 0 -> 1936 bytes .../icons/payments/payment_email@3x.png | Bin 0 -> 2860 bytes .../Resources/icons/payments/payment_name.png | Bin 0 -> 473 bytes .../icons/payments/payment_name@2x.png | Bin 0 -> 884 bytes .../icons/payments/payment_name@3x.png | Bin 0 -> 1411 bytes .../icons/payments/payment_phone.png | Bin 0 -> 711 bytes .../icons/payments/payment_phone@2x.png | Bin 0 -> 1327 bytes .../icons/payments/payment_phone@3x.png | Bin 0 -> 2090 bytes .../icons/payments/payment_shipping.png | Bin 0 -> 526 bytes .../icons/payments/payment_shipping@2x.png | Bin 0 -> 1022 bytes .../icons/payments/payment_shipping@3x.png | Bin 0 -> 1469 bytes Telegram/Resources/langs/lang.strings | 27 +- .../payments/payments_checkout_process.cpp | 15 +- .../SourceFiles/payments/payments_form.cpp | 120 ++++++- Telegram/SourceFiles/payments/payments_form.h | 31 +- .../SourceFiles/payments/ui/payments.style | 46 ++- .../payments/ui/payments_form_summary.cpp | 303 ++++++++++++------ .../payments/ui/payments_form_summary.h | 11 +- .../payments/ui/payments_panel.cpp | 23 +- .../SourceFiles/payments/ui/payments_panel.h | 3 + .../payments/ui/payments_panel_data.h | 9 + 28 files changed, 448 insertions(+), 140 deletions(-) create mode 100644 Telegram/Resources/icons/payments/payment_address.png create mode 100644 Telegram/Resources/icons/payments/payment_address@2x.png create mode 100644 Telegram/Resources/icons/payments/payment_address@3x.png create mode 100644 Telegram/Resources/icons/payments/payment_card.png create mode 100644 Telegram/Resources/icons/payments/payment_card@2x.png create mode 100644 Telegram/Resources/icons/payments/payment_card@3x.png create mode 100644 Telegram/Resources/icons/payments/payment_email.png create mode 100644 Telegram/Resources/icons/payments/payment_email@2x.png create mode 100644 Telegram/Resources/icons/payments/payment_email@3x.png create mode 100644 Telegram/Resources/icons/payments/payment_name.png create mode 100644 Telegram/Resources/icons/payments/payment_name@2x.png create mode 100644 Telegram/Resources/icons/payments/payment_name@3x.png create mode 100644 Telegram/Resources/icons/payments/payment_phone.png create mode 100644 Telegram/Resources/icons/payments/payment_phone@2x.png create mode 100644 Telegram/Resources/icons/payments/payment_phone@3x.png create mode 100644 Telegram/Resources/icons/payments/payment_shipping.png create mode 100644 Telegram/Resources/icons/payments/payment_shipping@2x.png create mode 100644 Telegram/Resources/icons/payments/payment_shipping@3x.png diff --git a/Telegram/Resources/icons/payments/payment_address.png b/Telegram/Resources/icons/payments/payment_address.png new file mode 100644 index 0000000000000000000000000000000000000000..dcc9b2f812b1e04c01e2d48d31cc77be8a7ee45f GIT binary patch literal 802 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=fdz#^NA%Cx&(BWL^R}E~ycoX}-P; zT0k}j17mw80}DtA5K93u0|WB{Mh0de%?J`(zyz07Sip>6gA}f5OZv>fz|`aE;usRa z`8L$QyRcAXpR$fxq=v89<^;z@YN{tq*nMPVeyF&wlx4et#{#&v|ZhzPP^b`z|4t#v`TM4CeS&YS$PR++>Wk zPB5F@>Y}6=q9wZU`fJYaqfO#PS1vHS+mdSr6|dT{+r(P@%TA zcH_6_&()U(X>zq6PT733LeZVqmSw|?iy2Ng8!l!n*}mOeO;3a?Wn+Y&(Bg0%G0ASp zGg$@;a}?zIjUOf$D6GD^%8P?%1IL+vw;D>^{r&x;PDn88Fm2v%_Tk^Zb1D4%{M9M_ z{ry+of3H-W&du0;V9lO7rSN~8X`3Y{Tgvp=8g+O##`y68b$t4@G3Kjng2A8GGtY|) zxt{ymkoc+A@+;g_`Qj9b^`epT>d@9%(Q=@tIRCW8#j~faqc!l=g*WYnB zZ{g*aZ*KLvIq%rJ_ipTI;r`=?r$3UMFuniTD(ee5W|am~y>hA+VLeBaVy30_Cq6Mf z+FVpz?7aGFmv~WOK;c7%b=R|_^rok5zb(2kS})b9;nY*3`LA-!R(s7j{Zt}aYih{G zS-dPvjQdufO>>^;@kHh0-@mrC_4S|g?%usS_lWG9MZfqG6egeiFn901eV4v|{mKsv zc;_XTU&{Yw4y=ry%{cj_%iFTqtgpUWb^iZtE%an-RB!d#u3O#tcp$1D8B3 zIN_wPudmZmzb9+!Dbp_v7Zv%|lrbOpRbwaB>!!nz__Cqzc(Txa@v5U=r5iY9Hk?d3 zr1rsZt{*3R==-xdAAglO2npUV`|{_H&(E59d*a^j@47toiPIlD?-l#H{%>F1-MIPv Z0r}8Co*%Q~loCIE^gT7m!o literal 0 HcmV?d00001 diff --git a/Telegram/Resources/icons/payments/payment_address@2x.png b/Telegram/Resources/icons/payments/payment_address@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..5b4cea3d3917292becafc8f15bba2ccac1e31e15 GIT binary patch literal 1638 zcmV-s2ATPZP)Px#L}ge>W=%~1DgXcg2mk?xX#fNO00031000^Q000001E2u_0{{R30RRC20H6W@ z1ONa40RR91K%fHv1ONa40RR91KmY&$07g+lumAuB&`Cr=RCodHS~*B0O%yKgW4&)g z@xBmI@CZC$H!#v%5DgR~F*i_LQ^C|k)WARy%tS;DRK)w(_1HyJF!4fEP!Yj{`s*9E zwW@oj9jzLjALl{SRbBPI_r2Gzs=KP&jSxcF@nyyR%XA6oex6KCO_Am0WpaOi{}J>oiy>6rG-)HaH@C0hqv69R#<3fb1kM7}FTLNl8ft zu;b%nGCDd+W@l%~@87>IWB&5;($X(1EX*<|LJ34-XGIIXP*#(Tp^$tE;1IBDC8M`a%b~dVvktVgXQfr~&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w~S+=kEJ#jFGrsd<_a||c?G*7Q20%C8cIk7A63x+O6SW0T;q2b;gI$E1}o2zjE@@L zRas{5^FvNUyK)>THSmOk3=ht=Kh(IN4G2K?_Q30dXP@uRek8}r=l!bjX?Z_w6vmI?m{d_$ai>OonE!j#*=|Hi@;Ytn4w9{&$Mnr6rV literal 0 HcmV?d00001 diff --git a/Telegram/Resources/icons/payments/payment_card.png b/Telegram/Resources/icons/payments/payment_card.png new file mode 100644 index 0000000000000000000000000000000000000000..6e80687c6c0fa72a7ff623dada48d43a664df476 GIT binary patch literal 357 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=fdz#^NA%Cx&(BWL^R}E~ycoX}-P; zT0k}j17mw80}DtA5K93u0|WB{Mh0de%?J`(zyz07Sip>6gA}f5OZp6?&U?BzhD30_ z4Rz!?qQKL0`qASr$@@a)KTKOqYXCITDL2|Hhdgdoe=v;_LH@>UcG_!_Fez~^Syb+cy{4qz6i!=4X+$DmzwIu zFOOpOzs{;1BekH~UtZqL#!0(t!on-dPMu~4S}6X%*8FPXlABwrW8XI3b&{Gdn!q=M Y*}lQ8O2(p{r3Bc1>P_aArP+3{I^NBQH63XJM^xVCx4tW3JFMEG{$sg5$ur8&lLesG@t z;~m3vg7Khe05^-d!zAV>4G*|hur^6M%w7=Xpeqp5_(<%I8|mj}Y#SJaPd}DEKhb>aY^D9v8I%~J8#(4Mr0uj#FAh(r zj$wGcTlizWbMGTVcJJAefEmg8mHa)5=1|vu>GwQZf~2+_ATjC$^U0(O}~rYj@7v``^ty) zM-R*QwAf2+-uFw!rOj5Rm0?B!(=Ep8LtnSNsEGP}CH;v@UIN23S@G(n{%tyqs~zpx sVmF!_2_1-bjkGIbSUqEVg(Y5g{k<|rHrYvHxuDqcboFyt=akR{0L#|ZWB>pF literal 0 HcmV?d00001 diff --git a/Telegram/Resources/icons/payments/payment_card@3x.png b/Telegram/Resources/icons/payments/payment_card@3x.png new file mode 100644 index 0000000000000000000000000000000000000000..ae50fe67da0317d0512f76066707c3c6e19cf0b6 GIT binary patch literal 985 zcmeAS@N?(olHy`uVBq!ia0vp^2_VeD1|%QND7OGojKx9jP7LeL$-D$|Tv8)E(|mmy zw18|52FCVG1{RPKAeI7R1_tH@j10^`nh_+nfC(;}uz(rC1}R)=9PbBI?(FH}7*fIb zcFx&eB|`zXvswKr40AY{^;iz}nka}FDR8K`h^QQx${q9I((90FJ zpllPdb@RU)eCaV*JSAwlexCx9ebXnSx3d{oS?onM8km|mS(ZQNThNfebnxX)W(|cI z4h2>37`Qmp1m?`MCQ&*{Y(v!AOLhDGr=M26`~Lft(z^)vOd zE6c6s8of7b`=VsK&~oqN#E1G~-S5hFZ*~0FueU_~<=Q5eISiH4ws8D^>{zvWgKz;; zRMpL&4*!1zSFyZj>S_3s_I2yEwEF3BfkFw}7ry>#b$!Y4*I&JM-_`S7e%VB-m#xrq zZP4Z`aZ`FBX{nbKBY`6yU=`Vg&QKQ0S*R@55C-C6cO-Iu&DjIdqLQL@s>}=rYneeCd+UcG&$=oW}rHA zM#J&PfjWxyM|NA-x18K}>vz@GFD$|Zd*ix)n$PwvtmBwmyY>6mthby+Hx%Tv^ya3% zn0G#1UEQ~>B)~aq>a3;TE=`Ct&biXcdBnLYt?yauE6D@NtJJ0~bLHBX<0*H=Y@>;; z7MB3$pH)rypZ|Poiu*C&TO?p_&BebIf39+gTe~DWM4fh;fO@ literal 0 HcmV?d00001 diff --git a/Telegram/Resources/icons/payments/payment_email.png b/Telegram/Resources/icons/payments/payment_email.png new file mode 100644 index 0000000000000000000000000000000000000000..41154157ba10006e187bdc00aa37f44b24c2290f GIT binary patch literal 949 zcmV;m14{gfP)Px#L}ge>W=%~1DgXcg2mk?xX#fNO00031000^Q000001E2u_0{{R30RRC20H6W@ z1ONa40RR91AfN*P1ONa40RR91AOHXW0IY^$^8f$?A4x<(R9Fe^RXa;-K@i>~qNeac zARrOa_zzSp#70eL#1I72Xlg;RiH|}tg^HL;e}SE8Y{XI}MVgQzLJ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 zrZ+|SmiM8J%>!8X(wHm~w3WHbEZ{v;<`T(J``H6d!bvF5^zP46>l^T-O8+gQNbj+l zcOD3X#}|iH#u|9)ws*_ieS`d^IeG${E`+HuY?MZfr63}kB=#$6gq8j+ zN}gsU*e+t_KKCiapZP{f`8ra4%P1mG5p$*+y13SJv2zGlDTk=cRK6}J0u~;2xA1Wn zt~o&T!8TSjl~p0FN=(ACWn@4GgctJv4RowKIt06rakhUaLp;addhTO6y$*vbzh_%; M357MTG$cg+2URvI(*OVf literal 0 HcmV?d00001 diff --git a/Telegram/Resources/icons/payments/payment_name.png b/Telegram/Resources/icons/payments/payment_name.png new file mode 100644 index 0000000000000000000000000000000000000000..fdeb96631e221049b28551f4ff64c837c05a3664 GIT binary patch literal 473 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=fdz#^NA%Cx&(BWL^R}E~ycoX}-P; zT0k}j17mw80}DtA5K93u0|WB{Mh0de%?J`(zyz07Sip>6gA}f5OZp5{=IrU>7!twx zcFNt8tp+@8ua8GM6^Mox@;ZJmWYC{;$Z}6HgZ`HIc@G*danJsISn#03mfU-P%rc+N z`Fv>k#rv7_%8!>bl(VjjY}}+1d;fdhEVa~YbM|`gVNT1Nbu9n(v*f7jSCy-eUhCUx zJzdAPZ(8cd(%9cN=ch&%xAC0mcD%tnAt?KiMbF#~r(m%0 zO-B7%O^M@ylM2_Z()!yz|M^W};Zs4`#V7spolYLvp1b<)I&rz0I-@oghG5QJbK9CD z_Z!w_Y2WTW^y7x`ro&IQtuCJ-^};+uILW!5BwijTh&+I3RMRMtEa1<%Q~loCIHS>xqkov literal 0 HcmV?d00001 diff --git a/Telegram/Resources/icons/payments/payment_name@2x.png b/Telegram/Resources/icons/payments/payment_name@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..2bcacb37469370530d67d3ce316c4ecd6b91a693 GIT binary patch literal 884 zcmV-)1B?8LP)Px#L}ge>W=%~1DgXcg2mk?xX#fNO00031000^Q000001E2u_0{{R30RRC20H6W@ z1ONa40RR91K%fHv1ONa40RR91KmY&$07g+lumAu8-bqA3RCodHS--L|F%%CoR4N^> zpf#h{=_nLxZ==zu^m;Gg4YUd~I>rkq4f)P5!~L>x@80F)EO(PLlabw=zrUQEB&(#9 z($s>bamO1mq4CNpi-%*;c%!Hi-p>5 zx9W5{nT9^zVGKNZ6RyMJZ7>+<-EOCUBk+JX51(!}WP>l4%X%`I{1*4aIAkE30}!$R zyb}B!4aoj!0FcTqU9VR?pU-ut)6unB%{27!4r4CmupDGEfQs3}nm-lv&?T4&G5}CTx8pFgn-=^%K=8Pk0A2TSfnON_Xj@AFfE3T_Ja}z_uB@^z@W}u` zd%GQjS@T()Lrt&=y0Xf?z$XI$9dhg#OtH)A9Ezh&(3Ms8S-yA_Cd5RDs(C_htJO+8 zr#-m5uC6rMXUD`cV7*=^d>N0&iRZKjm)F&mCi}{m$odL?8w~y+M5$`X0vIGVxPxWw_GkwJD<<;&fF~I z3P5gAJz+@fAoPR}Z)J@DycPZrFz!7AaFLl#r)sm=m~Z}c_EDUM{|=xFI^9c>FZ{gR z1*+Amp3P?Za=GBZCqmE-8?Z&e`)YheaA>t!i3I(fQrPkc0v`a(O5OyUp0a=k0Ikc1 zwBPUddNdm8Mx()Y5;~v@I&H#ofNc*T@BpCVWcy_tt=H>5982hcP8S5&emekEp%VaL zwmdlXtq$n63AR1h;$?vQ_18z*{}dE-+vMYGG5an+4w1kAsZ@eWIr44K`$0%9bQ#TT z01k)4muGhW>!s(8ZNu(!%&-bcuh%ox85J6RazwQGw#Tjk9OOSimc0Z%Aqb8S5daQ) zMUagdP=s0J#1J!pgI*D2V+Isq7CAA*4B((w1lgDYMVLiS4F3S;0GY1s8sAa?0000< KMNUMnLSTY26Ld}h literal 0 HcmV?d00001 diff --git a/Telegram/Resources/icons/payments/payment_name@3x.png b/Telegram/Resources/icons/payments/payment_name@3x.png new file mode 100644 index 0000000000000000000000000000000000000000..23d2ee2435c84333aa996cc3f8660afe562304e9 GIT binary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--git a/Telegram/Resources/icons/payments/payment_phone.png b/Telegram/Resources/icons/payments/payment_phone.png new file mode 100644 index 0000000000000000000000000000000000000000..87b185d8c6eba2ee0ccf073755c7f4597c336758 GIT binary patch literal 711 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=fdz#^NA%Cx&(BWL^R}E~ycoX}-P; zT0k}j17mw80}DtA5K93u0|WB{Mh0de%?J`(zyz07Sip>6gA}f5OZv>fz+~v@;usRa z`8MS2>WzT{@_VX(Mre46m2Fa7+Hr&}JJK^ULPPU^*VNYDy}P8v!py>Sbf!#Nq_ajt z{%Q3)%gb*yzkizZdEdL)y(>STxom0t`S;wJmWvq~QeLMns+IgC{$ch3Yi9lP2jpjl zPdNWvaiYh8tgTHaQ<&uCoBWo4Uf3VC=Y9Gip&c=L zyIdDvY>3fge_JNKB}#Y6<;+|4-;{L@=9nq-lx45Dnzi8aO9ip+#={RQ#Ag3#m6Yf| zo^m3{ugYrfq;0p~E}8$AgR{p?*+Q=WfOn#al;Tt`!DnfkE5)Keikk_qw*H#9|GxU( z+ix#C{>brHqN%6%#)=3XEqs|AUk6bng`* zS|OVYEPQ^M+Xwkniaq;m8Mi+C$>C1H9~*ttgpHbBlIW6fIGen}- zihT;XFMMx{*=%3kJ_(mLj?+wOn9 literal 0 HcmV?d00001 diff --git a/Telegram/Resources/icons/payments/payment_phone@2x.png b/Telegram/Resources/icons/payments/payment_phone@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..d047fb5b4bff65dd84d02caae0aff967aa37d2fb GIT binary patch literal 1327 zcmV+~1Px#L}ge>W=%~1DgXcg2mk?xX#fNO00031000^Q000001E2u_0{{R30RRC20H6W@ z1ONa40RR91K%fHv1ONa40RR91KmY&$07g+lumAuAnMp)JRCodHS=%dhK@^{Z2%(6C zM6M4!d7$Jjh43J+{sBqyprkx_^Fm6lL$qB7&r*rjmew0J68YNA~ykrT5v{8Ba0XdEs%`@YB%H0MF0Q z@L9RNy@l!NX~@dTGAxIOu2wvZ8(&^t{+ZpXwx_2jNJ&W%4Fux=tgNi4jMZuw92^u1 z0Lyzg(3k#lcXvlTJw0Ux-QC?JG&Gcihlfj#udlEC?fm?l1O^7mv`6~gCvI+ke=^WZO%n=rfz<4S*Ybi}OmnVFeDL4cv5A*LOP{QP{wGAU@hc<^D=)6>Hk+T7d> z{r&w+8xo_Vqr4R7#fJ|7B_$<{v9GVM42{J4`Z@#!1@Tgx7au+Vczb)p{r$bl=#K`v zRYFKe2rs31^5Fvj&dHIHkq>*BH{At5`FF^1{_+5V9{>df1&rZH93CD*R8$lXMeW6d z9{}jt`T2PUgwoPddnwL~FJAzPii#Kj78e(#?NG3=SAxeE05o)AVSxdmzP?^5P_#OK z0PsggSuhinl$0cz;gUXF5+c;=s?yrpN-8TW<@W9EZ9+jHmzS4v+gFw1;$o7JkU;$W z{K&z`m?b#-;n)zt-KV`D&%-l`lU_RGu5Qvqtj>&m|N2LKgGOiToNQ-r!Q zWo>N@Xud!)l=(o3@$qr+@bFM7E7kG%-P_yCbg!tWQ1ufE091x%f?#=hnNeJen46me zJYZ=V(bCew46UlF((J3n1KYV|geaqL6?!fpX=!Pst*wpFDPVI9-Yeog<40!6y7SxH z8`I?CqTdu<$WiHr#>L0S!|?DhC8aI8>SbkR|0VzkAPrw>r|9hLgwxa09|Q3C_y}QPVgD`w$|!Pm zb%mUq9B6NE2kR?0Eo5qIYxNorb~_7DqYM{Z*zkfiE-p^>;Dsw*$TT%Ik%55$-LixR zK(|#t7^r{m_<<0SyP5!q>>WqwW=4P`P!?H+837`D#}T@j5#R`vMV4VkfXLo)gl=X8 lI09vnWtb5lvUePz+aGJ+c$OHjO3eTO002ovPDHLkV1k6cRF?n% literal 0 HcmV?d00001 diff --git a/Telegram/Resources/icons/payments/payment_phone@3x.png b/Telegram/Resources/icons/payments/payment_phone@3x.png new file mode 100644 index 0000000000000000000000000000000000000000..ff201d3e80b5a34d04cb0e33f0b6d464a3c43608 GIT binary patch literal 2090 zcmbtVdpOf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ka(%q zuf0FfaxZv$1^c*PI_#?b#2A;+>r$4Bu@BLZ z>w$Z2q0tuX$(L7L4Wyd9JVfa_h8$f`{h6wWPi<*zEA82YEDOJ@iL0-aw#|E>EsF*3-^r`* zwd_c)tgJL^$DG>~?NUZL#S!{#R}}J)RsdH}R9dQ^T&7?P<5pNb+u{8=S5CR$S)i3D zN8LX#(112tm*qbV_rzLqR1lG$M@xLbYf4i8ZfEDOGpwB`yUg&yQ Q^wXz3@IJVDH)__u0F;ZaD*ylh literal 0 HcmV?d00001 diff --git a/Telegram/Resources/icons/payments/payment_shipping.png b/Telegram/Resources/icons/payments/payment_shipping.png new file mode 100644 index 0000000000000000000000000000000000000000..aa618f5fb67dc8da2f5e9844942042918dd3d266 GIT binary patch literal 526 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=fdz#^NA%Cx&(BWL^R}E~ycoX}-P; zT0k}j17mw80}DtA5K93u0|WB{Mh0de%?J`(zyz07Sip>6gA}f5OZp5{R^jR57!twx zHq>#Qi-SO}ib~!?hP;Ht-o4TmjlI$xvpbr1G`02$co#DLUHz-y<$H;=vap%fOT*CE z(D#*57daF~uH`Pf-}Z;8j>Cq_hD$@#z<2VKO21=;DpM{wXGe-%GU4rf{A2ZYY4(e^ znFyh zN@l68di_gKXuoR1lUv(TRcy}hZg-fL+T##={mP~_{wj6r8**=Nd2QvkNXL6s<}JC- z`@#o~KiH)=_xa3;9+$sVF?lF;DY-FR4Umm_yOmM=-hxT24t8~qz267RKUIk-+$Joz zT*=S9r?bq&e~ojz7XM|wx)fo-Px#L}ge>W=%~1DgXcg2mk?xX#fNO00031000^Q000001E2u_0{{R30RRC20H6W@ z1ONa40RR91K%fHv1ONa40RR91KmY&$07g+lumAu9Xh}ptRCodHSut)ZF%UHrPy{KV zjFc#6NP!e2L=}p3T!DfkP;rEGbXiR4EPd=c>*w>0X_p_&VVn0m?waL z2>KH6B@lB4jxK>jBEhQFDtmi-WApi(an7yJ<#Ng1-``oI(O}ot*Cz`V8X}}AjN$!$ zU-*2!u~;m4xm+gMY3LWtc@g=uJHMq_WCSl13bsk05g^ijYtOHI4u`|vB|y}?;&`vu z<2N@qwvF20U0z=DTCJw&!{+|}-ljfU28aiqV$i9am+SZC+K>ilUWHQRr z`1A8q*`H$5?RFK|$HzxyA9X`wQwfFG2<0cAcXxM++SO{sFD@>u=p|=BRJM<~|KsC> zjmP8Nt*KOs6^q5)KFY!g0^s25>#O2trBYG$Q8uJhQgZQ3B_N#RrBX>zyDo;KKte8;ll|x7Wy#d(om>JyVj2&jQISPw=(h%R zi`3t#hi%Cu?cI(hy;JpXENleB8Ucug+#^Jv5dA`&9g`)t@qP-~t{#L?=vpbdzaijZ zJwo&kA!C9M848}x9#cKva^X(PfI)>KQbs*OkN{a3OSh)t1?|ychMYwsfYKv`Y=|+O zig$JbrqgLqr?TJn2+=CTI_jX{!L~4hHP>kw&}y}Q^hxd!VjXo*@L-$9!LTzL0WfGb zn;rCvV(>u_>4GU9Y?5UOM9>HTFcg7pT{%!vR`T=UG7Jwkz?LJOM|RK&knf>BwB&nr zYuk7_9f7lG1W>=W0?PO5(>7k1K5;!70l1&?;$ouDHeQI%=mbCkB8T+FUuXFD2or0Z z;aZ3hd)IB_9nw$!H7J1ot6}ZOkgKeC0$h!pExUaN*kaOE9G?NMM$VSqJ_Bqq=_-!T s09PYt%Wj_mwwQDk$7g`6k+Ws@A9kxCwv1J*{Qv*}07*qoM6N<$f=M62^Z)<= literal 0 HcmV?d00001 diff --git a/Telegram/Resources/icons/payments/payment_shipping@3x.png b/Telegram/Resources/icons/payments/payment_shipping@3x.png new file mode 100644 index 0000000000000000000000000000000000000000..8b08421d09b50c2947c5031b96039ece6917f8ca GIT binary patch literal 1469 zcmb7^doM256;Vh} zApj8N5I`s#+PW)O`g=+#NBmQ71*;B5k^n%N5#5{vFG8Q#N4=H^TGtzDN{uJuDoQyI zD5fFn*Fr+&SMF{iVOVH=#^i)t6Y0KTZuMjd2|v?tBMT5HzZWg5%XTxS#S=cZv9zhS zSjq(bP_d*$Qd|&K0Bazxj9SNet7{b}xr_M_^!$i6G6PU9WQ0cSCjgw&b1Q3YBT!^O z`LPhK0bZ-)e)B@9fS7GX^Bg54Xh6LF><=krOh7ToRRDUv1RB}{|NUI>4MNwzK<$vd zeP(WM?(F=$DcKY5n3y<(KHUA%S-J(?p3x!gBqn z2AuQnl)(4tX1w*Wxg^a<)gN zWBW`Uyx%T{THa=^oGz)VvN-*Ay>xhV^mgzRUU~Pykjw<%oSfL(vSi9Q9FBq#2!$22=5GSu0Wu1U#U57~8XD>_oKyi*Uq%XlI<8`G zZ(rTez!k1B>AZcyp7 zd#!b*_a-~^5(}al3EaASy~dGCb4B5COuXv#%2wWI8q0TO#gH%_#Km=UcA6)BQ3VHT z9>V9wi7pjkt3crPs_`WAXN|{6RQM6=QI{B>ZN%@UhAGV}Lg`wTk1eOsO{{{ZG8dhe z<2d{$1|E=neFKuA?n+|$5TkO~y>8^K!RABgS#xvIuTI?RxHaint=4|t3&BE%V!e(U za)R~E#CcsedQL@STNjOw{qBj%SSoxrXj8;ytEyu#^aLJ%VQPi?sKrBU=y(0@vHB`Ter^*VFTCsFv1{+!&O0qK4orI{=O5J^ zHy*V;Oc1+TWi~B6Fi>EGOHhFEe?jEG81x!!0%?SPhwACVYg_0fx|7`MTqsxn0)+#N AFaQ7m literal 0 HcmV?d00001 diff --git a/Telegram/Resources/langs/lang.strings b/Telegram/Resources/langs/lang.strings index 11bb8041c..6be8d6bd0 100644 --- a/Telegram/Resources/langs/lang.strings +++ b/Telegram/Resources/langs/lang.strings @@ -1865,24 +1865,27 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL "lng_payments_pay_amount" = "Pay {amount}"; "lng_payments_payment_method" = "Payment Method"; "lng_payments_new_card" = "New Card..."; -"lng_payments_payment_method_ph" = "Enter your card details"; -"lng_payments_shipping_address" = "Shipping Information"; -"lng_payments_shipping_address_ph" = "Enter your shipping information"; +"lng_payments_shipping_address" = "Shipping Address"; +"lng_payments_receiver_information" = "Receiver"; +"lng_payments_address_street1" = "Address 1"; +"lng_payments_address_street2" = "Address 2"; +"lng_payments_address_city" = "City"; +"lng_payments_address_state" = "State"; +"lng_payments_address_country" = "Country"; +"lng_payments_address_postcode" = "Postcode"; + "lng_payments_shipping_method" = "Shipping Method"; -"lng_payments_shipping_method_ph" = "Choose your shipping method"; "lng_payments_info_name" = "Name"; -"lng_payments_info_name_ph" = "Enter your name"; "lng_payments_info_email" = "Email"; -"lng_payments_info_email_ph" = "Enter your email"; "lng_payments_info_phone" = "Phone"; -"lng_payments_info_phone_ph" = "Enter your phone number"; "lng_payments_shipping_address_title" = "Shipping Address"; "lng_payments_save_shipping_about" = "You can save your shipping information for future use."; -"lng_payments_payment_card" = "Payment Card"; -"lng_payments_cardholder_title" = "Cardholder"; -"lng_payments_cardholder_about" = "Cardholder Name"; -"lng_payments_billing_address" = "Billing Address"; -"lng_payments_zip_code" = "Zip Code"; +"lng_payments_card_title" = "New Card"; +"lng_payments_card_number" = "Card Number"; +"lng_payments_card_holder" = "Cardholder name"; +"lng_payments_billing_address" = "Billing Information"; +"lng_payments_billing_country" = "Country"; +"lng_payments_billing_zip_code" = "Zip Code"; "lng_payments_save_payment_about" = "You can save your payment information for future use."; "lng_payments_save_information" = "Save Information"; diff --git a/Telegram/SourceFiles/payments/payments_checkout_process.cpp b/Telegram/SourceFiles/payments/payments_checkout_process.cpp index d6ae27bb5..5b7287066 100644 --- a/Telegram/SourceFiles/payments/payments_checkout_process.cpp +++ b/Telegram/SourceFiles/payments/payments_checkout_process.cpp @@ -15,6 +15,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "storage/storage_domain.h" #include "history/history_item.h" #include "history/history.h" +#include "data/data_user.h" // UserData::isBot. #include "core/local_url_handlers.h" // TryConvertUrlToLocal. #include "core/file_utilities.h" // File::OpenUrl. #include "apiwrap.h" @@ -105,6 +106,8 @@ void CheckoutProcess::handleFormUpdate(const FormUpdate &update) { if (!_initialSilentValidation) { showForm(); } + }, [&](const ThumbnailUpdated &data) { + _panel->updateFormThumbnail(data.thumbnail); }, [&](const ValidateFinished &) { if (_initialSilentValidation) { _initialSilentValidation = false; @@ -114,16 +117,16 @@ void CheckoutProcess::handleFormUpdate(const FormUpdate &update) { _submitState = SubmitState::Validated; panelSubmit(); } - }, [&](const PaymentMethodUpdate&) { + }, [&](const PaymentMethodUpdate &) { showForm(); - }, [&](const VerificationNeeded &info) { - if (!_panel->showWebview(info.url, false)) { - File::OpenUrl(info.url); + }, [&](const VerificationNeeded &data) { + if (!_panel->showWebview(data.url, false)) { + File::OpenUrl(data.url); panelCloseSure(); } - }, [&](const PaymentFinished &result) { + }, [&](const PaymentFinished &data) { const auto weak = base::make_weak(this); - _session->api().applyUpdates(result.updates); + _session->api().applyUpdates(data.updates); if (weak) { panelCloseSure(); } diff --git a/Telegram/SourceFiles/payments/payments_form.cpp b/Telegram/SourceFiles/payments/payments_form.cpp index b6ad2c95e..6114bcb65 100644 --- a/Telegram/SourceFiles/payments/payments_form.cpp +++ b/Telegram/SourceFiles/payments/payments_form.cpp @@ -9,10 +9,18 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "main/main_session.h" #include "data/data_session.h" -#include "apiwrap.h" +#include "data/data_media_types.h" +#include "data/data_user.h" +#include "data/data_photo.h" +#include "data/data_photo_media.h" +#include "data/data_file_origin.h" +#include "history/history_item.h" #include "stripe/stripe_api_client.h" #include "stripe/stripe_error.h" #include "stripe/stripe_token.h" +#include "ui/image/image.h" +#include "apiwrap.h" +#include "styles/style_payments.h" // paymentsThumbnailSize. #include #include @@ -82,15 +90,110 @@ namespace { Form::Form(not_null session, FullMsgId itemId) : _session(session) , _api(&_session->mtp()) -, _msgId(itemId.msg) { +, _msgId(itemId) { + fillInvoiceFromMessage(); requestForm(); } Form::~Form() = default; +void Form::fillInvoiceFromMessage() { + if (const auto item = _session->data().message(_msgId)) { + if (const auto media = item->media()) { + if (const auto invoice = media->invoice()) { + _invoice.cover = Ui::Cover{ + .title = invoice->title, + .description = invoice->description, + }; + if (const auto photo = invoice->photo) { + loadThumbnail(photo); + } + } + } + } +} + +void Form::loadThumbnail(not_null photo) { + Expects(!_thumbnailLoadProcess); + + auto view = photo->createMediaView(); + if (auto good = prepareGoodThumbnail(view); !good.isNull()) { + _invoice.cover.thumbnail = std::move(good); + return; + } + _thumbnailLoadProcess = std::make_unique(); + if (auto blurred = prepareBlurredThumbnail(view); !blurred.isNull()) { + _invoice.cover.thumbnail = std::move(blurred); + _thumbnailLoadProcess->blurredSet = true; + } else { + _invoice.cover.thumbnail = prepareEmptyThumbnail(); + } + _thumbnailLoadProcess->view = std::move(view); + photo->load(Data::PhotoSize::Thumbnail, _msgId); + _session->downloaderTaskFinished( + ) | rpl::start_with_next([=] { + const auto &view = _thumbnailLoadProcess->view; + if (auto good = prepareGoodThumbnail(view); !good.isNull()) { + _invoice.cover.thumbnail = std::move(good); + _thumbnailLoadProcess = nullptr; + } else if (_thumbnailLoadProcess->blurredSet) { + return; + } else if (auto blurred = prepareBlurredThumbnail(view) + ; !blurred.isNull()) { + _invoice.cover.thumbnail = std::move(blurred); + _thumbnailLoadProcess->blurredSet = true; + } else { + return; + } + _updates.fire(ThumbnailUpdated{ _invoice.cover.thumbnail }); + }, _thumbnailLoadProcess->lifetime); +} + +QImage Form::prepareGoodThumbnail( + const std::shared_ptr &view) const { + using Size = Data::PhotoSize; + if (const auto large = view->image(Size::Large)) { + return prepareThumbnail(large); + } else if (const auto thumbnail = view->image(Size::Thumbnail)) { + return prepareThumbnail(thumbnail); + } + return QImage(); +} + +QImage Form::prepareBlurredThumbnail( + const std::shared_ptr &view) const { + if (const auto small = view->image(Data::PhotoSize::Small)) { + return prepareThumbnail(small, true); + } else if (const auto blurred = view->thumbnailInline()) { + return prepareThumbnail(blurred, true); + } + return QImage(); +} + +QImage Form::prepareThumbnail( + not_null image, + bool blurred) const { + auto result = image->original().scaled( + st::paymentsThumbnailSize * cIntRetinaFactor(), + Qt::KeepAspectRatio, + Qt::SmoothTransformation); + Images::prepareRound(result, ImageRoundRadius::Large); + result.setDevicePixelRatio(cRetinaFactor()); + return result; +} + +QImage Form::prepareEmptyThumbnail() const { + auto result = QImage( + st::paymentsThumbnailSize * cIntRetinaFactor(), + QImage::Format_ARGB32_Premultiplied); + result.setDevicePixelRatio(cRetinaFactor()); + result.fill(Qt::transparent); + return result; +} + void Form::requestForm() { _api.request(MTPpayments_GetPaymentForm( - MTP_int(_msgId) + MTP_int(_msgId.msg) )).done([=](const MTPpayments_PaymentForm &result) { result.match([&](const auto &data) { processForm(data); @@ -123,6 +226,8 @@ void Form::processForm(const MTPDpayments_paymentForm &data) { void Form::processInvoice(const MTPDinvoice &data) { _invoice = Ui::Invoice{ + .cover = std::move(_invoice.cover), + .prices = ParsePrices(data.vprices()), .currency = qs(data.vcurrency()), @@ -154,6 +259,11 @@ void Form::processDetails(const MTPDpayments_paymentForm &data) { .canSaveCredentials = data.is_can_save_credentials(), .passwordMissing = data.is_password_missing(), }; + if (_details.botId) { + if (const auto bot = _session->data().userLoaded(_details.botId)) { + _invoice.cover.seller = bot->name; + } + } } void Form::processSavedInformation(const MTPDpaymentRequestedInfo &data) { @@ -240,7 +350,7 @@ void Form::submit() { | (_shippingOptions.selectedId.isEmpty() ? Flag(0) : Flag::f_shipping_option_id)), - MTP_int(_msgId), + MTP_int(_msgId.msg), MTP_string(_requestedInformationId), MTP_string(_shippingOptions.selectedId), MTP_inputPaymentCredentials( @@ -267,7 +377,7 @@ void Form::validateInformation(const Ui::RequestedInformation &information) { _validatedInformation = information; _validateRequestId = _api.request(MTPpayments_ValidateRequestedInfo( MTP_flags(0), // #TODO payments save information - MTP_int(_msgId), + MTP_int(_msgId.msg), Serialize(information) )).done([=](const MTPpayments_ValidatedRequestedInfo &result) { _validateRequestId = 0; diff --git a/Telegram/SourceFiles/payments/payments_form.h b/Telegram/SourceFiles/payments/payments_form.h index 7fbbe6c2a..803dd4b3f 100644 --- a/Telegram/SourceFiles/payments/payments_form.h +++ b/Telegram/SourceFiles/payments/payments_form.h @@ -11,6 +11,8 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "base/weak_ptr.h" #include "mtproto/sender.h" +class Image; + namespace Stripe { class APIClient; } // namespace Stripe @@ -19,6 +21,10 @@ namespace Main { class Session; } // namespace Main +namespace Data { +class PhotoMedia; +} // namespace Data + namespace Payments { struct FormDetails { @@ -38,6 +44,12 @@ struct FormDetails { } }; +struct ThumbnailLoadProcess { + std::shared_ptr view; + bool blurredSet = false; + rpl::lifetime lifetime; +}; + struct SavedCredentials { QString id; QString title; @@ -88,6 +100,9 @@ struct PaymentMethod { }; struct FormReady {}; +struct ThumbnailUpdated { + QImage thumbnail; +}; struct ValidateFinished {}; struct PaymentMethodUpdate {}; struct VerificationNeeded { @@ -109,6 +124,7 @@ struct Error { struct FormUpdate : std::variant< FormReady, + ThumbnailUpdated, ValidateFinished, PaymentMethodUpdate, VerificationNeeded, @@ -149,6 +165,18 @@ public: void submit(); private: + void fillInvoiceFromMessage(); + + void loadThumbnail(not_null photo); + [[nodiscard]] QImage prepareGoodThumbnail( + const std::shared_ptr &view) const; + [[nodiscard]] QImage prepareBlurredThumbnail( + const std::shared_ptr &view) const; + [[nodiscard]] QImage prepareThumbnail( + not_null image, + bool blurred = false) const; + [[nodiscard]] QImage prepareEmptyThumbnail() const; + void requestForm(); void processForm(const MTPDpayments_paymentForm &data); void processInvoice(const MTPDinvoice &data); @@ -167,9 +195,10 @@ private: const not_null _session; MTP::Sender _api; - MsgId _msgId = 0; + FullMsgId _msgId; Ui::Invoice _invoice; + std::unique_ptr _thumbnailLoadProcess; FormDetails _details; Ui::RequestedInformation _savedInformation; PaymentMethod _paymentMethod; diff --git a/Telegram/SourceFiles/payments/ui/payments.style b/Telegram/SourceFiles/payments/ui/payments.style index d331d3033..811f70160 100644 --- a/Telegram/SourceFiles/payments/ui/payments.style +++ b/Telegram/SourceFiles/payments/ui/payments.style @@ -7,12 +7,52 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL */ using "ui/basic.style"; -using "passport/passport.style"; +using "info/info.style"; -paymentsFormPricePadding: margins(22px, 7px, 22px, 6px); -paymentsPanelSubmit: RoundButton(passportPasswordSubmit) { +paymentsPanelSubmit: RoundButton(defaultActiveButton) { width: 0px; height: 49px; padding: margins(0px, -3px, 0px, 0px); textTop: 16px; } + +paymentsCoverPadding: margins(26px, 0px, 26px, 13px); +paymentsDescription: FlatLabel(defaultFlatLabel) { + minWidth: 160px; + textFg: windowFg; +} +paymentsTitle: FlatLabel(paymentsDescription) { + style: semiboldTextStyle; +} +paymentsSeller: FlatLabel(paymentsDescription) { + textFg: windowSubTextFg; +} +paymentsPriceLabel: paymentsDescription; +paymentsPriceAmount: defaultFlatLabel; +paymentsFullPriceLabel: paymentsTitle; +paymentsFullPriceAmount: FlatLabel(defaultFlatLabel) { + style: semiboldTextStyle; +} + +paymentsTitleTop: 0px; +paymentsDescriptionTop: 3px; +paymentsSellerTop: 4px; + +paymentsThumbnailSize: size(80px, 80px); +paymentsThumbnailSkip: 18px; + +paymentsPricesTopSkip: 12px; +paymentsPricesBottomSkip: 13px; +paymentsPricePadding: margins(28px, 6px, 28px, 5px); + +paymentsSectionsTopSkip: 11px; +paymentsSectionButton: SettingsButton(infoProfileButton) { + padding: margins(68px, 11px, 14px, 9px); +} + +paymentsIconPaymentMethod: icon {{ "payments/payment_card", menuIconFg }}; +paymentsIconShippingAddress: icon {{ "payments/payment_address", menuIconFg }}; +paymentsIconName: icon {{ "payments/payment_name", menuIconFg }}; +paymentsIconEmail: icon {{ "payments/payment_email", menuIconFg }}; +paymentsIconPhone: icon {{ "payments/payment_phone", menuIconFg }}; +paymentsIconShippingMethod: icon {{ "payments/payment_shipping", menuIconFg }}; diff --git a/Telegram/SourceFiles/payments/ui/payments_form_summary.cpp b/Telegram/SourceFiles/payments/ui/payments_form_summary.cpp index dfcee629e..0f63805be 100644 --- a/Telegram/SourceFiles/payments/ui/payments_form_summary.cpp +++ b/Telegram/SourceFiles/payments/ui/payments_form_summary.cpp @@ -8,7 +8,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "payments/ui/payments_form_summary.h" #include "payments/ui/payments_panel_delegate.h" -#include "passport/ui/passport_form_row.h" +#include "settings/settings_common.h" #include "ui/widgets/scroll_area.h" #include "ui/widgets/buttons.h" #include "ui/widgets/labels.h" @@ -22,7 +22,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL namespace Payments::Ui { using namespace ::Ui; -using namespace Passport::Ui; class PanelDelegate; @@ -45,16 +44,24 @@ FormSummary::FormSummary( this, tr::lng_payments_pay_amount( lt_amount, - rpl::single(computeTotalAmount())), + rpl::single(formatAmount(computeTotalAmount()))), st::paymentsPanelSubmit) { setupControls(); } -QString FormSummary::computeAmount(int64 amount) const { - return FillAmountAndCurrency(amount, _invoice.currency); +void FormSummary::updateThumbnail(const QImage &thumbnail) { + _invoice.cover.thumbnail = thumbnail; + _thumbnails.fire_copy(thumbnail); } -QString FormSummary::computeTotalAmount() const { +QString FormSummary::formatAmount(int64 amount) const { + const auto base = FillAmountAndCurrency( + std::abs(amount), + _invoice.currency); + return (amount > 0) ? base : (QString::fromUtf8("\xe2\x88\x92") + base); +} + +int64 FormSummary::computeTotalAmount() const { const auto total = ranges::accumulate( _invoice.prices, int64(0), @@ -71,7 +78,7 @@ QString FormSummary::computeTotalAmount() const { std::plus<>(), &LabeledPrice::price) : int64(0); - return computeAmount(total + shipping); + return total + shipping; } void FormSummary::setupControls() { @@ -92,22 +99,125 @@ void FormSummary::setupControls() { _1 + _2 < _3)); } -not_null FormSummary::setupContent() { - const auto inner = _scroll->setOwnedWidget( - object_ptr(this)); +void FormSummary::setupCover(not_null layout) { + struct State { + QImage thumbnail; + FlatLabel *title = nullptr; + FlatLabel *description = nullptr; + FlatLabel *seller = nullptr; + }; - _scroll->widthValue( - ) | rpl::start_with_next([=](int width) { - inner->resizeToWidth(width); - }, inner->lifetime()); + const auto cover = layout->add(object_ptr(layout)); + const auto state = cover->lifetime().make_state(); + state->title = CreateChild( + cover, + _invoice.cover.title, + st::paymentsTitle); + state->description = CreateChild( + cover, + _invoice.cover.description, + st::paymentsDescription); + state->seller = CreateChild( + cover, + _invoice.cover.seller, + st::paymentsSeller); + cover->paintRequest( + ) | rpl::start_with_next([=](QRect clip) { + if (state->thumbnail.isNull()) { + return; + } + const auto &padding = st::paymentsCoverPadding; + const auto thumbnailSkip = st::paymentsThumbnailSize.width() + + st::paymentsThumbnailSkip; + const auto left = padding.left(); + const auto top = padding.top(); + const auto rect = QRect( + QPoint(left, top), + state->thumbnail.size() / state->thumbnail.devicePixelRatio()); + if (rect.intersects(clip)) { + QPainter(cover).drawImage(rect, state->thumbnail); + } + }, cover->lifetime()); + rpl::combine( + cover->widthValue(), + _thumbnails.events_starting_with_copy(_invoice.cover.thumbnail) + ) | rpl::start_with_next([=](int width, QImage &&thumbnail) { + const auto &padding = st::paymentsCoverPadding; + const auto thumbnailSkip = st::paymentsThumbnailSize.width() + + st::paymentsThumbnailSkip; + const auto left = padding.left() + + (thumbnail.isNull() ? 0 : thumbnailSkip); + const auto available = width + - padding.left() + - padding.right() + - (thumbnail.isNull() ? 0 : thumbnailSkip); + state->title->resizeToNaturalWidth(available); + state->title->moveToLeft( + left, + padding.top() + st::paymentsTitleTop); + state->description->resizeToNaturalWidth(available); + state->description->moveToLeft( + left, + (state->title->y() + + state->title->height() + + st::paymentsDescriptionTop)); + state->seller->resizeToNaturalWidth(available); + state->seller->moveToLeft( + left, + (state->description->y() + + state->description->height() + + st::paymentsSellerTop)); + const auto thumbnailHeight = padding.top() + + (thumbnail.isNull() + ? 0 + : int(thumbnail.height() / thumbnail.devicePixelRatio())) + + padding.bottom(); + const auto height = state->seller->y() + + state->seller->height() + + padding.bottom(); + cover->resize(width, std::max(thumbnailHeight, height)); + state->thumbnail = std::move(thumbnail); + cover->update(); + }, cover->lifetime()); +} +void FormSummary::setupPrices(not_null layout) { + Settings::AddSkip(layout, st::paymentsPricesTopSkip); + const auto add = [&]( + const QString &label, + int64 amount, + bool full = false) { + const auto &st = full + ? st::paymentsFullPriceAmount + : st::paymentsPriceAmount; + const auto right = CreateChild( + layout.get(), + formatAmount(amount), + st); + const auto &padding = st::paymentsPricePadding; + const auto left = layout->add( + object_ptr( + layout, + label, + (full + ? st::paymentsFullPriceLabel + : st::paymentsPriceLabel)), + style::margins( + padding.left(), + padding.top(), + (padding.right() + + right->naturalWidth() + + 2 * st.style.font->spacew), + padding.bottom())); + rpl::combine( + left->topValue(), + layout->widthValue() + ) | rpl::start_with_next([=](int top, int width) { + right->moveToRight(st::paymentsPricePadding.right(), top, width); + }, right->lifetime()); + }; for (const auto &price : _invoice.prices) { - inner->add( - object_ptr( - inner, - price.label + ": " + computeAmount(price.price), - st::passportFormPolicy), - st::paymentsFormPricePadding); + add(price.label, price.price); } const auto selected = ranges::find( _options.list, @@ -115,44 +225,35 @@ not_null FormSummary::setupContent() { &ShippingOption::id); if (selected != end(_options.list)) { for (const auto &price : selected->prices) { - inner->add( - object_ptr( - inner, - price.label + ": " + computeAmount(price.price), - st::passportFormPolicy), - st::paymentsFormPricePadding); + add(price.label, price.price); } } - inner->add( - object_ptr( - inner, - "Total: " + computeTotalAmount(), - st::passportFormHeader), - st::passportFormHeaderPadding); + add(tr::lng_payments_total_label(tr::now), computeTotalAmount(), true); + Settings::AddSkip(layout, st::paymentsPricesBottomSkip); +} - inner->add( - object_ptr( - inner, - st::passportFormDividerHeight), - { 0, 0, 0, st::passportFormHeaderPadding.top() }); +void FormSummary::setupSections(not_null layout) { + Settings::AddSkip(layout, st::paymentsSectionsTopSkip); - const auto method = inner->add(object_ptr(inner)); - method->addClickHandler([=] { - _delegate->panelEditPaymentMethod(); - }); - method->updateContent( - tr::lng_payments_payment_method(tr::now), - (_method.ready - ? _method.title - : tr::lng_payments_payment_method_ph(tr::now)), - _method.ready, - false, - anim::type::instant); + const auto add = [&]( + rpl::producer title, + const QString &label, + const style::icon *icon, + Fn handler) { + Settings::AddButtonWithLabel( + layout, + std::move(title), + rpl::single(label), + st::paymentsSectionButton, + icon + )->addClickHandler(std::move(handler)); + }; + add( + tr::lng_payments_payment_method(), + _method.title, + &st::paymentsIconPaymentMethod, + [=] { _delegate->panelEditPaymentMethod(); }); if (_invoice.isShippingAddressRequested) { - const auto info = inner->add(object_ptr(inner)); - info->addClickHandler([=] { - _delegate->panelEditShippingInformation(); - }); auto list = QStringList(); const auto push = [&](const QString &value) { if (!value.isEmpty()) { @@ -165,65 +266,61 @@ not_null FormSummary::setupContent() { push(_information.shippingAddress.state); push(_information.shippingAddress.countryIso2); push(_information.shippingAddress.postcode); - info->updateContent( - tr::lng_payments_shipping_address(tr::now), - (list.isEmpty() - ? tr::lng_payments_shipping_address_ph(tr::now) - : list.join(", ")), - !list.isEmpty(), - false, - anim::type::instant); + add( + tr::lng_payments_shipping_address(), + list.join(", "), + &st::paymentsIconShippingAddress, + [=] { _delegate->panelEditShippingInformation(); }); } if (!_options.list.empty()) { - const auto options = inner->add(object_ptr(inner)); - options->addClickHandler([=] { - _delegate->panelChooseShippingOption(); - }); - options->updateContent( - tr::lng_payments_shipping_method(tr::now), - (selected != end(_options.list) - ? selected->title - : tr::lng_payments_shipping_method_ph(tr::now)), - (selected != end(_options.list)), - false, - anim::type::instant); + const auto selected = ranges::find( + _options.list, + _options.selectedId, + &ShippingOption::id); + add( + tr::lng_payments_shipping_method(), + (selected != end(_options.list)) ? selected->title : QString(), + &st::paymentsIconShippingMethod, + [=] { _delegate->panelChooseShippingOption(); }); } if (_invoice.isNameRequested) { - const auto name = inner->add(object_ptr(inner)); - name->addClickHandler([=] { _delegate->panelEditName(); }); - name->updateContent( - tr::lng_payments_info_name(tr::now), - (_information.name.isEmpty() - ? tr::lng_payments_info_name_ph(tr::now) - : _information.name), - !_information.name.isEmpty(), - false, - anim::type::instant); + add( + tr::lng_payments_info_name(), + _information.name, + &st::paymentsIconName, + [=] { _delegate->panelEditName(); }); } if (_invoice.isEmailRequested) { - const auto email = inner->add(object_ptr(inner)); - email->addClickHandler([=] { _delegate->panelEditEmail(); }); - email->updateContent( - tr::lng_payments_info_email(tr::now), - (_information.email.isEmpty() - ? tr::lng_payments_info_email_ph(tr::now) - : _information.email), - !_information.email.isEmpty(), - false, - anim::type::instant); + add( + tr::lng_payments_info_email(), + _information.email, + &st::paymentsIconEmail, + [=] { _delegate->panelEditEmail(); }); } if (_invoice.isPhoneRequested) { - const auto phone = inner->add(object_ptr(inner)); - phone->addClickHandler([=] { _delegate->panelEditPhone(); }); - phone->updateContent( - tr::lng_payments_info_phone(tr::now), - (_information.phone.isEmpty() - ? tr::lng_payments_info_phone_ph(tr::now) - : _information.phone), - !_information.phone.isEmpty(), - false, - anim::type::instant); + add( + tr::lng_payments_info_phone(), + _information.phone, + &st::paymentsIconPhone, + [=] { _delegate->panelEditPhone(); }); } + Settings::AddSkip(layout, st::paymentsSectionsTopSkip); +} + +not_null FormSummary::setupContent() { + const auto inner = _scroll->setOwnedWidget( + object_ptr(this)); + + _scroll->widthValue( + ) | rpl::start_with_next([=](int width) { + inner->resizeToWidth(width); + }, inner->lifetime()); + + setupCover(inner); + Settings::AddDivider(inner); + setupPrices(inner); + Settings::AddDivider(inner); + setupSections(inner); return inner; } diff --git a/Telegram/SourceFiles/payments/ui/payments_form_summary.h b/Telegram/SourceFiles/payments/ui/payments_form_summary.h index 38f30ff0f..8ce6bcd4c 100644 --- a/Telegram/SourceFiles/payments/ui/payments_form_summary.h +++ b/Telegram/SourceFiles/payments/ui/payments_form_summary.h @@ -15,6 +15,7 @@ namespace Ui { class ScrollArea; class FadeShadow; class RoundButton; +class VerticalLayout; } // namespace Ui namespace Payments::Ui { @@ -33,15 +34,20 @@ public: const ShippingOptions &options, not_null delegate); + void updateThumbnail(const QImage &thumbnail); + private: void resizeEvent(QResizeEvent *e) override; void setupControls(); [[nodiscard]] not_null setupContent(); + void setupCover(not_null layout); + void setupPrices(not_null layout); + void setupSections(not_null layout); void updateControlsGeometry(); - [[nodiscard]] QString computeAmount(int64 amount) const; - [[nodiscard]] QString computeTotalAmount() const; + [[nodiscard]] QString formatAmount(int64 amount) const; + [[nodiscard]] int64 computeTotalAmount() const; const not_null _delegate; Invoice _invoice; @@ -52,6 +58,7 @@ private: object_ptr _topShadow; object_ptr _bottomShadow; object_ptr _submit; + rpl::event_stream _thumbnails; }; diff --git a/Telegram/SourceFiles/payments/ui/payments_panel.cpp b/Telegram/SourceFiles/payments/ui/payments_panel.cpp index 97c652e12..1ae7054ec 100644 --- a/Telegram/SourceFiles/payments/ui/payments_panel.cpp +++ b/Telegram/SourceFiles/payments/ui/payments_panel.cpp @@ -52,17 +52,24 @@ void Panel::showForm( const RequestedInformation ¤t, const PaymentMethodDetails &method, const ShippingOptions &options) { - _widget->showInner( - base::make_unique_q( - _widget.get(), - invoice, - current, - method, - options, - _delegate)); + auto form = base::make_unique_q( + _widget.get(), + invoice, + current, + method, + options, + _delegate); + _weakFormSummary = form.get(); + _widget->showInner(std::move(form)); _widget->setBackAllowed(false); } +void Panel::updateFormThumbnail(const QImage &thumbnail) { + if (_weakFormSummary) { + _weakFormSummary->updateThumbnail(thumbnail); + } +} + void Panel::showEditInformation( const Invoice &invoice, const RequestedInformation ¤t, diff --git a/Telegram/SourceFiles/payments/ui/payments_panel.h b/Telegram/SourceFiles/payments/ui/payments_panel.h index a8a694a89..e07703ba9 100644 --- a/Telegram/SourceFiles/payments/ui/payments_panel.h +++ b/Telegram/SourceFiles/payments/ui/payments_panel.h @@ -28,6 +28,7 @@ struct RequestedInformation; struct ShippingOptions; enum class InformationField; enum class CardField; +class FormSummary; class EditInformation; class EditCard; struct PaymentMethodDetails; @@ -45,6 +46,7 @@ public: const RequestedInformation ¤t, const PaymentMethodDetails &method, const ShippingOptions &options); + void updateFormThumbnail(const QImage &thumbnail); void showEditInformation( const Invoice &invoice, const RequestedInformation ¤t, @@ -78,6 +80,7 @@ private: const not_null _delegate; std::unique_ptr _widget; std::unique_ptr _webview; + QPointer _weakFormSummary; QPointer _weakEditInformation; QPointer _weakEditCard; diff --git a/Telegram/SourceFiles/payments/ui/payments_panel_data.h b/Telegram/SourceFiles/payments/ui/payments_panel_data.h index 7c3964c29..03f37aa4e 100644 --- a/Telegram/SourceFiles/payments/ui/payments_panel_data.h +++ b/Telegram/SourceFiles/payments/ui/payments_panel_data.h @@ -14,7 +14,16 @@ struct LabeledPrice { int64 price = 0; }; +struct Cover { + QString title; + QString description; + QString seller; + QImage thumbnail; +}; + struct Invoice { + Cover cover; + std::vector prices; QString currency;