mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-04-04 15:34:58 +00:00
Added type voice for inline bots, fixed keyboard buttons bug.
This commit is contained in:
parent
2b58e4d3a8
commit
00367ec07a
Telegram/SourceFiles
@ -2587,7 +2587,8 @@ void ReplyKeyboard::resize(int width, int height) {
|
||||
int buttonw = qMax(button.text.maxWidth(), 1);
|
||||
float64 textw = exact ? buttonw : (widthForText / float64(s));
|
||||
float64 minw = _st->minButtonWidth(button.type);
|
||||
float64 w = minw + qMax(textw, 0.);
|
||||
float64 w = minw + textw;
|
||||
accumulate_max(w, 2 * float64(_st->buttonPadding()));
|
||||
|
||||
int rectx = static_cast<int>(std::floor(x));
|
||||
int rectw = static_cast<int>(std::floor(x + w)) - rectx;
|
||||
|
@ -751,9 +751,14 @@ void File::paint(Painter &p, const QRect &clip, uint32 selection, const PaintCon
|
||||
_title.drawLeftElided(p, left, titleTop, _width - left, _width);
|
||||
|
||||
p.setPen(st::inlineDescriptionFg);
|
||||
if (_statusText.isEmpty()) {
|
||||
_description.drawLeftElided(p, left, descriptionTop, _width - left, _width);
|
||||
} else {
|
||||
bool drawStatusSize = true;
|
||||
if (_statusSize == FileStatusSizeReady || _statusSize == FileStatusSizeLoaded || _statusSize == FileStatusSizeFailed) {
|
||||
if (!_description.isEmpty()) {
|
||||
_description.drawLeftElided(p, left, descriptionTop, _width - left, _width);
|
||||
drawStatusSize = false;
|
||||
}
|
||||
}
|
||||
if (drawStatusSize) {
|
||||
p.setFont(st::normalFont);
|
||||
p.drawTextLeft(left, descriptionTop, _width, _statusText);
|
||||
}
|
||||
@ -898,14 +903,11 @@ bool File::updateStatusText() const {
|
||||
void File::setStatusSize(int32 newSize, int32 fullSize, int32 duration, qint64 realDuration) const {
|
||||
_statusSize = newSize;
|
||||
if (_statusSize == FileStatusSizeReady) {
|
||||
// _statusText = (duration >= 0) ? formatDurationAndSizeText(duration, fullSize) : (duration < -1 ? formatGifAndSizeText(fullSize) : formatSizeText(fullSize));
|
||||
_statusText = QString();
|
||||
_statusText = (duration >= 0) ? formatDurationAndSizeText(duration, fullSize) : (duration < -1 ? formatGifAndSizeText(fullSize) : formatSizeText(fullSize));
|
||||
} else if (_statusSize == FileStatusSizeLoaded) {
|
||||
// _statusText = (duration >= 0) ? formatDurationText(duration) : (duration < -1 ? qsl("GIF") : formatSizeText(fullSize));
|
||||
_statusText = QString();
|
||||
_statusText = (duration >= 0) ? formatDurationText(duration) : (duration < -1 ? qsl("GIF") : formatSizeText(fullSize));
|
||||
} else if (_statusSize == FileStatusSizeFailed) {
|
||||
// _statusText = lang(lng_attach_failed);
|
||||
_statusText = QString();
|
||||
_statusText = lang(lng_attach_failed);
|
||||
} else if (_statusSize >= 0) {
|
||||
_statusText = formatDownloadText(_statusSize, fullSize);
|
||||
} else {
|
||||
|
@ -67,6 +67,7 @@ std_::unique_ptr<Result> Result::create(uint64 queryId, const MTPBotInlineResult
|
||||
result->insert(qsl("photo"), Result::Type::Photo);
|
||||
result->insert(qsl("video"), Result::Type::Video);
|
||||
result->insert(qsl("audio"), Result::Type::Audio);
|
||||
result->insert(qsl("voice"), Result::Type::Audio);
|
||||
result->insert(qsl("sticker"), Result::Type::Sticker);
|
||||
result->insert(qsl("file"), Result::Type::File);
|
||||
result->insert(qsl("gif"), Result::Type::Gif);
|
||||
|
Loading…
Reference in New Issue
Block a user