mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Replaced text drawing in menu from phone handler with Text::String.
This commit is contained in:
parent
06d0e78b00
commit
6400875d55
1 changed files with 15 additions and 3 deletions
|
@ -168,7 +168,16 @@ void ResolvePhoneAction::paint(Painter &p) {
|
||||||
width());
|
width());
|
||||||
} else {
|
} else {
|
||||||
p.setPen(selected ? _st.itemFgShortcutOver : _st.itemFgShortcut);
|
p.setPen(selected ? _st.itemFgShortcutOver : _st.itemFgShortcut);
|
||||||
p.drawText(rect() - padding, _below.toString(), style::al_center);
|
const auto w = width() - padding.left() - padding.right();
|
||||||
|
_below.draw(p, Ui::Text::PaintContext{
|
||||||
|
.position = QPoint(
|
||||||
|
(width() - w) / 2,
|
||||||
|
(height - _below.countHeight(w)) / 2),
|
||||||
|
.availableWidth = w,
|
||||||
|
.outerWidth = w,
|
||||||
|
.align = style::al_center,
|
||||||
|
.elisionLines = 2,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -208,8 +217,6 @@ void ResolvePhoneAction::prepare() {
|
||||||
_below.setMarkedText(_st.itemStyle, { text }, options);
|
_below.setMarkedText(_st.itemStyle, { text }, options);
|
||||||
return _below.maxWidth();
|
return _below.maxWidth();
|
||||||
}();
|
}();
|
||||||
_above.setMarkedText(_st.itemStyle, { above }, options);
|
|
||||||
_below.setMarkedText(_st.itemStyle, { below }, options);
|
|
||||||
const auto textLeft = padding.left()
|
const auto textLeft = padding.left()
|
||||||
+ st::groupCallJoinAsPhotoSize
|
+ st::groupCallJoinAsPhotoSize
|
||||||
+ padding.left();
|
+ padding.left();
|
||||||
|
@ -217,6 +224,11 @@ void ResolvePhoneAction::prepare() {
|
||||||
(textLeft + tempWidth + padding.right()),
|
(textLeft + tempWidth + padding.right()),
|
||||||
_st.widthMin,
|
_st.widthMin,
|
||||||
_st.widthMax);
|
_st.widthMax);
|
||||||
|
if (!no.isEmpty()) {
|
||||||
|
_below = Ui::Text::String(w);
|
||||||
|
}
|
||||||
|
_above.setMarkedText(_st.itemStyle, { above }, options);
|
||||||
|
_below.setMarkedText(_st.itemStyle, { below }, options);
|
||||||
setMinWidth(w);
|
setMinWidth(w);
|
||||||
_aboveWidth = w - textLeft - padding.right();
|
_aboveWidth = w - textLeft - padding.right();
|
||||||
_belowWidth = w
|
_belowWidth = w
|
||||||
|
|
Loading…
Add table
Reference in a new issue