@@ -283,7 +283,7 @@ TopBar::TopBar(
283283, _showLastSeen(
284284 this ,
285285 tr::lng_status_lastseen_when (),
286- st::infoProfileCover.showLastSeen )
286+ st::infoProfileTopBarShowLastSeen )
287287, _forumButton([&, controller = descriptor.controller] {
288288 const auto topic = _key.topic ();
289289 if (!topic) {
@@ -465,6 +465,16 @@ void TopBar::adjustColors(const std::optional<QColor> &edgeColor) {
465465 _title->setTextColorOverride (shouldOverrideTitle
466466 ? std::optional<QColor>(st::groupCallMembersFg->c )
467467 : std::nullopt );
468+ if (!_showLastSeen->isHidden ()) {
469+ if (shouldOverrideTitle) {
470+ const auto st = mapActionStyle (edgeColor);
471+ _showLastSeen->setBrushOverride (st.bgColor );
472+ _showLastSeen->setTextFgOverride (st.fgColor );
473+ } else {
474+ _showLastSeen->setBrushOverride (std::nullopt );
475+ _showLastSeen->setTextFgOverride (std::nullopt );
476+ }
477+ }
468478 {
469479 const auto membersLinkCallback = _statusLabel->membersLinkCallback ();
470480 {
@@ -607,27 +617,7 @@ void TopBar::setupActions(not_null<Window::SessionController*> controller) {
607617 const auto topic = _key.topic ();
608618 const auto sublist = _key.sublist ();
609619 const auto isSide = (_wrap.current () == Wrap::Side);
610- const auto mapped = [=](std::optional<QColor> c) {
611- if (c) {
612- return TopBarActionButtonStyle{
613- .bgColor = Ui::BlendColors (
614- *c,
615- Qt::black,
616- st::infoProfileTopBarActionButtonBgOpacity),
617- .fgColor = std::make_optional (st::premiumButtonFg->c ),
618- .shadowColor = std::nullopt ,
619- };
620- } else {
621- return TopBarActionButtonStyle{
622- .bgColor = anim::with_alpha (
623- st::boxBg->c ,
624- 1 . - st::infoProfileTopBarActionButtonBgOpacity),
625- .fgColor = std::nullopt ,
626- .shadowColor = std::make_optional (
627- st::windowShadowFgFallback->c ),
628- };
629- }
630- };
620+
631621 auto buttons = std::vector<not_null<TopBarActionButton*>>();
632622 _actions = base::make_unique_q<Ui::HorizontalFitContainer>(
633623 this ,
@@ -663,7 +653,9 @@ void TopBar::setupActions(not_null<Window::SessionController*> controller) {
663653 const auto current = _edgeColor.current ();
664654 _edgeColor.force_assign (current);
665655 }, _actions->lifetime ());
666- _edgeColor.value () | rpl::map (mapped) | rpl::start_with_next ([=](
656+ _edgeColor.value () | rpl::map ([=](std::optional<QColor> c) {
657+ return mapActionStyle (c);
658+ }) | rpl::start_with_next ([=](
667659 TopBarActionButtonStyle st) {
668660 for (const auto &button : buttons) {
669661 button->setStyle (st);
@@ -1450,8 +1442,8 @@ void TopBar::updateStatusPosition(float64 progressCurrent) {
14501442 statusLeft
14511443 + statusShift
14521444 + _status->textMaxWidth ()
1453- + st::infoProfileTopBarLastSeenSkip,
1454- statusTop);
1445+ + st::infoProfileTopBarLastSeenSkip. x () ,
1446+ statusTop + st::infoProfileTopBarLastSeenSkip. y () );
14551447 if (_showLastSeenOpacity) {
14561448 _showLastSeenOpacity->setOpacity (progressCurrent);
14571449 }
@@ -2481,4 +2473,26 @@ rpl::producer<QString> TopBar::nameValue() const {
24812473 return Info::Profile::NameValue (_peer);
24822474}
24832475
2476+ TopBarActionButtonStyle TopBar::mapActionStyle (
2477+ std::optional<QColor> c) const {
2478+ if (c) {
2479+ return TopBarActionButtonStyle{
2480+ .bgColor = Ui::BlendColors (
2481+ *c,
2482+ Qt::black,
2483+ st::infoProfileTopBarActionButtonBgOpacity),
2484+ .fgColor = std::make_optional (st::premiumButtonFg->c ),
2485+ .shadowColor = std::nullopt ,
2486+ };
2487+ } else {
2488+ return TopBarActionButtonStyle{
2489+ .bgColor = anim::with_alpha (
2490+ st::boxBg->c ,
2491+ 1 . - st::infoProfileTopBarActionButtonBgOpacity),
2492+ .fgColor = std::nullopt ,
2493+ .shadowColor = std::make_optional (st::windowShadowFgFallback->c ),
2494+ };
2495+ }
2496+ }
2497+
24842498} // namespace Info::Profile
0 commit comments