mirror of https://github.com/procxx/kepka.git
Apply clang-format
This commit is contained in:
parent
6fbecbca22
commit
f9c7e0bddb
|
@ -369,7 +369,8 @@ void StickerSetBox::Inner::paintEvent(QPaintEvent *e) {
|
|||
if (_pack.isEmpty()) return;
|
||||
|
||||
auto ms = getms();
|
||||
qint32 from = std::floor(e->rect().top() / st::stickersSize.height()), to = std::floor(e->rect().bottom() / st::stickersSize.height()) + 1;
|
||||
qint32 from = std::floor(e->rect().top() / st::stickersSize.height()),
|
||||
to = std::floor(e->rect().bottom() / st::stickersSize.height()) + 1;
|
||||
|
||||
for (qint32 i = from; i < to; ++i) {
|
||||
for (qint32 j = 0; j < kStickersPanelPerRow; ++j) {
|
||||
|
|
|
@ -953,9 +953,9 @@ void StickersBox::Inner::setPressed(int pressed) {
|
|||
auto &set = _rows[_pressed];
|
||||
auto rippleMask = Ui::RippleAnimation::rectMask(QSize(width(), _rowHeight));
|
||||
if (!set->ripple) {
|
||||
set->ripple = std::make_unique<Ui::RippleAnimation>(st::contactsRipple, std::move(rippleMask), [this, index = _pressed] {
|
||||
update(0, _itemsTop + index * _rowHeight, width(), _rowHeight);
|
||||
});
|
||||
set->ripple = std::make_unique<Ui::RippleAnimation>(
|
||||
st::contactsRipple, std::move(rippleMask),
|
||||
[this, index = _pressed] { update(0, _itemsTop + index * _rowHeight, width(), _rowHeight); });
|
||||
}
|
||||
set->ripple->add(mapFromGlobal(QCursor::pos()) - QPoint(0, _itemsTop + _pressed * _rowHeight));
|
||||
}
|
||||
|
|
|
@ -927,8 +927,12 @@ void FieldAutocompleteInner::onUpdateSelected(bool force) {
|
|||
|
||||
qint32 sel = -1, maxSel = 0;
|
||||
if (!_srows->isEmpty()) {
|
||||
qint32 row = (mouse.y() >= st::stickerPanPadding) ? ((mouse.y() - st::stickerPanPadding) / st::stickerPanSize.height()) : -1;
|
||||
qint32 col = (mouse.x() >= st::stickerPanPadding) ? ((mouse.x() - st::stickerPanPadding) / st::stickerPanSize.width()) : -1;
|
||||
qint32 row = (mouse.y() >= st::stickerPanPadding) ?
|
||||
((mouse.y() - st::stickerPanPadding) / st::stickerPanSize.height()) :
|
||||
-1;
|
||||
qint32 col = (mouse.x() >= st::stickerPanPadding) ?
|
||||
((mouse.x() - st::stickerPanPadding) / st::stickerPanSize.width()) :
|
||||
-1;
|
||||
if (row >= 0 && col >= 0) {
|
||||
sel = row * _stickersPerRow + col;
|
||||
}
|
||||
|
|
|
@ -1690,14 +1690,17 @@ void StickersListWidget::installSet(quint64 setId) {
|
|||
auto &sets = Global::StickerSets();
|
||||
auto it = sets.constFind(setId);
|
||||
if (it != sets.cend()) {
|
||||
request(MTPmessages_InstallStickerSet(Stickers::inputSetId(*it), MTP_bool(false))).done([](const MTPmessages_StickerSetInstallResult &result) {
|
||||
request(MTPmessages_InstallStickerSet(Stickers::inputSetId(*it), MTP_bool(false)))
|
||||
.done([](const MTPmessages_StickerSetInstallResult &result) {
|
||||
if (result.type() == mtpc_messages_stickerSetInstallResultArchive) {
|
||||
Stickers::ApplyArchivedResult(result.c_messages_stickerSetInstallResultArchive());
|
||||
}
|
||||
}).fail([this, setId](const RPCError &error) {
|
||||
})
|
||||
.fail([this, setId](const RPCError &error) {
|
||||
notInstalledLocally(setId);
|
||||
Stickers::UndoInstallLocally(setId);
|
||||
}).send();
|
||||
})
|
||||
.send();
|
||||
|
||||
installedLocally(setId);
|
||||
Stickers::InstallLocally(setId);
|
||||
|
|
|
@ -2035,7 +2035,10 @@ void DialogsInner::loadPeerPhotos() {
|
|||
_filterResults.size();
|
||||
if (from < 0) from = 0;
|
||||
if (from < _peerSearchResults.size()) {
|
||||
qint32 to = (yTo > filteredOffset() + st::searchedBarHeight ? ((yTo - filteredOffset() - st::searchedBarHeight) / qint32(st::dialogsRowHeight)) : 0) - _filterResults.size() + 1;
|
||||
qint32 to = (yTo > filteredOffset() + st::searchedBarHeight ?
|
||||
((yTo - filteredOffset() - st::searchedBarHeight) / qint32(st::dialogsRowHeight)) :
|
||||
0) -
|
||||
_filterResults.size() + 1;
|
||||
if (to > _peerSearchResults.size()) to = _peerSearchResults.size();
|
||||
|
||||
for (; from < to; ++from) {
|
||||
|
|
|
@ -355,18 +355,15 @@ void RowPainter::paint(Painter &p, const Row *row, int fullWidth, bool active, b
|
|||
paintUnreadCount(p, counter, unreadRight, unreadTop, st, &unreadWidth);
|
||||
availableWidth -= unreadWidth + st.padding + (hadOneBadge ? st::dialogsUnreadPadding : 0);
|
||||
}
|
||||
auto &color = active ? st::dialogsTextFgServiceActive : (selected ? st::dialogsTextFgServiceOver : st::dialogsTextFgService);
|
||||
auto &color = active ? st::dialogsTextFgServiceActive :
|
||||
(selected ? st::dialogsTextFgServiceOver : st::dialogsTextFgService);
|
||||
if (!history->paintSendAction(p, nameleft, texttop, availableWidth, fullWidth, color, ms)) {
|
||||
item->drawInDialog(
|
||||
p,
|
||||
QRect(nameleft, texttop, availableWidth, st::dialogsTextFont->height),
|
||||
active,
|
||||
selected,
|
||||
HistoryItem::DrawInDialog::Normal,
|
||||
history->textCachedFor,
|
||||
item->drawInDialog(p, QRect(nameleft, texttop, availableWidth, st::dialogsTextFont->height), active,
|
||||
selected, HistoryItem::DrawInDialog::Normal, history->textCachedFor,
|
||||
history->lastItemTextCache);
|
||||
}
|
||||
}, [&p, active, history, unreadCount] {
|
||||
},
|
||||
[&p, active, history, unreadCount] {
|
||||
if (unreadCount) {
|
||||
auto counter = QString::number(unreadCount);
|
||||
if (counter.size() > 4) {
|
||||
|
|
|
@ -2154,7 +2154,9 @@ void MediaView::paintThemePreview(Painter &p, QRect clip) {
|
|||
p.drawTextLeft(titleRect.x(), titleRect.y(), width(), lang(lng_theme_preview_title));
|
||||
}
|
||||
|
||||
auto buttonsRect = QRect(_themePreviewRect.x(), _themePreviewRect.y() + _themePreviewRect.height() - st::themePreviewMargin.bottom(), _themePreviewRect.width(), st::themePreviewMargin.bottom());
|
||||
auto buttonsRect = QRect(_themePreviewRect.x(),
|
||||
_themePreviewRect.y() + _themePreviewRect.height() - st::themePreviewMargin.bottom(),
|
||||
_themePreviewRect.width(), st::themePreviewMargin.bottom());
|
||||
if (buttonsRect.y() + buttonsRect.height() > height()) {
|
||||
buttonsRect.moveTop(height() - buttonsRect.height());
|
||||
fillOverlay(buttonsRect);
|
||||
|
|
|
@ -50,7 +50,8 @@ void SessionData::setKey(const AuthKeyPtr &key) {
|
|||
void SessionData::clear(Instance *instance) {
|
||||
RPCCallbackClears clearCallbacks;
|
||||
{
|
||||
QReadLocker locker1(haveSentMutex()), locker2(toResendMutex()), locker3(haveReceivedMutex()), locker4(wereAckedMutex());
|
||||
QReadLocker locker1(haveSentMutex()), locker2(toResendMutex()), locker3(haveReceivedMutex()),
|
||||
locker4(wereAckedMutex());
|
||||
clearCallbacks.reserve(_haveSent.size() + _wereAcked.size());
|
||||
for (auto i = _haveSent.cbegin(), e = _haveSent.cend(); i != e; ++i) {
|
||||
auto requestId = i.value()->requestId;
|
||||
|
|
|
@ -1009,7 +1009,8 @@ void OverviewInner::onUpdateSelected() {
|
|||
}
|
||||
if (_dragAction == Selecting) {
|
||||
bool canSelectMany = (_peer != 0);
|
||||
if (_mousedItem == _dragItem && lnk && !_selected.isEmpty() && _selected.cbegin().value() != FullSelection) {
|
||||
if (_mousedItem == _dragItem && lnk && !_selected.isEmpty() &&
|
||||
_selected.cbegin().value() != FullSelection) {
|
||||
_selected[_dragItem] = {0, 0};
|
||||
updateDragSelection(0, -1, 0, -1, false);
|
||||
} else if (canSelectMany) {
|
||||
|
|
|
@ -1771,7 +1771,9 @@ void DocumentData::performActionOnLoad() {
|
|||
auto showImage = !isVideo() && (size < App::kImageSizeLimit);
|
||||
auto playVoice = voice() && (_actionOnLoad == ActionOnLoadPlayInline || _actionOnLoad == ActionOnLoadOpen);
|
||||
auto playMusic = tryPlaySong() && (_actionOnLoad == ActionOnLoadPlayInline || _actionOnLoad == ActionOnLoadOpen);
|
||||
auto playAnimation = isAnimation() && (_actionOnLoad == ActionOnLoadPlayInline || _actionOnLoad == ActionOnLoadOpen) && showImage && item && item->getMedia();
|
||||
auto playAnimation = isAnimation() &&
|
||||
(_actionOnLoad == ActionOnLoadPlayInline || _actionOnLoad == ActionOnLoadOpen) && showImage &&
|
||||
item && item->getMedia();
|
||||
if (isTheme()) {
|
||||
if (!loc.isEmpty() && loc.accessEnable()) {
|
||||
Messenger::Instance().showDocument(this, item);
|
||||
|
|
|
@ -220,7 +220,9 @@ enum class PrepareTextOption {
|
|||
};
|
||||
inline QString PrepareForSending(const QString &text, PrepareTextOption option = PrepareTextOption::IgnoreLinks) {
|
||||
auto result = TextWithEntities{text}; // , {}}
|
||||
auto prepareFlags = (option == PrepareTextOption::CheckLinks) ? (TextParseLinks | TextParseMentions | TextParseHashtags | TextParseBotCommands) : 0;
|
||||
auto prepareFlags = (option == PrepareTextOption::CheckLinks) ?
|
||||
(TextParseLinks | TextParseMentions | TextParseHashtags | TextParseBotCommands) :
|
||||
0;
|
||||
PrepareForSending(result, prepareFlags);
|
||||
return result.text;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue