init
Some checks failed
Docker. / Ubuntu (push) Has been cancelled
User-agent updater. / User-agent (push) Failing after 15s
Lock Threads / lock (push) Failing after 10s
Waiting for answer. / waiting-for-answer (push) Failing after 22s
Needs user action. / needs-user-action (push) Failing after 8s
Can't reproduce. / cant-reproduce (push) Failing after 8s
Close stale issues and PRs / stale (push) Has been cancelled
Some checks failed
Docker. / Ubuntu (push) Has been cancelled
User-agent updater. / User-agent (push) Failing after 15s
Lock Threads / lock (push) Failing after 10s
Waiting for answer. / waiting-for-answer (push) Failing after 22s
Needs user action. / needs-user-action (push) Failing after 8s
Can't reproduce. / cant-reproduce (push) Failing after 8s
Close stale issues and PRs / stale (push) Has been cancelled
This commit is contained in:
60
Telegram/SourceFiles/ui/text/format_values.h
Normal file
60
Telegram/SourceFiles/ui/text/format_values.h
Normal file
@@ -0,0 +1,60 @@
|
||||
/*
|
||||
This file is part of Telegram Desktop,
|
||||
the official desktop application for the Telegram messaging service.
|
||||
|
||||
For license and copyright information please follow this link:
|
||||
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
namespace Ui {
|
||||
|
||||
inline constexpr auto FileStatusSizeReady = 0xFFFFFFF0LL;
|
||||
inline constexpr auto FileStatusSizeLoaded = 0xFFFFFFF1LL;
|
||||
inline constexpr auto FileStatusSizeFailed = 0xFFFFFFF2LL;
|
||||
|
||||
inline const QString kCreditsCurrency = u"XTR"_q;
|
||||
|
||||
[[nodiscard]] QString FormatSizeText(qint64 size);
|
||||
[[nodiscard]] QString FormatDownloadText(qint64 ready, qint64 total);
|
||||
[[nodiscard]] QString FormatProgressText(qint64 ready, qint64 total);
|
||||
[[nodiscard]] QString FormatDateTime(QDateTime date);
|
||||
[[nodiscard]] QString FormatDateTimeSavedFrom(QDateTime date);
|
||||
[[nodiscard]] QString FormatDurationText(qint64 duration);
|
||||
[[nodiscard]] QString FormatDurationWords(qint64 duration);
|
||||
[[nodiscard]] QString FormatDurationWordsSlowmode(qint64 duration);
|
||||
[[nodiscard]] QString FormatDurationAndSizeText(qint64 duration, qint64 size);
|
||||
[[nodiscard]] QString FormatGifAndSizeText(qint64 size);
|
||||
[[nodiscard]] QString FormatPlayedText(qint64 played, qint64 duration);
|
||||
[[nodiscard]] QString FormatImageSizeText(const QSize &size);
|
||||
[[nodiscard]] QString FormatPhone(QString phone);
|
||||
[[nodiscard]] QString FormatTTL(float64 ttl);
|
||||
[[nodiscard]] QString FormatTTLAfter(float64 ttl);
|
||||
[[nodiscard]] QString FormatTTLTiny(float64 ttl);
|
||||
[[nodiscard]] QString FormatMuteFor(float64 sec);
|
||||
[[nodiscard]] QString FormatMuteForTiny(float64 sec);
|
||||
[[nodiscard]] QString FormatResetCloudPasswordIn(float64 sec);
|
||||
[[nodiscard]] QString FormatDialogsDate(const QDateTime &lastTime);
|
||||
|
||||
struct CurrencyRule {
|
||||
const char *international = "";
|
||||
char thousands = ',';
|
||||
char decimal = '.';
|
||||
bool left = true;
|
||||
bool space = false;
|
||||
int exponent = 2;
|
||||
bool stripDotZero = false;
|
||||
};
|
||||
|
||||
[[nodiscard]] QString FillAmountAndCurrency(
|
||||
int64 amount,
|
||||
const QString ¤cy,
|
||||
bool forceStripDotZero = false);
|
||||
[[nodiscard]] CurrencyRule LookupCurrencyRule(const QString ¤cy);
|
||||
[[nodiscard]] QString FormatWithSeparators(
|
||||
double amount,
|
||||
int precision,
|
||||
char decimal,
|
||||
char thousands);
|
||||
|
||||
} // namespace Ui
|
||||
Reference in New Issue
Block a user