mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-16 14:17:12 +02:00
Fix file albums with inline keyboard buttons.
This commit is contained in:
parent
6c5036ee8d
commit
216865a20d
1 changed files with 12 additions and 6 deletions
|
@ -1142,6 +1142,15 @@ void Message::draw(Painter &p, const PaintContext &context) const {
|
|||
const auto displayInfo = needInfoDisplay();
|
||||
const auto reactionsInBubble = _reactions && embedReactionsInBubble();
|
||||
|
||||
const auto keyboard = item->inlineReplyKeyboard();
|
||||
const auto fullGeometry = g;
|
||||
if (keyboard) {
|
||||
// We need to count geometry without keyboard for bubble selection
|
||||
// intervals counting below.
|
||||
const auto keyboardHeight = st::msgBotKbButton.margin + keyboard->naturalHeight();
|
||||
g.setHeight(g.height() - keyboardHeight);
|
||||
}
|
||||
|
||||
auto mediaSelectionIntervals = (!context.selected() && mediaDisplayed)
|
||||
? media->getBubbleSelectionIntervals(context.selection)
|
||||
: std::vector<Ui::BubbleSelectionInterval>();
|
||||
|
@ -1176,25 +1185,22 @@ void Message::draw(Painter &p, const PaintContext &context) const {
|
|||
if (customHighlight) {
|
||||
media->drawHighlight(p, context, localMediaTop);
|
||||
} else {
|
||||
paintHighlight(p, context, g.height());
|
||||
paintHighlight(p, context, fullGeometry.height());
|
||||
}
|
||||
|
||||
const auto roll = media ? media->bubbleRoll() : Media::BubbleRoll();
|
||||
if (roll) {
|
||||
p.save();
|
||||
p.translate(g.center());
|
||||
p.translate(fullGeometry.center());
|
||||
p.rotate(roll.rotate);
|
||||
p.scale(roll.scale, roll.scale);
|
||||
p.translate(-g.center());
|
||||
p.translate(-fullGeometry.center());
|
||||
}
|
||||
|
||||
p.setTextPalette(stm->textPalette);
|
||||
|
||||
const auto keyboard = item->inlineReplyKeyboard();
|
||||
const auto messageRounding = countMessageRounding();
|
||||
if (keyboard) {
|
||||
const auto keyboardHeight = st::msgBotKbButton.margin + keyboard->naturalHeight();
|
||||
g.setHeight(g.height() - keyboardHeight);
|
||||
const auto keyboardPosition = QPoint(g.left(), g.top() + g.height() + st::msgBotKbButton.margin);
|
||||
p.translate(keyboardPosition);
|
||||
keyboard->paint(
|
||||
|
|
Loading…
Add table
Reference in a new issue