Improved width of voice waveform.

This commit is contained in:
23rd 2025-02-10 21:22:57 +03:00
parent fae9649773
commit 9f73242cc5

View file

@ -503,9 +503,19 @@ QSize Document::countOptimalSize() {
accumulate_max(maxWidth, tleft + named->name.maxWidth() + tright);
accumulate_min(maxWidth, st::msgMaxWidth);
}
if (voice && voice->transcribe) {
maxWidth += st::historyTranscribeSkip
+ voice->transcribe->size().width();
if (voice) {
const auto maxWaveformWidth = ::Media::Player::kWaveformSamplesCount *
(st::msgWaveformBar + st::msgWaveformSkip);
const auto transcribeWidth = voice->transcribe
? (voice->transcribe->size().width() + st::historyTranscribeSkip)
: 0;
accumulate_max(
maxWidth,
maxWaveformWidth
+ rect::m::sum::h(st.padding)
+ st.thumbSize
+ st.thumbSkip
+ transcribeWidth);
}
auto minHeight = st.padding.top() + st.thumbSize + st.padding.bottom();