diff options
Diffstat (limited to 'src/aoemotebutton.cpp')
| -rw-r--r-- | src/aoemotebutton.cpp | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/src/aoemotebutton.cpp b/src/aoemotebutton.cpp index ca4d6941..8d687126 100644 --- a/src/aoemotebutton.cpp +++ b/src/aoemotebutton.cpp @@ -13,23 +13,30 @@ AOEmoteButton::AOEmoteButton(QWidget *p_parent, AOApplication *p_ao_app, int p_x connect(this, SIGNAL(clicked()), this, SLOT(on_clicked())); } -void AOEmoteButton::set_image(QString p_char, int p_emote, QString suffix) +void AOEmoteButton::set_image(QString p_image, QString p_emote_comment) { - QString emotion_number = QString::number(p_emote + 1); - QString image_path = ao_app->get_static_image_suffix(ao_app->get_character_path(p_char, "emotions/button" + emotion_number + suffix)); - - if (file_exists(image_path)) + if (file_exists(p_image)) { + this->setIcon(QIcon(p_image)); + this->setIconSize(this->size()); + this->setStyleSheet("border:0px"); this->setText(""); - this->setStyleSheet("border-image:url(\"" + image_path + "\")"); } else { - this->setText(ao_app->get_emote_comment(p_char, p_emote)); + this->setText(p_emote_comment); this->setStyleSheet("border-image:url(\"\")"); } } +void AOEmoteButton::set_char_image(QString p_char, int p_emote, QString suffix) +{ + QString emotion_number = QString::number(p_emote + 1); + QString image_path = ao_app->get_static_image_suffix(ao_app->get_character_path(p_char, "emotions/button" + emotion_number + suffix)); + + this->set_image(image_path, ao_app->get_emote_comment(p_char, p_emote)); +} + void AOEmoteButton::on_clicked() { emote_clicked(m_id); |
