| 147 | } |
| 148 | |
| 149 | void ResolvePhoneAction::paint(Painter &p) { |
| 150 | const auto selected = isSelected() && _peer.current(); |
| 151 | const auto height = contentHeight(); |
| 152 | if (selected && _st.itemBgOver->c.alpha() < 255) { |
| 153 | p.fillRect(0, 0, width(), height, _st.itemBg); |
| 154 | } |
| 155 | p.fillRect(0, 0, width(), height, selected ? _st.itemBgOver : _st.itemBg); |
| 156 | if (isEnabled()) { |
| 157 | paintRipple(p, 0, 0); |
| 158 | } |
| 159 | |
| 160 | const auto &padding = st::groupCallJoinAsPadding; |
| 161 | const auto textLeft = padding.left() |
| 162 | + st::groupCallJoinAsPhotoSize |
| 163 | + padding.left(); |
| 164 | if (const auto peer = _peer.current()) { |
| 165 | peer->paintUserpic( |
| 166 | p, |
| 167 | _userpicView, |
| 168 | padding.left(), |
| 169 | padding.top(), |
| 170 | st::groupCallJoinAsPhotoSize); |
| 171 | p.setPen(selected ? _st.itemFgOver : _st.itemFg); |
| 172 | _above.drawLeftElided( |
| 173 | p, |
| 174 | textLeft, |
| 175 | st::groupCallJoinAsTextTop, |
| 176 | width() - textLeft - padding.right(), |
| 177 | width()); |
| 178 | p.setPen(selected ? _st.itemFgShortcutOver : _st.itemFgShortcut); |
| 179 | _below.drawLeftElided( |
| 180 | p, |
| 181 | textLeft, |
| 182 | st::groupCallJoinAsNameTop, |
| 183 | _belowWidth, |
| 184 | width()); |
| 185 | } else { |
| 186 | p.setPen(selected ? _st.itemFgShortcutOver : _st.itemFgShortcut); |
| 187 | const auto w = width() - rect::m::sum::h(padding); |
| 188 | _below.draw(p, Ui::Text::PaintContext{ |
| 189 | .position = QPoint( |
| 190 | padding.left(), |
| 191 | (height - _below.countHeight(w)) / 2), |
| 192 | .outerWidth = w, |
| 193 | .availableWidth = w, |
| 194 | .align = style::al_center, |
| 195 | .elisionLines = 2, |
| 196 | }); |
| 197 | } |
| 198 | } |
| 199 | |
| 200 | void ResolvePhoneAction::prepare() { |
| 201 | rpl::combine( |
nothing calls this directly
no test coverage detected