From d69caacded0f9cc023e9e95756cc79feac29800e Mon Sep 17 00:00:00 2001 From: John Preston Date: Mon, 14 Dec 2020 19:56:01 +0400 Subject: [PATCH] Improve top bar icons layout. --- .../SourceFiles/history/view/history_view_top_bar_widget.cpp | 3 ++- Telegram/SourceFiles/info/info.style | 4 ++-- Telegram/SourceFiles/window/themes/window_theme_preview.cpp | 4 ++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/Telegram/SourceFiles/history/view/history_view_top_bar_widget.cpp b/Telegram/SourceFiles/history/view/history_view_top_bar_widget.cpp index aa9d0ade6..0fec8df2d 100644 --- a/Telegram/SourceFiles/history/view/history_view_top_bar_widget.cpp +++ b/Telegram/SourceFiles/history/view/history_view_top_bar_widget.cpp @@ -647,7 +647,8 @@ void TopBarWidget::updateControlsGeometry() { } _infoToggle->moveToRight(_rightTaken, otherButtonsTop); if (!_infoToggle->isHidden()) { - _rightTaken += _infoToggle->width() + st::topBarSkip; + _infoToggle->moveToRight(_rightTaken, otherButtonsTop); + _rightTaken += _infoToggle->width(); } if (!_call->isHidden() || !_groupCall->isHidden()) { _call->moveToRight(_rightTaken, otherButtonsTop); diff --git a/Telegram/SourceFiles/info/info.style b/Telegram/SourceFiles/info/info.style index dcc1db0c8..bcf621494 100644 --- a/Telegram/SourceFiles/info/info.style +++ b/Telegram/SourceFiles/info/info.style @@ -748,7 +748,7 @@ topBarSearch: IconButton { color: windowBgOver; } } -topBarSkip: -2px; +topBarSkip: -5px; topBarCallSkip: -1px; topBarMenuToggle: IconButton(topBarSearch) { width: 44px; @@ -766,7 +766,7 @@ topBarCall: IconButton(topBarSearch) { topBarGroupCall: IconButton(topBarSearch) { icon: icon {{ "top_bar_group_call", menuIconFg }}; iconOver: icon {{ "top_bar_group_call", menuIconFgOver }}; - iconPosition: point(8px, 15px); + iconPosition: point(8px, 16px); } topBarInfo: IconButton(topBarSearch) { icon: icon {{ "top_bar_profile", menuIconFg }}; diff --git a/Telegram/SourceFiles/window/themes/window_theme_preview.cpp b/Telegram/SourceFiles/window/themes/window_theme_preview.cpp index 3350a6a06..281896a36 100644 --- a/Telegram/SourceFiles/window/themes/window_theme_preview.cpp +++ b/Telegram/SourceFiles/window/themes/window_theme_preview.cpp @@ -473,10 +473,10 @@ void Generator::paintTopBar() { auto right = st::topBarMenuToggle.width; st::topBarMenuToggle.icon[_palette].paint(*_p, _topBar.x() + _topBar.width() - right + st::topBarMenuToggle.iconPosition.x(), _topBar.y() + st::topBarMenuToggle.iconPosition.y(), _rect.width()); + right += st::topBarSkip + st::topBarCall.width; + st::topBarCall.icon[_palette].paint(*_p, _topBar.x() + _topBar.width() - right + st::topBarCall.iconPosition.x(), _topBar.y() + st::topBarCall.iconPosition.y(), _rect.width()); right += st::topBarSearch.width; st::topBarSearch.icon[_palette].paint(*_p, _topBar.x() + _topBar.width() - right + st::topBarSearch.iconPosition.x(), _topBar.y() + st::topBarSearch.iconPosition.y(), _rect.width()); - right += st::topBarCallSkip + st::topBarCall.width; - st::topBarCall.icon[_palette].paint(*_p, _topBar.x() + _topBar.width() - right + st::topBarCall.iconPosition.x(), _topBar.y() + st::topBarCall.iconPosition.y(), _rect.width()); auto decreaseWidth = st::topBarCall.width + st::topBarCallSkip + st::topBarSearch.width + st::topBarMenuToggle.width; auto nameleft = _topBar.x() + st::topBarArrowPadding.right();