mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-08-30 14:08:41 +00:00
@@ -463,17 +463,16 @@ QSize Service::performCountCurrentSize(int newWidth) {
|
|||||||
const auto media = this->media();
|
const auto media = this->media();
|
||||||
const auto mediaDisplayed = media && media->isDisplayed();
|
const auto mediaDisplayed = media && media->isDisplayed();
|
||||||
auto contentWidth = newWidth;
|
auto contentWidth = newWidth;
|
||||||
|
if (delegate()->elementChatMode() == ElementChatMode::Wide) {
|
||||||
|
accumulate_min(contentWidth, st::msgMaxWidth + 2 * st::msgPhotoSkip + 2 * st::msgMargin.left());
|
||||||
|
}
|
||||||
|
contentWidth -= st::msgServiceMargin.left() + st::msgServiceMargin.left(); // two small margins
|
||||||
|
if (contentWidth < st::msgServicePadding.left() + st::msgServicePadding.right() + 1) {
|
||||||
|
contentWidth = st::msgServicePadding.left() + st::msgServicePadding.right() + 1;
|
||||||
|
}
|
||||||
if (mediaDisplayed && media->hideServiceText()) {
|
if (mediaDisplayed && media->hideServiceText()) {
|
||||||
newHeight += media->resizeGetHeight(newWidth) + marginBottom();
|
newHeight += media->resizeGetHeight(newWidth) + marginBottom();
|
||||||
} else if (!text().isEmpty()) {
|
} else if (!text().isEmpty()) {
|
||||||
if (delegate()->elementChatMode() == ElementChatMode::Wide) {
|
|
||||||
accumulate_min(contentWidth, st::msgMaxWidth + 2 * st::msgPhotoSkip + 2 * st::msgMargin.left());
|
|
||||||
}
|
|
||||||
contentWidth -= st::msgServiceMargin.left() + st::msgServiceMargin.left(); // two small margins
|
|
||||||
if (contentWidth < st::msgServicePadding.left() + st::msgServicePadding.right() + 1) {
|
|
||||||
contentWidth = st::msgServicePadding.left() + st::msgServicePadding.right() + 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
auto nwidth = qMax(contentWidth - st::msgServicePadding.left() - st::msgServicePadding.right(), 0);
|
auto nwidth = qMax(contentWidth - st::msgServicePadding.left() - st::msgServicePadding.right(), 0);
|
||||||
newHeight += (contentWidth >= maxWidth())
|
newHeight += (contentWidth >= maxWidth())
|
||||||
? minHeight()
|
? minHeight()
|
||||||
|
Reference in New Issue
Block a user