diff options
| author | in1tiate <32779090+in1tiate@users.noreply.github.com> | 2024-03-03 20:26:39 -0600 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-03-03 20:26:39 -0600 |
| commit | b48ca2455a2c7674859b2d3d8be2896cdc0f3739 (patch) | |
| tree | 766e221eff743aba3f95071a100e255b28958f69 /include | |
| parent | a8b28f50707a9cb7f0377e247e332519563237a2 (diff) | |
Add the ability for shownames to be outlined (#939)
* showname text outline, partial messagebox outline code
* your honor i plead oopsie daisies
* Focus down code, add config hookups
* remove extraneous qDebug calls
Diffstat (limited to 'include')
| -rw-r--r-- | include/aotextboxwidgets.h | 32 | ||||
| -rw-r--r-- | include/courtroom.h | 13 |
2 files changed, 40 insertions, 5 deletions
diff --git a/include/aotextboxwidgets.h b/include/aotextboxwidgets.h new file mode 100644 index 0000000..39bf406 --- /dev/null +++ b/include/aotextboxwidgets.h @@ -0,0 +1,32 @@ +#ifndef AOTEXTBOXWIDGETS_H +#define AOTEXTBOXWIDGETS_H + +#include <QAbstractTextDocumentLayout> +#include <QDebug> +#include <QLabel> +#include <QPaintEvent> +#include <QPainter> +#include <QPainterPath> +#include <QTextEdit> + +class AOChatboxLabel : public QLabel { + Q_OBJECT + +public: + AOChatboxLabel(QWidget *parent); + void paintEvent(QPaintEvent *event); + + void setOutlineColor(QColor color) { outline_color = color; }; + void setOutlineWidth(int width) { outline_width = width; }; + void setTextColor(QColor color) { text_color = color; }; + void setIsOutlined(bool outlined) { is_outlined = outlined; }; + +protected: +private: + QColor outline_color; + QColor text_color; + int outline_width = 1; + bool is_outlined = false; +}; + +#endif // AOTEXTBOXWIDGETS_H diff --git a/include/courtroom.h b/include/courtroom.h index 65ef75a..0b26247 100644 --- a/include/courtroom.h +++ b/include/courtroom.h @@ -7,24 +7,25 @@ #include "aocharbutton.h" #include "aoclocklabel.h" #include "aoemotebutton.h" +#include "aoemotepreview.h" #include "aoevidencebutton.h" #include "aoevidencedisplay.h" #include "aoimage.h" #include "aolayer.h" #include "aomusicplayer.h" -#include "widgets/aooptionsdialog.h" #include "aopacket.h" #include "aosfxplayer.h" #include "aotextarea.h" +#include "aotextboxwidgets.h" #include "chatlogpiece.h" #include "datatypes.h" #include "debug_functions.h" +#include "eventfilters.h" #include "file_functions.h" #include "hardware_functions.h" #include "lobby.h" #include "scrolltext.h" -#include "eventfilters.h" -#include "aoemotepreview.h" +#include "widgets/aooptionsdialog.h" #include <QCheckBox> #include <QCloseEvent> @@ -145,7 +146,9 @@ public: // actual operation of setting the font on a widget void set_qfont(QWidget *widget, QString class_name, QFont font, - QColor f_color = Qt::black, bool bold = false); + QColor f_color = Qt::black, bool bold = false, + bool outlined = false, QColor outline_color = QColor(0, 0, 0), + int outline_width = 1); // helper function that calls above function on the relevant widgets void set_fonts(QString p_char = ""); @@ -654,7 +657,7 @@ private: BackgroundLayer *ui_vp_desk; AOEvidenceDisplay *ui_vp_evidence_display; AOImage *ui_vp_chatbox; - QLabel *ui_vp_showname; + AOChatboxLabel *ui_vp_showname; InterfaceLayer *ui_vp_chat_arrow; QTextEdit *ui_vp_message; SplashLayer *ui_vp_testimony; |
