mirror of
https://github.com/kotatogram/kotatogram-desktop
synced 2025-09-01 07:05:13 +00:00
Resizing photo when bubble is drawn
This commit is contained in:
@@ -373,7 +373,7 @@ botKbScroll: defaultSolidScroll;
|
|||||||
historyDateFadeDuration: 200;
|
historyDateFadeDuration: 200;
|
||||||
|
|
||||||
historyPhotoLeft: 14px;
|
historyPhotoLeft: 14px;
|
||||||
historyPhotoCaptionedMinWidth: 200px;
|
historyPhotoBubbleMinWidth: 200px;
|
||||||
historyMessageRadius: 6px;
|
historyMessageRadius: 6px;
|
||||||
historyBubbleTailInLeft: icon {{ "bubble_tail", msgInBg }};
|
historyBubbleTailInLeft: icon {{ "bubble_tail", msgInBg }};
|
||||||
historyBubbleTailInLeftSelected: icon {{ "bubble_tail", msgInBgSelected }};
|
historyBubbleTailInLeftSelected: icon {{ "bubble_tail", msgInBgSelected }};
|
||||||
|
@@ -86,7 +86,7 @@ QSize Photo::countOptimalSize() {
|
|||||||
if (_serviceWidth > 0) {
|
if (_serviceWidth > 0) {
|
||||||
return { _serviceWidth, _serviceWidth };
|
return { _serviceWidth, _serviceWidth };
|
||||||
}
|
}
|
||||||
const auto minWidth = qMax((_caption.isEmpty() ? st::minPhotoSize : st::historyPhotoCaptionedMinWidth), _parent->infoWidth() + 2 * (st::msgDateImgDelta + st::msgDateImgPadding.x()));
|
const auto minWidth = qMax((!_parent->hasBubble() ? st::minPhotoSize : st::historyPhotoBubbleMinWidth), _parent->infoWidth() + 2 * (st::msgDateImgDelta + st::msgDateImgPadding.x()));
|
||||||
const auto maxActualWidth = qMax(tw, minWidth);
|
const auto maxActualWidth = qMax(tw, minWidth);
|
||||||
maxWidth = qMax(maxActualWidth, th);
|
maxWidth = qMax(maxActualWidth, th);
|
||||||
minHeight = qMax(th, st::minPhotoSize);
|
minHeight = qMax(th, st::minPhotoSize);
|
||||||
@@ -125,7 +125,7 @@ QSize Photo::countCurrentSize(int newWidth) {
|
|||||||
if (_pixw < 1) _pixw = 1;
|
if (_pixw < 1) _pixw = 1;
|
||||||
if (_pixh < 1) _pixh = 1;
|
if (_pixh < 1) _pixh = 1;
|
||||||
|
|
||||||
auto minWidth = qMax((_caption.isEmpty() ? st::minPhotoSize : st::historyPhotoCaptionedMinWidth), _parent->infoWidth() + 2 * (st::msgDateImgDelta + st::msgDateImgPadding.x()));
|
auto minWidth = qMax((!_parent->hasBubble() ? st::minPhotoSize : st::historyPhotoBubbleMinWidth), _parent->infoWidth() + 2 * (st::msgDateImgDelta + st::msgDateImgPadding.x()));
|
||||||
newWidth = qMax(_pixw, minWidth);
|
newWidth = qMax(_pixw, minWidth);
|
||||||
auto newHeight = qMax(_pixh, st::minPhotoSize);
|
auto newHeight = qMax(_pixh, st::minPhotoSize);
|
||||||
if (_parent->hasBubble() && !_caption.isEmpty()) {
|
if (_parent->hasBubble() && !_caption.isEmpty()) {
|
||||||
|
Reference in New Issue
Block a user