From c0462c21b6af834a519ed223c9e5ce1545e55eb8 Mon Sep 17 00:00:00 2001 From: RadRussianRus Date: Tue, 30 Aug 2022 14:32:23 +0300 Subject: [PATCH] [Option][JSON] Always show top bar userpic --- .../history/view/history_view_top_bar_widget.cpp | 12 ++++++++++-- Telegram/SourceFiles/kotato/kotato_settings.cpp | 3 +++ 2 files changed, 13 insertions(+), 2 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 708e5edc1..605cc1da9 100644 --- a/Telegram/SourceFiles/history/view/history_view_top_bar_widget.cpp +++ b/Telegram/SourceFiles/history/view/history_view_top_bar_widget.cpp @@ -812,13 +812,20 @@ void TopBarWidget::updateControlsGeometry() { _cancelChoose->moveToLeft(_leftTaken, otherButtonsTop); _leftTaken += _cancelChoose->width(); } else if (_back->isHidden()) { - _leftTaken = st::topBarArrowPadding.right(); + if (::Kotato::JsonSettings::GetBool("always_show_top_userpic")) { + _leftTaken = st::topBarActionSkip; + } else { + _leftTaken = st::topBarArrowPadding.right(); + } } else { const auto smallDialogsColumn = _activeChat.key.folder() && (width() < _back->width() + _search->width()); _leftTaken = smallDialogsColumn ? (width() - _back->width()) / 2 : 0; _back->moveToLeft(_leftTaken, otherButtonsTop); _leftTaken += _back->width(); + } + + if (!_back->isHidden() || ::Kotato::JsonSettings::GetBool("always_show_top_userpic")) { if (_info && !_info->isHidden()) { _info->moveToLeft(_leftTaken, otherButtonsTop); _leftTaken += _info->width(); @@ -881,7 +888,8 @@ void TopBarWidget::updateControlsVisibility() { _back->setVisible(backVisible && !_chooseForReportReason); _cancelChoose->setVisible(_chooseForReportReason.has_value()); if (_info) { - _info->setVisible(isOneColumn && !_chooseForReportReason); + _info->setVisible(::Kotato::JsonSettings::GetBool("always_show_top_userpic") + || (isOneColumn && !_chooseForReportReason)); } if (_unreadBadge) { _unreadBadge->setVisible(!_chooseForReportReason); diff --git a/Telegram/SourceFiles/kotato/kotato_settings.cpp b/Telegram/SourceFiles/kotato/kotato_settings.cpp index becff9495..5ebf9426e 100644 --- a/Telegram/SourceFiles/kotato/kotato_settings.cpp +++ b/Telegram/SourceFiles/kotato/kotato_settings.cpp @@ -367,6 +367,9 @@ const std::map> DefinitionMap { .type = SettingType::IntSetting, .defaultValue = 3, .limitHandler = IntLimit(0, 3, 3), }}, + { "always_show_top_userpic", { + .type = SettingType::BoolSetting, + .defaultValue = false, }}, }; using OldOptionKey = QString;