Ejemplo n.º 1
0
void BoxButton::setText(const QString &text) {
	_text = text;
	_fullText = text;
	_textWidth = _st.font->width(_text);
	resizeToText();
	update();
}
Ejemplo n.º 2
0
void RoundButton::updateText() {
	if (_transform == TextTransform::ToUpper) {
		_text = _fullText.toUpper();
	} else {
		_text = _fullText;
	}
	_textWidth = _text.isEmpty() ? 0 : _st.font->width(_text);

	resizeToText();
	update();
}
Ejemplo n.º 3
0
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);
}
Ejemplo n.º 4
0
void RoundButton::setFullWidth(int newFullWidth) {
	_fullWidthOverride = newFullWidth;
	resizeToText();
}
Ejemplo n.º 5
0
void RoundButton::numbersAnimationCallback() {
	resizeToText();
	update();
}