2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-30 22:25:12 +00:00

[Option][JSON] Always show top bar userpic

This commit is contained in:
RadRussianRus
2022-08-30 14:32:23 +03:00
committed by Eric Kotato
parent 9519d801aa
commit 24d919b5a4
2 changed files with 17 additions and 5 deletions

View File

@@ -7,6 +7,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/
#include "history/view/history_view_top_bar_widget.h"
#include "kotato/kotato_settings.h"
#include "history/history.h"
#include "history/view/history_view_send_action.h"
#include "boxes/add_contact_box.h"
@@ -987,7 +988,11 @@ 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 {
_leftTaken = anim::interpolate(
0,
@@ -996,14 +1001,18 @@ void TopBarWidget::updateControlsGeometry() {
_back->moveToLeft(_leftTaken, backButtonTop);
_leftTaken += _back->width();
}
if (_info && !_info->isHidden()) {
_info->moveToLeft(_leftTaken, otherButtonsTop);
_leftTaken += _info->width();
if (!_back->isHidden() || ::Kotato::JsonSettings::GetBool("always_show_top_userpic")) {
if (_info && !_info->isHidden()) {
_info->moveToLeft(_leftTaken, otherButtonsTop);
_leftTaken += _info->width();
}
} else if (_activeChat.key.topic()
|| _activeChat.section == Section::ChatsList) {
_leftTaken += st::normalFont->spacew;
}
if (_searchField) {
const auto fieldLeft = _leftTaken;
const auto fieldTop = searchFieldTop
@@ -1090,7 +1099,7 @@ void TopBarWidget::updateControlsVisibility() {
_cancelChoose->setVisible(_chooseForReportReason.has_value());
if (_info) {
_info->setVisible(!_chooseForReportReason
&& (isOneColumn || !_primaryWindow));
&& (::Kotato::JsonSettings::GetBool("always_show_top_userpic") || isOneColumn || !_primaryWindow));
}
if (_unreadBadge) {
_unreadBadge->setVisible(!_chooseForReportReason);

View File

@@ -293,6 +293,9 @@ const std::map<QString, Definition, std::greater<QString>> DefinitionMap {
.type = SettingType::IntSetting,
.defaultValue = 20,
.limitHandler = IntLimit(0, 200, 20), }},
{ "always_show_top_userpic", {
.type = SettingType::BoolSetting,
.defaultValue = false, }},
};
using OldOptionKey = QString;