Since the current rendering engine does not easily support switching
fonts in the middle of a message, we can't currently support the
Monospace format code as specified in [1].
However, to avoid weird artifacts when other clients send this, ignore
the format code for now.
Format codes 0x12 and 0x16 toggle the swap of foreground and
background colors. In the current implementation, the color
swap only applies to custom colors, i.e. mIRC colors and hex
colors. Normal text is not affected.
Since this is not a styleable property, remove support for it
from the stylesheet parser.
uistyle: Define via stylesheet if color codes have an effect
In certain situations, color codes should have no effect, e.g. when
selecting text. This required hacks in stylesheets; for example
when setting a foreground color for self or highlighted messages,
the mIRC colors had to be redefined in the stylesheet for that label.
Also the code had some workaround, e.g. for URLs.
With the introduction of the non-styleable extended mIRC and
hex colors, these workarounds are no longer possible.
Solve these issues by introducing two new properties that can be set
in the stylesheet:
Note that there are known issues with prioritization in the theme
engine (i.e., setting the foreground explicitly in the stylesheet
will always override hex colors), which will be fixed in a follow-up
commit.
uistyle: Add more type-safety to UiStyle, and clean up a bit
Migrate all UiStyle enums to be enum classes. Enforce explicit types
instead of quint32 in most places using them, and handle MessageLabel
in a more obvious fashion. A bunch of bit-wise operators had to be
added to avoid lots of boilerplate when dealing with the enums.
FormatList now holds the formats in a struct rather than as plain enum
(or quint32) values. This will be needed for extended color support;
as the format type cannot hold the hard-coded extended color values,
the colors will be stored explicitly in the list and applied as
appropriate.
Also, in the quest to modernize the codebase, FormatList is now a
std::vector rather than a QList.