mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-07-25 15:03:03 +02:00
Fix build.
This commit is contained in:
parent
a7e87cc722
commit
8b40a77297
2 changed files with 11 additions and 1 deletions
|
@ -282,6 +282,7 @@ void MediaGenericTextPart::draw(
|
|||
.now = context.now,
|
||||
.pausedEmoji = context.paused || On(PowerSaving::kEmojiChat),
|
||||
.pausedSpoiler = context.paused || On(PowerSaving::kChatSpoiler),
|
||||
.elisionLines = elisionLines(),
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -295,6 +296,10 @@ void MediaGenericTextPart::setupPen(
|
|||
: context.messageStyle()->historyTextFg);
|
||||
}
|
||||
|
||||
int MediaGenericTextPart::elisionLines() const {
|
||||
return 0;
|
||||
}
|
||||
|
||||
TextState MediaGenericTextPart::textState(
|
||||
QPoint point,
|
||||
StateRequest request,
|
||||
|
@ -314,9 +319,13 @@ TextState MediaGenericTextPart::textState(
|
|||
}
|
||||
|
||||
QSize MediaGenericTextPart::countOptimalSize() {
|
||||
const auto lines = elisionLines();
|
||||
const auto height = lines
|
||||
? std::min(_text.minHeight(), lines * _text.style()->font->height)
|
||||
: _text.minHeight();
|
||||
return {
|
||||
_margins.left() + _text.maxWidth() + _margins.right(),
|
||||
_margins.top() + _text.minHeight() + _margins.bottom(),
|
||||
_margins.top() + height + _margins.bottom(),
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -163,6 +163,7 @@ protected:
|
|||
Painter &p,
|
||||
not_null<const MediaGeneric*> owner,
|
||||
const PaintContext &context) const;
|
||||
virtual int elisionLines() const;
|
||||
|
||||
private:
|
||||
Ui::Text::String _text;
|
||||
|
|
Loading…
Add table
Reference in a new issue