2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-09-04 16:35:44 +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

@@ -3779,8 +3779,16 @@ int HistoryWidget::minimalWidthForTabbedSelectorSection() const {
return st::windowMinWidth + tabbedSelectorSectionWidth();
}
bool HistoryWidget::willSwitchToTabbedSelectorWithWidth(int newWidth) const {
if (!AuthSession::Current().data().tabbedSelectorSectionEnabled()) {
return false;
} else if (_tabbedSectionUsed) {
return false;
}
return (newWidth >= minimalWidthForTabbedSelectorSection());
}
void HistoryWidget::toggleTabbedSelectorMode() {
auto sectionEnabled = AuthSession::Current().data().tabbedSelectorSectionEnabled();
if (_tabbedSection) {
AuthSession::Current().data().setTabbedSelectorSectionEnabled(false);
AuthSession::Current().saveDataDelayed(kSaveTabbedSelectorSectionTimeoutMs);