Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/elfmz/far2l.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorelfmz <fenix1905@tut.by>2022-11-05 20:31:53 +0300
committerGitHub <noreply@github.com>2022-11-05 20:31:53 +0300
commit253a6b140797e035eb9301a1632fed2408a837e2 (patch)
treeed6be316904b5d5ff11b7bfa46e7037fc2ec51d5 /far2l/src/copy.cpp
parent89eaed71c674aadda536408638e3416bc7f4c053 (diff)
support full-width/composite characters and true color palette in terminal (#1386)
Added normal support for full-width (CJK etc) and composite (using diacritics) characters. IMPORTANT: WINPORT API changed in binary incompatible way in order to implement this.
Diffstat (limited to 'far2l/src/copy.cpp')
-rw-r--r--far2l/src/copy.cpp18
1 files changed, 10 insertions, 8 deletions
diff --git a/far2l/src/copy.cpp b/far2l/src/copy.cpp
index 1015ace8..57f274e9 100644
--- a/far2l/src/copy.cpp
+++ b/far2l/src/copy.cpp
@@ -284,7 +284,7 @@ void CopyProgress::SetScanName(const wchar_t *Name)
}
GotoXY(Rect.Left+5,Rect.Top+3);
- FS<<fmt::LeftAlign()<<fmt::Width(Rect.Right-Rect.Left-9)<<fmt::Precision(Rect.Right-Rect.Left-9)<<Name;
+ FS << fmt::Cells() << fmt::LeftAlign() << fmt::Size(Rect.Right - Rect.Left - 9) << Name;
Flush();
}
@@ -369,10 +369,10 @@ void CopyProgress::SetNames(const wchar_t *Src,const wchar_t *Dst)
}
FormatString FString;
- FString<<fmt::LeftAlign()<<fmt::Width(Rect.Right-Rect.Left-9)<<fmt::Precision(Rect.Right-Rect.Left-9)<<Src;
+ FString << fmt::Cells() << fmt::LeftAlign() << fmt::Size(Rect.Right - Rect.Left - 9) << Src;
strSrc=std::move(FString.strValue());
FString.Clear();
- FString<<fmt::LeftAlign()<<fmt::Width(Rect.Right-Rect.Left-9)<<fmt::Precision(Rect.Right-Rect.Left-9)<<Dst;
+ FString << fmt::Cells() << fmt::LeftAlign() << fmt::Size(Rect.Right - Rect.Left - 9) << Dst;
strDst=std::move(FString.strValue());
if (Total)
@@ -424,7 +424,7 @@ void CopyProgress::SetProgress(bool TotalProgress,UINT64 CompletedSize,UINT64 To
Bar[BarLength]=0;
Percents=ToPercent64(CompletedSize,TotalSize);
FormatString strPercents;
- strPercents<<fmt::Width(4)<<Percents<<L"%";
+ strPercents<<fmt::Expand(4)<<Percents<<L"%";
Text(BarCoord.X,BarCoord.Y,Color,Bar);
Text(static_cast<int>(BarCoord.X+BarLength),BarCoord.Y,Color,strPercents);
@@ -3289,9 +3289,11 @@ int ShellCopy::AskOverwrite(const FAR_FIND_DATA_EX &SrcData,
strDestSizeText<<DestSize;
FARString strDateText, strTimeText;
ConvertDate(SrcLastWriteTime,strDateText,strTimeText,8,FALSE,FALSE,TRUE,TRUE);
- strSrcFileStr<<fmt::LeftAlign()<<fmt::Width(17)<<Msg::CopySource<<L" "<<fmt::Width(25)<<fmt::Precision(25)<<strSrcSizeText<<L" "<<strDateText<<L" "<<strTimeText;
+ strSrcFileStr << fmt::Cells() << fmt::LeftAlign() << fmt::Expand(17) << Msg::CopySource
+ << L" " << fmt::Size(25) << strSrcSizeText << L" " << strDateText << L" " << strTimeText;
ConvertDate(DestData.ftLastWriteTime,strDateText,strTimeText,8,FALSE,FALSE,TRUE,TRUE);
- strDestFileStr<<fmt::LeftAlign()<<fmt::Width(17)<<Msg::CopyDest<<L" "<<fmt::Width(25)<<fmt::Precision(25)<<strDestSizeText<<L" "<<strDateText<<L" "<<strTimeText;
+ strDestFileStr << fmt::Cells() << fmt::LeftAlign() << fmt::Expand(17) << Msg::CopyDest
+ << L" " << fmt::Size(25) << strDestSizeText << L" " << strDateText << L" " << strTimeText;
WarnCopyDlgData[WDLG_SRCFILEBTN].Data=strSrcFileStr;
WarnCopyDlgData[WDLG_DSTFILEBTN].Data=strDestFileStr;
@@ -3389,9 +3391,9 @@ int ShellCopy::AskOverwrite(const FAR_FIND_DATA_EX &SrcData,
FormatString strDestSizeText;
strDestSizeText<<DestSize;
ConvertDate(SrcData.ftLastWriteTime,strDateText,strTimeText,8,FALSE,FALSE,TRUE,TRUE);
- strSrcFileStr<<fmt::LeftAlign()<<fmt::Width(17)<<Msg::CopySource<<L" "<<fmt::Width(25)<<fmt::Precision(25)<<strSrcSizeText<<L" "<<strDateText<<L" "<<strTimeText;
+ strSrcFileStr << fmt::Cells() << fmt::LeftAlign() << fmt::Expand(17) << Msg::CopySource << L" " << fmt::Size(25) << strSrcSizeText << L" " << strDateText << L" " << strTimeText;
ConvertDate(DestData.ftLastWriteTime,strDateText,strTimeText,8,FALSE,FALSE,TRUE,TRUE);
- strDestFileStr<<fmt::LeftAlign()<<fmt::Width(17)<<Msg::CopyDest<<L" "<<fmt::Width(25)<<fmt::Precision(25)<<strDestSizeText<<L" "<<strDateText<<L" "<<strTimeText;
+ strDestFileStr << fmt::Cells() << fmt::LeftAlign() << fmt::Expand(17) << Msg::CopyDest << L" " << fmt::Size(25) << strDestSizeText << L" " << strDateText << L" " << strTimeText;
WarnCopyDlgData[WDLG_SRCFILEBTN].Data=strSrcFileStr;
WarnCopyDlgData[WDLG_DSTFILEBTN].Data=strDestFileStr;
WarnCopyDlgData[WDLG_TEXT].Data=Msg::CopyFileRO;