2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 06:35:14 +00:00

Shrink dialogs column when enabling emoji sidebar.

Try to hold the ratio between the chat width and the dialogs list
width when the emoji sidebar is created by shrinking the left column.
This commit is contained in:
John Preston
2017-05-17 15:38:42 +03:00
parent 9f7c45e35c
commit 0339b1b54b
5 changed files with 46 additions and 4 deletions

View File

@@ -167,7 +167,7 @@ void paintPreparedDate(Painter &p, const QString &dateText, int dateTextWidth, i
int left = st::msgServiceMargin.left();
int maxwidth = w;
if (Adaptive::ChatWide()) {
maxwidth = qMin(maxwidth, int32(st::msgMaxWidth + 2 * st::msgPhotoSkip + 2 * st::msgMargin.left()));
maxwidth = qMin(maxwidth, WideChatWidth());
}
w = maxwidth - st::msgServiceMargin.left() - st::msgServiceMargin.left();
@@ -182,6 +182,10 @@ void paintPreparedDate(Painter &p, const QString &dateText, int dateTextWidth, i
} // namepsace
int WideChatWidth() {
return st::msgMaxWidth + 2 * st::msgPhotoSkip + 2 * st::msgMargin.left();
}
void ServiceMessagePainter::paint(Painter &p, const HistoryService *message, const PaintContext &context, int height) {
int left = 0, width = 0;
message->countPositionAndSize(left, width);

View File

@@ -22,6 +22,8 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
namespace HistoryLayout {
int WideChatWidth();
struct PaintContext {
PaintContext(TimeMs ms, const QRect &clip, TextSelection selection)
: ms(ms)