Change button round radius.

This commit is contained in:
John Preston 2020-12-08 11:12:46 +04:00
parent ea840471d2
commit dfc0f0b889
6 changed files with 7 additions and 6 deletions

View file

@ -73,7 +73,6 @@ roundRadiusLarge: 6px;
roundRadiusSmall: 3px;
dateRadius: roundRadiusLarge;
buttonRadius: roundRadiusSmall;
setLittleSkip: 9px;

View file

@ -236,8 +236,8 @@ RoundButton::RoundButton(
: RippleButton(parent, st.ripple)
, _textFull(std::move(text))
, _st(st)
, _roundRect(ImageRoundRadius::Small, _st.textBg)
, _roundRectOver(ImageRoundRadius::Small, _st.textBgOver) {
, _roundRect(st::buttonRadius, _st.textBg)
, _roundRectOver(st::buttonRadius, _st.textBgOver) {
_textFull.value(
) | rpl::start_with_next([=](const QString &text) {
resizeToText(text);

View file

@ -262,7 +262,7 @@ void CheckView::paint(Painter &p, int left, int top, int outerWidth) {
{
PainterHighQualityEnabler hq(p);
p.drawRoundedRect(style::rtlrect(QRectF(left, top, _st->diameter, _st->diameter).marginsRemoved(QMarginsF(_st->thickness / 2., _st->thickness / 2., _st->thickness / 2., _st->thickness / 2.)), outerWidth), st::buttonRadius - (_st->thickness / 2.), st::buttonRadius - (_st->thickness / 2.));
p.drawRoundedRect(style::rtlrect(QRectF(left, top, _st->diameter, _st->diameter).marginsRemoved(QMarginsF(_st->thickness / 2., _st->thickness / 2., _st->thickness / 2., _st->thickness / 2.)), outerWidth), st::roundRadiusSmall - (_st->thickness / 2.), st::roundRadiusSmall - (_st->thickness / 2.));
}
if (toggled > 0) {

View file

@ -1045,7 +1045,7 @@ void FlatInput::paintEvent(QPaintEvent *e) {
p.setBrush(anim::brush(_st.bgColor, _st.bgActive, placeholderFocused));
{
PainterHighQualityEnabler hq(p);
p.drawRoundedRect(QRectF(0, 0, width(), height()).marginsRemoved(QMarginsF(_st.borderWidth / 2., _st.borderWidth / 2., _st.borderWidth / 2., _st.borderWidth / 2.)), st::buttonRadius - (_st.borderWidth / 2.), st::buttonRadius - (_st.borderWidth / 2.));
p.drawRoundedRect(QRectF(0, 0, width(), height()).marginsRemoved(QMarginsF(_st.borderWidth / 2., _st.borderWidth / 2., _st.borderWidth / 2., _st.borderWidth / 2.)), st::roundRadiusSmall - (_st.borderWidth / 2.), st::roundRadiusSmall - (_st.borderWidth / 2.));
}
if (!_st.icon.empty()) {

View file

@ -142,7 +142,7 @@ void Tooltip::paintEvent(QPaintEvent *e) {
p.setPen(_st->textBorder);
p.setBrush(_st->textBg);
PainterHighQualityEnabler hq(p);
p.drawRoundedRect(QRectF(0.5, 0.5, width() - 1., height() - 1.), st::buttonRadius, st::buttonRadius);
p.drawRoundedRect(QRectF(0.5, 0.5, width() - 1., height() - 1.), st::roundRadiusSmall, st::roundRadiusSmall);
} else {
p.fillRect(rect(), _st->textBg);

View file

@ -626,6 +626,8 @@ defaultRippleAnimation: RippleAnimation {
emptyRippleAnimation: RippleAnimation {
}
buttonRadius: 4px;
defaultActiveButton: RoundButton {
textFg: activeButtonFg;
textFgOver: activeButtonFgOver;