Use skip block for result text and copy button.

This commit is contained in:
John Preston
2026-03-24 23:52:13 +07:00
parent 82d496ba24
commit f07510bd67
3 changed files with 16 additions and 7 deletions
-1
View File
@@ -1333,7 +1333,6 @@ aiComposeCardPadding: margins(12px, 16px, 16px, 16px);
aiComposeCardDivider: shadowFg;
aiComposeCardSectionSkip: 12px;
aiComposeCardTextSkip: 0px;
aiComposeCardCopySkip: 0px;
aiComposeCardControlSkip: 8px;
aiComposeCardTitle: FlatLabel(defaultSubsectionTitle) {
textFg: windowFg;
+15 -5
View File
@@ -1147,6 +1147,16 @@ int ComposeAiPreviewCard::resizeGetHeight(int newWidth) {
});
y += st::aiComposeCardTextSkip;
const auto lineHeight = _resultBody->st().style.lineHeight
? _resultBody->st().style.lineHeight
: _resultBody->st().style.font->height;
if (_copy->isVisible()) {
_resultBody->setSkipBlock(
_copy->width(),
lineHeight);
} else {
_resultBody->setSkipBlock(0, 0);
}
_resultBody->resizeToWidth(contentWidth);
_resultBody->setGeometryToLeft(
padding.left(),
@@ -1154,13 +1164,13 @@ int ComposeAiPreviewCard::resizeGetHeight(int newWidth) {
contentWidth,
_resultBody->height(),
newWidth);
y += _resultBody->height();
if (_copy->isVisible()) {
y += st::aiComposeCardCopySkip;
_copy->moveToRight(padding.right(), y, newWidth);
y += _copy->height();
_copy->moveToRight(
padding.right(),
y + _resultBody->height() - lineHeight,
newWidth);
}
y += _resultBody->height();
} else {
_resultTitle->hide();