mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-07-26 23:43:06 +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,
|
.now = context.now,
|
||||||
.pausedEmoji = context.paused || On(PowerSaving::kEmojiChat),
|
.pausedEmoji = context.paused || On(PowerSaving::kEmojiChat),
|
||||||
.pausedSpoiler = context.paused || On(PowerSaving::kChatSpoiler),
|
.pausedSpoiler = context.paused || On(PowerSaving::kChatSpoiler),
|
||||||
|
.elisionLines = elisionLines(),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -295,6 +296,10 @@ void MediaGenericTextPart::setupPen(
|
||||||
: context.messageStyle()->historyTextFg);
|
: context.messageStyle()->historyTextFg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int MediaGenericTextPart::elisionLines() const {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
TextState MediaGenericTextPart::textState(
|
TextState MediaGenericTextPart::textState(
|
||||||
QPoint point,
|
QPoint point,
|
||||||
StateRequest request,
|
StateRequest request,
|
||||||
|
@ -314,9 +319,13 @@ TextState MediaGenericTextPart::textState(
|
||||||
}
|
}
|
||||||
|
|
||||||
QSize MediaGenericTextPart::countOptimalSize() {
|
QSize MediaGenericTextPart::countOptimalSize() {
|
||||||
|
const auto lines = elisionLines();
|
||||||
|
const auto height = lines
|
||||||
|
? std::min(_text.minHeight(), lines * _text.style()->font->height)
|
||||||
|
: _text.minHeight();
|
||||||
return {
|
return {
|
||||||
_margins.left() + _text.maxWidth() + _margins.right(),
|
_margins.left() + _text.maxWidth() + _margins.right(),
|
||||||
_margins.top() + _text.minHeight() + _margins.bottom(),
|
_margins.top() + height + _margins.bottom(),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -163,6 +163,7 @@ protected:
|
||||||
Painter &p,
|
Painter &p,
|
||||||
not_null<const MediaGeneric*> owner,
|
not_null<const MediaGeneric*> owner,
|
||||||
const PaintContext &context) const;
|
const PaintContext &context) const;
|
||||||
|
virtual int elisionLines() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::Text::String _text;
|
Ui::Text::String _text;
|
||||||
|
|
Loading…
Add table
Reference in a new issue