From a0c8d522ef8ece956599fc116e31a4938a8fb78b Mon Sep 17 00:00:00 2001 From: John Preston Date: Thu, 30 Nov 2017 17:08:51 +0400 Subject: [PATCH] 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. --- Telegram/SourceFiles/history/history.style | 2 +- Telegram/SourceFiles/info/info_layer_widget.cpp | 9 +++++++++ Telegram/SourceFiles/window/window.style | 2 +- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/Telegram/SourceFiles/history/history.style b/Telegram/SourceFiles/history/history.style index ceb1eb4e03..e4a21bec8d 100644 --- a/Telegram/SourceFiles/history/history.style +++ b/Telegram/SourceFiles/history/history.style @@ -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); diff --git a/Telegram/SourceFiles/info/info_layer_widget.cpp b/Telegram/SourceFiles/info/info_layer_widget.cpp index 40b51f6cfe..1b04ad2957 100644 --- a/Telegram/SourceFiles/info/info_layer_widget.cpp +++ b/Telegram/SourceFiles/info/info_layer_widget.cpp @@ -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( diff --git a/Telegram/SourceFiles/window/window.style b/Telegram/SourceFiles/window/window.style index 1d105a5306..c1cb87560d 100644 --- a/Telegram/SourceFiles/window/window.style +++ b/Telegram/SourceFiles/window/window.style @@ -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) {