2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 22:46:10 +00:00

Fix enabling emoji sidebar from a small window.

Extend the window size after the tabbedSelectorSectionEnabled flag
is already set to true. Otherwise we extend the window and switch
to a normal from single column layout before showing the sidebar.
This commit is contained in:
John Preston
2017-05-17 14:50:00 +03:00
parent 966dcd5509
commit 9f7c45e35c
4 changed files with 42 additions and 20 deletions

View File

@@ -3192,6 +3192,9 @@ void MainWidget::handleAdaptiveLayoutUpdate() {
void MainWidget::updateWindowAdaptiveLayout() {
auto layout = _controller->computeColumnLayout();
// Check if we are in a single-column layout in a wide enough window
// for the normal layout. If so, switch to the normal layout.
if (layout.windowLayout == Adaptive::WindowLayout::OneColumn) {
auto chatWidth = layout.dialogsWidth;
if (AuthSession::Current().data().tabbedSelectorSectionEnabled()
@@ -3205,6 +3208,7 @@ void MainWidget::updateWindowAdaptiveLayout() {
_controller->dialogsWidthRatio().set(float64(layout.dialogsWidth) / layout.bodyWidth, true);
}
}
_dialogsWidth = layout.dialogsWidth;
if (layout.windowLayout != Global::AdaptiveWindowLayout()) {
Global::SetAdaptiveWindowLayout(layout.windowLayout);