Inline switch to pm and back support added for inline bots.

This commit is contained in:
John Preston
2016-04-08 18:16:52 +04:00
parent 8e89486fbc
commit fa0c700ca6
18 changed files with 430 additions and 193 deletions
+17 -6
View File
@@ -348,6 +348,23 @@ BoxButton::BoxButton(QWidget *parent, const QString &text, const style::BoxButto
, 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 BoxButton::setText(const QString &text) {
_text = text;
_fullText = text;
_textWidth = _st.font->width(_text);
resizeToText();
}
void BoxButton::resizeToText() {
if (_st.width <= 0) {
resize(_textWidth - _st.width, _st.height);
} else {
@@ -357,12 +374,6 @@ BoxButton::BoxButton(QWidget *parent, const QString &text, const style::BoxButto
}
resize(_st.width, _st.height);
}
connect(this, SIGNAL(stateChanged(int, ButtonStateChangeSource)), this, SLOT(onStateChange(int, ButtonStateChangeSource)));
setCursor(style::cur_pointer);
setAttribute(Qt::WA_OpaquePaintEvent);
}
void BoxButton::paintEvent(QPaintEvent *e) {