From 923548c99746858846764e47fa96899e7c5ef2ab Mon Sep 17 00:00:00 2001 From: Crystalwarrior Date: Wed, 25 Sep 2019 02:05:52 +0300 Subject: Hellcommit of doom and suffering Create two new helper functions - get_chat_markdown and remake read_char_ini_tag to be read_ini_tags for more general purpose Modify aolineedit to support preserving selection after unfocusing (building this for using dropdown list for setting colors), as well as remove the setReadOnly functionality and use it in signals instead Overhaul the color system to get rid of inline colors, allow full customization of colors and usage of configuration files for every facet of how a color functions (should we be talking, should we remove that markdown char, etc.) Complete overhaul of color markdowns system TODO: Make this thing not lag to hell, fix chat messages hogging the IC as the animation never ends apparently --- include/aolineedit.h | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'include/aolineedit.h') diff --git a/include/aolineedit.h b/include/aolineedit.h index ce17680..0952172 100644 --- a/include/aolineedit.h +++ b/include/aolineedit.h @@ -11,16 +11,17 @@ class AOLineEdit : public QLineEdit public: AOLineEdit(QWidget *parent); + void preserve_selection(bool toggle) {p_selection = toggle;} + +private: + bool p_selection = false; + protected: void mouseDoubleClickEvent(QMouseEvent *e); + void focusOutEvent(QFocusEvent *ev); signals: void double_clicked(); - -private slots: - void on_enter_pressed(); - - }; #endif // AOLINEEDIT_H -- 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/aolineedit.h | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'include/aolineedit.h') diff --git a/include/aolineedit.h b/include/aolineedit.h index 0952172..06206a9 100644 --- a/include/aolineedit.h +++ b/include/aolineedit.h @@ -4,24 +4,23 @@ #include #include -class AOLineEdit : public QLineEdit -{ - Q_OBJECT +class AOLineEdit : public QLineEdit { + Q_OBJECT public: - AOLineEdit(QWidget *parent); + AOLineEdit(QWidget *parent); - void preserve_selection(bool toggle) {p_selection = toggle;} + void preserve_selection(bool toggle) { p_selection = toggle; } private: - bool p_selection = false; + bool p_selection = false; protected: - void mouseDoubleClickEvent(QMouseEvent *e); - void focusOutEvent(QFocusEvent *ev); + void mouseDoubleClickEvent(QMouseEvent *e); + void focusOutEvent(QFocusEvent *ev); signals: - void double_clicked(); + void double_clicked(); }; #endif // AOLINEEDIT_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/aolineedit.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'include/aolineedit.h') diff --git a/include/aolineedit.h b/include/aolineedit.h index 06206a9..5dce3aa 100644 --- a/include/aolineedit.h +++ b/include/aolineedit.h @@ -5,22 +5,22 @@ #include class AOLineEdit : public QLineEdit { - Q_OBJECT + Q_OBJECT public: - AOLineEdit(QWidget *parent); + AOLineEdit(QWidget *parent); - void preserve_selection(bool toggle) { p_selection = toggle; } + void preserve_selection(bool toggle) { p_selection = toggle; } private: - bool p_selection = false; + bool p_selection = false; protected: - void mouseDoubleClickEvent(QMouseEvent *e); - void focusOutEvent(QFocusEvent *ev); + void mouseDoubleClickEvent(QMouseEvent *e); + void focusOutEvent(QFocusEvent *ev); signals: - void double_clicked(); + void double_clicked(); }; #endif // AOLINEEDIT_H -- cgit