aboutsummaryrefslogtreecommitdiff
path: root/src/aoemotebutton.cpp
diff options
context:
space:
mode:
authorCrystalwarrior <varsash@gmail.com>2020-05-22 01:18:24 +0300
committerCrystalwarrior <varsash@gmail.com>2020-05-22 01:18:24 +0300
commitc8e12558cdd3fd0769b81679ad09edf1f29b780f (patch)
tree7dae2225e574c3ee55d6b82a1d2f399db4ace5c0 /src/aoemotebutton.cpp
parentdfac0652c8eb9bd48ceea7ae755e9c2f7e5cb1a2 (diff)
Clang-ify the code with this styling using Visual Studio Code:
{ BasedOnStyle: LLVM, UseTab: Never, IndentWidth: 4, TabWidth: 4, BreakBeforeBraces: Stroustrup, AllowShortIfStatementsOnASingleLine: false, IndentCaseLabels: false, ColumnLimit: 0, AccessModifierOffset: -4, NamespaceIndentation: All } (this is the Visual Studio preset with only "BreakBeforeBraces" changed from Allman to Stroustrup)
Diffstat (limited to 'src/aoemotebutton.cpp')
-rw-r--r--src/aoemotebutton.cpp40
1 files changed, 19 insertions, 21 deletions
diff --git a/src/aoemotebutton.cpp b/src/aoemotebutton.cpp
index e42bb73c..991451f8 100644
--- a/src/aoemotebutton.cpp
+++ b/src/aoemotebutton.cpp
@@ -4,40 +4,38 @@
AOEmoteButton::AOEmoteButton(QWidget *p_parent, AOApplication *p_ao_app, int p_x, int p_y, int p_w, int p_h) : QPushButton(p_parent)
{
- parent = p_parent;
- ao_app = p_ao_app;
+ parent = p_parent;
+ ao_app = p_ao_app;
- this->move(p_x, p_y);
- this->resize(p_w, p_h);
+ this->move(p_x, p_y);
+ this->resize(p_w, p_h);
- connect(this, SIGNAL(clicked()), this, SLOT(on_clicked()));
+ connect(this, SIGNAL(clicked()), this, SLOT(on_clicked()));
}
void AOEmoteButton::set_image(QString p_image, QString p_emote_comment)
{
- if (file_exists(p_image))
- {
- this->setText("");
- this->setStyleSheet("QPushButton { border-image: url(\"" + p_image + "\") 0 0 0 0 stretch stretch; }"
- "QToolTip { color: #000000; background-color: #ffffff; border: 0px; }");
- }
- else
- {
- this->setText(p_emote_comment);
- this->setStyleSheet("QPushButton { border-image: url(); }"
- "QToolTip { background-image: url(); color: #000000; background-color: #ffffff; border: 0px; }");
- }
+ if (file_exists(p_image)) {
+ this->setText("");
+ this->setStyleSheet("QPushButton { border-image: url(\"" + p_image + "\") 0 0 0 0 stretch stretch; }"
+ "QToolTip { color: #000000; background-color: #ffffff; border: 0px; }");
+ }
+ else {
+ this->setText(p_emote_comment);
+ this->setStyleSheet("QPushButton { border-image: url(); }"
+ "QToolTip { background-image: url(); color: #000000; background-color: #ffffff; border: 0px; }");
+ }
}
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));
+ 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));
+ this->set_image(image_path, ao_app->get_emote_comment(p_char, p_emote));
}
void AOEmoteButton::on_clicked()
{
- emote_clicked(m_id);
+ emote_clicked(m_id);
}