aboutsummaryrefslogtreecommitdiff
path: root/src/aocharbutton.cpp
diff options
context:
space:
mode:
authoroldmud0 <oldmud0@users.noreply.github.com>2020-04-17 21:57:16 -0500
committeroldmud0 <oldmud0@users.noreply.github.com>2020-04-17 21:57:16 -0500
commit13942345c6a3e7e1625c6c26cc2f2f368a3bff23 (patch)
tree73ce940217b57fd47afb6a95e828e6309ed5e683 /src/aocharbutton.cpp
parentfaac191f0b9e99b82614ed3959ec5c67f56a1fc3 (diff)
Run clang-format on entire project
Indentation fixed to 2 spaces per tab. Braces set to Stroustrup style. Lines reflow at 80 characters. One-line method bodies are on the same line as the signature. Space always after `//`. No indentation on preprocessor macros. Includes are sorted lexicographically. If you don't want to see this commit on blames, use the hidden whitespace option on GitHub, or use `-w` in git-blame.
Diffstat (limited to 'src/aocharbutton.cpp')
-rw-r--r--src/aocharbutton.cpp32
1 files changed, 11 insertions, 21 deletions
diff --git a/src/aocharbutton.cpp b/src/aocharbutton.cpp
index 76610270..5c8a73bb 100644
--- a/src/aocharbutton.cpp
+++ b/src/aocharbutton.cpp
@@ -2,7 +2,9 @@
#include "file_functions.h"
-AOCharButton::AOCharButton(QWidget *parent, AOApplication *p_ao_app, int x_pos, int y_pos, bool is_taken) : QPushButton(parent)
+AOCharButton::AOCharButton(QWidget *parent, AOApplication *p_ao_app, int x_pos,
+ int y_pos, bool is_taken)
+ : QPushButton(parent)
{
m_parent = parent;
@@ -40,45 +42,35 @@ void AOCharButton::reset()
ui_selector->hide();
}
-void AOCharButton::set_taken(bool is_taken)
-{
- taken = is_taken;
-}
+void AOCharButton::set_taken(bool is_taken) { taken = is_taken; }
void AOCharButton::apply_taken_image()
{
- if (taken)
- {
- ui_taken->move(0,0);
+ if (taken) {
+ ui_taken->move(0, 0);
ui_taken->show();
}
- else
- {
+ else {
ui_taken->hide();
}
}
-void AOCharButton::set_passworded()
-{
- ui_passworded->show();
-}
+void AOCharButton::set_passworded() { ui_passworded->show(); }
void AOCharButton::set_image(QString p_character)
{
QString image_path = ao_app->get_character_path(p_character, "char_icon.png");
-
this->setText("");
if (file_exists(image_path))
this->setStyleSheet("border-image:url(\"" + image_path + "\")");
- else
- {
+ else {
this->setStyleSheet("border-image:url()");
this->setText(p_character);
}
}
-void AOCharButton::enterEvent(QEvent * e)
+void AOCharButton::enterEvent(QEvent *e)
{
ui_selector->move(this->x() - 1, this->y() - 1);
ui_selector->raise();
@@ -88,10 +80,8 @@ void AOCharButton::enterEvent(QEvent * e)
QPushButton::enterEvent(e);
}
-void AOCharButton::leaveEvent(QEvent * e)
+void AOCharButton::leaveEvent(QEvent *e)
{
ui_selector->hide();
QPushButton::leaveEvent(e);
}
-
-