mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-08-31 06:26:18 +00:00
Use emoji/stickers/gifs slider in EmojiPan.
Also rename EmojiTabs to EmojiSections.
This commit is contained in:
@@ -236,11 +236,12 @@ QImage SettingsSlider::prepareRippleMask(int sectionIndex, const Section §io
|
||||
void SettingsSlider::paintEvent(QPaintEvent *e) {
|
||||
Painter p(this);
|
||||
|
||||
auto clip = e->rect();
|
||||
auto ms = getms();
|
||||
auto activeLeft = getCurrentActiveLeft(ms);
|
||||
|
||||
p.setFont(_st.labelFont);
|
||||
enumerateSections([this, &p, activeLeft, ms](Section §ion) {
|
||||
enumerateSections([this, &p, activeLeft, ms, clip](Section §ion) {
|
||||
auto active = 1. - snap(qAbs(activeLeft - section.left) / float64(section.width), 0., 1.);
|
||||
if (section.ripple) {
|
||||
auto color = anim::color(_st.rippleBg, _st.rippleBgActive, active);
|
||||
@@ -266,8 +267,10 @@ void SettingsSlider::paintEvent(QPaintEvent *e) {
|
||||
if (tofill) {
|
||||
p.fillRect(myrtlrect(from, _st.barTop, tofill, _st.barStroke), _st.barFg);
|
||||
}
|
||||
p.setPen(anim::pen(_st.labelFg, _st.labelFgActive, active));
|
||||
p.drawTextLeft(section.left + (section.width - section.labelWidth) / 2, _st.labelTop, width(), section.label, section.labelWidth);
|
||||
if (myrtlrect(section.left, _st.labelTop, section.width, _st.labelFont->height).intersects(clip)) {
|
||||
p.setPen(anim::pen(_st.labelFg, _st.labelFgActive, active));
|
||||
p.drawTextLeft(section.left + (section.width - section.labelWidth) / 2, _st.labelTop, width(), section.label, section.labelWidth);
|
||||
}
|
||||
return true;
|
||||
});
|
||||
}
|
||||
|
Reference in New Issue
Block a user