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; roundRadiusSmall: 3px;
dateRadius: roundRadiusLarge; dateRadius: roundRadiusLarge;
buttonRadius: roundRadiusSmall;
setLittleSkip: 9px; setLittleSkip: 9px;

View file

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

View file

@ -262,7 +262,7 @@ void CheckView::paint(Painter &p, int left, int top, int outerWidth) {
{ {
PainterHighQualityEnabler hq(p); 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) { if (toggled > 0) {

View file

@ -1045,7 +1045,7 @@ void FlatInput::paintEvent(QPaintEvent *e) {
p.setBrush(anim::brush(_st.bgColor, _st.bgActive, placeholderFocused)); p.setBrush(anim::brush(_st.bgColor, _st.bgActive, placeholderFocused));
{ {
PainterHighQualityEnabler hq(p); 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()) { if (!_st.icon.empty()) {

View file

@ -142,7 +142,7 @@ void Tooltip::paintEvent(QPaintEvent *e) {
p.setPen(_st->textBorder); p.setPen(_st->textBorder);
p.setBrush(_st->textBg); p.setBrush(_st->textBg);
PainterHighQualityEnabler hq(p); 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 { } else {
p.fillRect(rect(), _st->textBg); p.fillRect(rect(), _st->textBg);

View file

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