2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 14:45:14 +00:00

Change button round radius.

This commit is contained in:
John Preston
2020-12-08 11:19:23 +04:00
parent a527d5c535
commit dde94d486b
20 changed files with 80 additions and 80 deletions

View File

@@ -41,7 +41,7 @@ Widget::Widget(
_width = width();
_height = height();
_scroll->resize(st::emojiPanWidth - st::buttonRadius, _contentHeight);
_scroll->resize(st::emojiPanWidth - st::roundRadiusSmall, _contentHeight);
_scroll->move(verticalRect().topLeft());
_inner = _scroll->setOwnedWidget(object_ptr<Inner>(this, controller));
@@ -71,7 +71,7 @@ Widget::Widget(
// But we should force it to repaint so that GIFs will continue to animate without update() calls.
// We do that by creating a transparent widget above our _inner.
auto forceRepaintOnScroll = object_ptr<TWidget>(this);
forceRepaintOnScroll->setGeometry(innerRect().x() + st::buttonRadius, innerRect().y() + st::buttonRadius, st::buttonRadius, st::buttonRadius);
forceRepaintOnScroll->setGeometry(innerRect().x() + st::roundRadiusSmall, innerRect().y() + st::roundRadiusSmall, st::roundRadiusSmall, st::roundRadiusSmall);
forceRepaintOnScroll->setAttribute(Qt::WA_TransparentForMouseEvents);
forceRepaintOnScroll->show();
@@ -154,7 +154,7 @@ void Widget::paintContent(Painter &p) {
auto sidesTop = horizontal.y();
auto sidesHeight = horizontal.height();
p.fillRect(myrtlrect(inner.x() + inner.width() - st::emojiScroll.width, sidesTop, st::emojiScroll.width, sidesHeight), st::emojiPanBg);
p.fillRect(myrtlrect(inner.x(), sidesTop, st::buttonRadius, sidesHeight), st::emojiPanBg);
p.fillRect(myrtlrect(inner.x(), sidesTop, st::roundRadiusSmall, sidesHeight), st::emojiPanBg);
}
void Widget::moveByBottom() {
@@ -303,11 +303,11 @@ QRect Widget::innerRect() const {
}
QRect Widget::horizontalRect() const {
return innerRect().marginsRemoved(style::margins(0, st::buttonRadius, 0, st::buttonRadius));
return innerRect().marginsRemoved(style::margins(0, st::roundRadiusSmall, 0, st::roundRadiusSmall));
}
QRect Widget::verticalRect() const {
return innerRect().marginsRemoved(style::margins(st::buttonRadius, 0, st::buttonRadius, 0));
return innerRect().marginsRemoved(style::margins(st::roundRadiusSmall, 0, st::roundRadiusSmall, 0));
}
void Widget::clearInlineBot() {
@@ -319,8 +319,8 @@ bool Widget::overlaps(const QRect &globalRect) const {
auto testRect = QRect(mapFromGlobal(globalRect.topLeft()), globalRect.size());
auto inner = rect().marginsRemoved(st::emojiPanMargins);
return inner.marginsRemoved(QMargins(st::buttonRadius, 0, st::buttonRadius, 0)).contains(testRect)
|| inner.marginsRemoved(QMargins(0, st::buttonRadius, 0, st::buttonRadius)).contains(testRect);
return inner.marginsRemoved(QMargins(st::roundRadiusSmall, 0, st::roundRadiusSmall, 0)).contains(testRect)
|| inner.marginsRemoved(QMargins(0, st::roundRadiusSmall, 0, st::roundRadiusSmall)).contains(testRect);
}
void Widget::inlineBotChanged() {