mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2026-08-03 10:39:30 +00:00
Allow monospace blocks to extend bubble width.
This partially fixes #2060 instead of additional settings from #7822.
This commit is contained in:
@@ -83,7 +83,7 @@ private:
|
||||
void show(anim::type animated);
|
||||
void destroy(FnMut<void()> done);
|
||||
|
||||
[[nodisacrd]] bool hasShadow() const;
|
||||
[[nodiscard]] bool hasShadow() const;
|
||||
void createShadow();
|
||||
void destroyShadow();
|
||||
|
||||
|
||||
@@ -1464,6 +1464,12 @@ int Message::plainMaxWidth() const {
|
||||
+ st::msgPadding.right();
|
||||
}
|
||||
|
||||
int Message::monospaceMaxWidth() const {
|
||||
return st::msgPadding.left()
|
||||
+ (hasVisibleText() ? message()->_text.countMaxMonospaceWidth() : 0)
|
||||
+ st::msgPadding.right();
|
||||
}
|
||||
|
||||
void Message::initLogEntryOriginal() {
|
||||
if (const auto log = message()->Get<HistoryMessageLogEntryOriginal>()) {
|
||||
AddComponents(LogEntryOriginal::Bit());
|
||||
@@ -1787,7 +1793,7 @@ QRect Message::countGeometry() const {
|
||||
// contentLeft += st::msgPhotoSkip - (hmaxwidth - hwidth);
|
||||
}
|
||||
accumulate_min(contentWidth, maxWidth());
|
||||
accumulate_min(contentWidth, st::msgMaxWidth);
|
||||
accumulate_min(contentWidth, _bubbleWidthLimit);
|
||||
if (mediaWidth < contentWidth) {
|
||||
const auto textualWidth = plainMaxWidth();
|
||||
if (mediaWidth < textualWidth
|
||||
@@ -1829,7 +1835,8 @@ int Message::resizeContentGetHeight(int newWidth) {
|
||||
contentWidth -= st::msgPhotoSkip;
|
||||
}
|
||||
accumulate_min(contentWidth, maxWidth());
|
||||
accumulate_min(contentWidth, st::msgMaxWidth);
|
||||
_bubbleWidthLimit = std::max(st::msgMaxWidth, monospaceMaxWidth());
|
||||
accumulate_min(contentWidth, _bubbleWidthLimit);
|
||||
if (mediaDisplayed) {
|
||||
media->resizeGetHeight(contentWidth);
|
||||
if (media->width() < contentWidth) {
|
||||
|
||||
@@ -157,8 +157,9 @@ private:
|
||||
const HistoryMessageEdited *displayedEditBadge() const;
|
||||
HistoryMessageEdited *displayedEditBadge();
|
||||
void initTime();
|
||||
int timeLeft() const;
|
||||
int plainMaxWidth() const;
|
||||
[[nodiscard]] int timeLeft() const;
|
||||
[[nodiscard]] int plainMaxWidth() const;
|
||||
[[nodiscard]] int monospaceMaxWidth() const;
|
||||
|
||||
WebPage *logEntryOriginal() const;
|
||||
|
||||
@@ -167,6 +168,7 @@ private:
|
||||
|
||||
mutable ClickHandlerPtr _rightActionLink;
|
||||
mutable ClickHandlerPtr _fastReplyLink;
|
||||
int _bubbleWidthLimit = 0;
|
||||
|
||||
};
|
||||
|
||||
|
||||
@@ -37,8 +37,8 @@ public:
|
||||
|
||||
void process(std::vector<FFmpeg::Packet> &&packets);
|
||||
|
||||
[[nodisacrd]] rpl::producer<> checkNextFrame() const;
|
||||
[[nodisacrd]] rpl::producer<> waitingForData() const;
|
||||
[[nodiscard]] rpl::producer<> checkNextFrame() const;
|
||||
[[nodiscard]] rpl::producer<> waitingForData() const;
|
||||
|
||||
void pause(crl::time time);
|
||||
void resume(crl::time time);
|
||||
|
||||
@@ -43,7 +43,7 @@ struct ParsedTheme {
|
||||
const QByteArray &value);
|
||||
[[nodiscard]] QByteArray WriteCloudToText(const Data::CloudTheme &cloud);
|
||||
[[nodiscard]] Data::CloudTheme ReadCloudFromText(const QByteArray &text);
|
||||
[[nodisacrd]] QByteArray StripCloudTextFields(const QByteArray &text);
|
||||
[[nodiscard]] QByteArray StripCloudTextFields(const QByteArray &text);
|
||||
|
||||
class Editor : public TWidget {
|
||||
public:
|
||||
|
||||
+1
-1
Submodule Telegram/lib_ui updated: d05d9b214d...b1d00d0b28
Reference in New Issue
Block a user