[Option][JSON] Always show top bar userpic
This commit is contained in:
parent
97039e8a19
commit
74fad4d120
2 changed files with 16 additions and 5 deletions
|
|
@ -936,7 +936,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,
|
||||
|
|
@ -945,14 +949,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
|
||||
|
|
@ -1039,7 +1047,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);
|
||||
|
|
|
|||
|
|
@ -340,6 +340,9 @@ const std::map<QString, Definition, std::greater<QString>> DefinitionMap {
|
|||
.type = SettingType::IntSetting,
|
||||
.defaultValue = -1,
|
||||
.limitHandler = IntLimit(-1, 10), }},
|
||||
{ "always_show_top_userpic", {
|
||||
.type = SettingType::BoolSetting,
|
||||
.defaultValue = false, }},
|
||||
};
|
||||
|
||||
using OldOptionKey = QString;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue