Slightly improved style of scrollbar in emoji picker overlay.

This commit is contained in:
23rd
2026-04-13 22:16:56 +03:00
parent 9c21d99e01
commit e9944ba83d
2 changed files with 21 additions and 3 deletions
@@ -444,6 +444,12 @@ stickersEmojiPickerStripBubbleRight: 20px;
stickersEmojiPickerSelectedBg: windowBgActive;
stickersEmojiPickerSelectedFg: windowBgActive;
stickersEmojiPickerHeaderFg: windowSubTextFg;
stickersEmojiPickerScroll: ScrollArea(boxScroll) {
width: 14px;
deltax: 5px;
deltat: 4px;
deltab: 18px;
}
stickersEmojiPickerAbout: FlatLabel(defaultFlatLabel) {
minWidth: 100px;
align: align(top);
@@ -463,6 +469,7 @@ stickersEmojiPickerSectionHeader: FlatLabel(defaultFlatLabel) {
stickersEmojiPickerExpandIcon: icon {{ "intro_country_dropdown", windowSubTextFg }};
stickersEmojiPickerCollapseIcon: icon {{ "intro_country_dropdown-flip_vertical", windowSubTextFg }};
stickersEmojiPickerExpandSize: 24px;
stickersEmojiPickerExpandBg: windowBgRipple;
stickersEmojiPickerBoxShadow: BoxShadow {
blurRadius: 20px;
offset: point(0px, 6px);
@@ -420,6 +420,10 @@ EmojiPickerOverlay::EmojiPickerOverlay(
_expandButton->paintRequest(
) | rpl::on_next([=](const QRect &clip) {
auto p = QPainter(_expandButton);
auto hq = PainterHighQualityEnabler(p);
p.setPen(Qt::NoPen);
p.setBrush(st::stickersEmojiPickerExpandBg);
p.drawEllipse(_expandButton->rect());
const auto &icon = _expanded.current()
? st::stickersEmojiPickerCollapseIcon
: st::stickersEmojiPickerExpandIcon;
@@ -428,7 +432,9 @@ EmojiPickerOverlay::EmojiPickerOverlay(
icon.paint(p, x, y, _expandButton->width());
}, _expandButton->lifetime());
_scroll = std::make_unique<Ui::ScrollArea>(this);
_scroll = std::make_unique<Ui::ScrollArea>(
this,
st::stickersEmojiPickerScroll);
_scroll->setFrameStyle(QFrame::NoFrame);
_scroll->hide();
const auto gridPtr = _scroll->setOwnedWidget(
@@ -634,13 +640,18 @@ void EmojiPickerOverlay::relayout() {
const auto scrollH = std::max(
0,
bubbleBottom - scrollTop - pad.bottom());
const auto scrollContentWidth = bubble.width()
- pad.left()
- pad.right();
const auto scrollAreaWidth = scrollContentWidth
+ pad.right();
_scroll->setGeometry(
bubble.left() + pad.left(),
scrollTop,
bubble.width() - pad.left() - pad.right(),
scrollAreaWidth,
scrollH);
if (_grid) {
_grid->resizeGetHeight(_scroll->width());
_grid->resizeGetHeight(scrollContentWidth);
}
}
}