mirror of
https://github.com/Qz3rK/tdesktop.git
synced 2026-07-03 14:15:08 +02:00
Use skip block for result text and copy button.
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user