void BoxButton::setText(const QString &text) { _text = text; _fullText = text; _textWidth = _st.font->width(_text); resizeToText(); update(); }
void RoundButton::updateText() { if (_transform == TextTransform::ToUpper) { _text = _fullText.toUpper(); } else { _text = _fullText; } _textWidth = _text.isEmpty() ? 0 : _st.font->width(_text); resizeToText(); update(); }
BoxButton::BoxButton(QWidget *parent, const QString &text, const style::BoxButton &st) : Button(parent) , _text(text.toUpper()) , _fullText(text.toUpper()) , _textWidth(st.font->width(_text)) , _st(st) , a_textBgOverOpacity(0) , a_textFg(st.textFg->c) , _a_over(animation(this, &BoxButton::step_over)) { resizeToText(); connect(this, SIGNAL(stateChanged(int, ButtonStateChangeSource)), this, SLOT(onStateChange(int, ButtonStateChangeSource))); setCursor(style::cur_pointer); setAttribute(Qt::WA_OpaquePaintEvent); }
void RoundButton::setFullWidth(int newFullWidth) { _fullWidthOverride = newFullWidth; resizeToText(); }
void RoundButton::numbersAnimationCallback() { resizeToText(); update(); }