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:
@@ -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);
|
||||
|
@@ -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)
|
||||
|
Reference in New Issue
Block a user