[Option][JSON] Always show top bar userpic
This commit is contained in:
parent
061b38ea98
commit
c0462c21b6
2 changed files with 13 additions and 2 deletions
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -367,6 +367,9 @@ const std::map<QString, Definition, std::greater<QString>> DefinitionMap {
|
|||
.type = SettingType::IntSetting,
|
||||
.defaultValue = 3,
|
||||
.limitHandler = IntLimit(0, 3, 3), }},
|
||||
{ "always_show_top_userpic", {
|
||||
.type = SettingType::BoolSetting,
|
||||
.defaultValue = false, }},
|
||||
};
|
||||
|
||||
using OldOptionKey = QString;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue