Fixed display of resolving phone menu item with increased round radius.

This commit is contained in:
23rd
2025-12-16 10:33:50 +03:00
parent 5ee8100274
commit 4c545181ad
@@ -40,7 +40,7 @@ class ResolvePhoneAction final : public Ui::Menu::ItemBase {
public: public:
ResolvePhoneAction( ResolvePhoneAction(
not_null<Ui::RpWidget*> parent, not_null<Ui::RpWidget*> parent,
const style::Menu &st, const style::PopupMenu &st,
const QString &phone, const QString &phone,
not_null<Window::SessionController*> controller); not_null<Window::SessionController*> controller);
@@ -64,6 +64,7 @@ private:
const not_null<QAction*> _dummyAction; const not_null<QAction*> _dummyAction;
const style::Menu &_st; const style::Menu &_st;
const int _shadowPadding;
rpl::variable<PeerData*> _peer; rpl::variable<PeerData*> _peer;
rpl::variable<bool> _loaded; rpl::variable<bool> _loaded;
Ui::PeerUserpicView _userpicView; Ui::PeerUserpicView _userpicView;
@@ -80,12 +81,13 @@ private:
ResolvePhoneAction::ResolvePhoneAction( ResolvePhoneAction::ResolvePhoneAction(
not_null<Ui::RpWidget*> parent, not_null<Ui::RpWidget*> parent,
const style::Menu &st, const style::PopupMenu &st,
const QString &phone, const QString &phone,
not_null<Window::SessionController*> controller) not_null<Window::SessionController*> controller)
: ItemBase(parent, st) : ItemBase(parent, st.menu)
, _dummyAction(new QAction(parent)) , _dummyAction(new QAction(parent))
, _st(st) , _st(st.menu)
, _shadowPadding(rect::m::sum::h(st.shadow.extend))
, _api(&controller->session().mtp()) , _api(&controller->session().mtp())
, _height(rect::m::sum::v(st::groupCallJoinAsPadding) , _height(rect::m::sum::v(st::groupCallJoinAsPadding)
+ st::groupCallJoinAsPhotoSize) { + st::groupCallJoinAsPhotoSize) {
@@ -184,10 +186,12 @@ void ResolvePhoneAction::paint(Painter &p) {
width()); width());
} else { } else {
p.setPen(selected ? _st.itemFgShortcutOver : _st.itemFgShortcut); p.setPen(selected ? _st.itemFgShortcutOver : _st.itemFgShortcut);
const auto w = width() - padding.left() - padding.right(); const auto w = width()
- rect::m::sum::h(padding)
- _shadowPadding;
_below.draw(p, Ui::Text::PaintContext{ _below.draw(p, Ui::Text::PaintContext{
.position = QPoint( .position = QPoint(
(width() - w) / 2, (w - _below.countLineWidths(w).front()) / 4,
(height - _below.countHeight(w)) / 2), (height - _below.countHeight(w)) / 2),
.outerWidth = w, .outerWidth = w,
.availableWidth = w, .availableWidth = w,
@@ -333,7 +337,7 @@ void PhoneClickHandler::onClick(ClickContext context) const {
auto resolvePhoneAction = base::make_unique_q<ResolvePhoneAction>( auto resolvePhoneAction = base::make_unique_q<ResolvePhoneAction>(
menu, menu,
menu->st().menu, menu->st(),
phone, phone,
controller); controller);