From cda7d430b3fa988258819012a5a96249aa553f1e Mon Sep 17 00:00:00 2001 From: Crystalwarrior Date: Wed, 18 Sep 2019 19:43:11 +0300 Subject: use SetIcon for AOEmoteButton instead of stylesheets Fix aolineedit not sending the double_clicked signal Add tooltips for emotes that display the number and the emote_comment (name) Add similar tooltips to evidence buttons Resolve an issue where you could edit evidence name without double-clicking a piece of evidence first --- include/aoemotebutton.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'include/aoemotebutton.h') diff --git a/include/aoemotebutton.h b/include/aoemotebutton.h index c99a73b..4c31014 100644 --- a/include/aoemotebutton.h +++ b/include/aoemotebutton.h @@ -13,9 +13,8 @@ class AOEmoteButton : public QPushButton public: AOEmoteButton(QWidget *p_parent, AOApplication *p_ao_app, int p_x, int p_y); - //void set_on(QString p_char, int p_emote); - //void set_off(QString p_char, int p_emote); - void set_image(QString p_char, int p_emote, QString suffix); + void set_image(QString p_image, QString p_emote_comment); + void set_char_image(QString p_char, int p_emote, QString suffix); void set_id(int p_id) {m_id = p_id;} int get_id() {return m_id;} -- cgit From d3f23708c43bc132c322b778b2aa8d31a68d1c0c Mon Sep 17 00:00:00 2001 From: Crystalwarrior Date: Fri, 20 Sep 2019 15:54:45 +0300 Subject: Revert buttons using setIcon and use a better stylesheet method instead Fix evidence buttons and emote buttons being hardcoded size --- include/aoemotebutton.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/aoemotebutton.h') diff --git a/include/aoemotebutton.h b/include/aoemotebutton.h index 4c31014..a13688b 100644 --- a/include/aoemotebutton.h +++ b/include/aoemotebutton.h @@ -11,7 +11,7 @@ class AOEmoteButton : public QPushButton Q_OBJECT public: - AOEmoteButton(QWidget *p_parent, AOApplication *p_ao_app, int p_x, int p_y); + AOEmoteButton(QWidget *p_parent, AOApplication *p_ao_app, int p_x, int p_y, int p_w, int p_h); void set_image(QString p_image, QString p_emote_comment); void set_char_image(QString p_char, int p_emote, QString suffix); -- cgit From c8e12558cdd3fd0769b81679ad09edf1f29b780f Mon Sep 17 00:00:00 2001 From: Crystalwarrior Date: Fri, 22 May 2020 01:18:24 +0300 Subject: 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) --- include/aoemotebutton.h | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) (limited to 'include/aoemotebutton.h') diff --git a/include/aoemotebutton.h b/include/aoemotebutton.h index a13688b..8674bb0 100644 --- a/include/aoemotebutton.h +++ b/include/aoemotebutton.h @@ -3,33 +3,32 @@ #include "aoapplication.h" -#include #include +#include -class AOEmoteButton : public QPushButton -{ - Q_OBJECT +class AOEmoteButton : public QPushButton { + Q_OBJECT public: - AOEmoteButton(QWidget *p_parent, AOApplication *p_ao_app, int p_x, int p_y, int p_w, int p_h); + AOEmoteButton(QWidget *p_parent, AOApplication *p_ao_app, int p_x, int p_y, int p_w, int p_h); - void set_image(QString p_image, QString p_emote_comment); - void set_char_image(QString p_char, int p_emote, QString suffix); + void set_image(QString p_image, QString p_emote_comment); + void set_char_image(QString p_char, int p_emote, QString suffix); - void set_id(int p_id) {m_id = p_id;} - int get_id() {return m_id;} + void set_id(int p_id) { m_id = p_id; } + int get_id() { return m_id; } private: - QWidget *parent; - AOApplication *ao_app; + QWidget *parent; + AOApplication *ao_app; - int m_id = 0; + int m_id = 0; signals: - void emote_clicked(int p_id); + void emote_clicked(int p_id); private slots: - void on_clicked(); + void on_clicked(); }; #endif // AOEMOTEBUTTON_H -- cgit From 88de4cde0433ef5e606f38a2f1e6041f0d24a87e Mon Sep 17 00:00:00 2001 From: Crystalwarrior Date: Fri, 22 May 2020 02:14:54 +0300 Subject: clang 2 electric boogaloo { BasedOnStyle: LLVM, BreakBeforeBraces: Stroustrup} --- include/aoemotebutton.h | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) (limited to 'include/aoemotebutton.h') diff --git a/include/aoemotebutton.h b/include/aoemotebutton.h index 8674bb0..cb46167 100644 --- a/include/aoemotebutton.h +++ b/include/aoemotebutton.h @@ -7,28 +7,29 @@ #include class AOEmoteButton : public QPushButton { - Q_OBJECT + Q_OBJECT public: - AOEmoteButton(QWidget *p_parent, AOApplication *p_ao_app, int p_x, int p_y, int p_w, int p_h); + AOEmoteButton(QWidget *p_parent, AOApplication *p_ao_app, int p_x, int p_y, + int p_w, int p_h); - void set_image(QString p_image, QString p_emote_comment); - void set_char_image(QString p_char, int p_emote, QString suffix); + void set_image(QString p_image, QString p_emote_comment); + void set_char_image(QString p_char, int p_emote, QString suffix); - void set_id(int p_id) { m_id = p_id; } - int get_id() { return m_id; } + void set_id(int p_id) { m_id = p_id; } + int get_id() { return m_id; } private: - QWidget *parent; - AOApplication *ao_app; + QWidget *parent; + AOApplication *ao_app; - int m_id = 0; + int m_id = 0; signals: - void emote_clicked(int p_id); + void emote_clicked(int p_id); private slots: - void on_clicked(); + void on_clicked(); }; #endif // AOEMOTEBUTTON_H -- cgit