Save window extension on layer->section migration.

If the third section is shown inside the existing window remember
it as a zero window extension or third section show. That way it
will hide correctly when it is closed by X button.

Partially fixes #4091.
This commit is contained in:
John Preston 2017-11-30 17:08:51 +04:00
parent c10588a7dc
commit a0c8d522ef
3 changed files with 11 additions and 2 deletions

View File

@ -213,7 +213,7 @@ historyAttachEmoji: IconButton(historyAttach) {
iconOver: icon {{ "send_control_emoji", historyComposeIconFgOver }};
iconPosition: point(15px, 15px);
}
historyAttachEmojiFgActive: windowBgActive;
historyAttachEmojiFgActive: windowActiveTextFg;
historyAttachEmojiActive: icon {{ "send_control_emoji", historyAttachEmojiFgActive }};
historyAttachEmojiTooltipDelta: 4px;
historyEmojiCircle: size(20px, 20px);

View File

@ -102,6 +102,15 @@ bool LayerWidget::takeToThirdSection() {
auto memento = MoveMemento(std::move(_content));
localCopy->hideSpecialLayer(anim::type::instant);
// When creating third section in response to the window
// size allowing it to fit without window resize we want
// to save that we didn't extend the window while showing
// the third section, so that when we close it we won't
// shrink the window size.
//
// See https://github.com/telegramdesktop/tdesktop/issues/4091
Auth().data().setThirdSectionExtendedBy(0);
Auth().data().setThirdSectionInfoEnabled(true);
Auth().saveDataDelayed();
localCopy->showSection(

View File

@ -285,7 +285,7 @@ topBarInfo: IconButton(topBarSearch) {
icon: icon {{ "top_bar_profile", menuIconFg }};
iconOver: icon {{ "top_bar_profile", menuIconFgOver }};
}
topBarInfoActive: icon {{ "top_bar_profile", windowBgActive }};
topBarInfoActive: icon {{ "top_bar_profile", windowActiveTextFg }};
topBarSkip: -2px;
topBarCallSkip: -1px;
topBarMenuToggle: IconButton(topBarSearch) {