uistyle: Add more type-safety to UiStyle, and clean up a bit
authorManuel Nickschas <sputnick@quassel-irc.org>
Tue, 6 Mar 2018 20:07:42 +0000 (21:07 +0100)
committerManuel Nickschas <sputnick@quassel-irc.org>
Thu, 8 Mar 2018 01:10:28 +0000 (02:10 +0100)
commitac7a58dd970833da2336f6ce035ec55515bac0f1
treec098ef38620d1c47abfd9832e18f84d4425a5617
parent258df63876c8b2b5f3ff14a6fbae14ea0b713457
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.
13 files changed:
src/qtui/chatitem.cpp
src/qtui/chatitem.h
src/qtui/chatline.cpp
src/qtui/chatlinemodelitem.cpp
src/qtui/chatlinemodelitem.h
src/qtui/markerlineitem.cpp
src/qtui/topicwidget.cpp
src/uisupport/qssparser.cpp
src/uisupport/qssparser.h
src/uisupport/styledlabel.cpp
src/uisupport/uisettings.cpp
src/uisupport/uistyle.cpp
src/uisupport/uistyle.h