mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-09-02 07:25:46 +00:00
Switch layout to Normal in a wide enough window.
A lot of people didn't know how to bring the dialogs column back after it was gone in a wide single column MainWindow. Now we switch to a two column layout if the window allows it, preserving the emoji / stickers / GIFs section in case it is shown.
This commit is contained in:
@@ -53,6 +53,10 @@ bool Controller::isGifPausedAtLeastFor(GifPauseReason reason) const {
|
||||
return (static_cast<int>(_gifPauseReasons) >= 2 * static_cast<int>(reason)) || !window()->isActive();
|
||||
}
|
||||
|
||||
int Controller::dialogsSmallColumnWidth() const {
|
||||
return st::dialogsPadding.x() + st::dialogsPhotoSize + st::dialogsPadding.x();
|
||||
}
|
||||
|
||||
Controller::ColumnLayout Controller::computeColumnLayout() {
|
||||
auto layout = Adaptive::WindowLayout::OneColumn;
|
||||
|
||||
@@ -94,7 +98,7 @@ Controller::ColumnLayout Controller::computeColumnLayout() {
|
||||
if (forceWideDialogs()) {
|
||||
dialogsWidth = st::dialogsWidthMin;
|
||||
} else {
|
||||
dialogsWidth = st::dialogsPadding.x() + st::dialogsPhotoSize + st::dialogsPadding.x();
|
||||
dialogsWidth = dialogsSmallColumnWidth();
|
||||
}
|
||||
} else {
|
||||
layout = Adaptive::WindowLayout::Normal;
|
||||
|
Reference in New Issue
Block a user