aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/coreplugin/find/searchresultcolor.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/coreplugin/find/searchresultcolor.h')
-rw-r--r--src/plugins/coreplugin/find/searchresultcolor.h29
1 files changed, 26 insertions, 3 deletions
diff --git a/src/plugins/coreplugin/find/searchresultcolor.h b/src/plugins/coreplugin/find/searchresultcolor.h
index 51da45b9cab..0291133c0b8 100644
--- a/src/plugins/coreplugin/find/searchresultcolor.h
+++ b/src/plugins/coreplugin/find/searchresultcolor.h
@@ -25,18 +25,41 @@
#pragma once
+#include "../core_global.h"
+
#include <QColor>
+#include <QHash>
namespace Core {
-namespace Internal {
-class SearchResultColor{
+class CORE_EXPORT SearchResultColor {
public:
+ enum class Style { Default, Alt1, Alt2 };
+
+ SearchResultColor() = default;
+ SearchResultColor(const QColor &textBg, const QColor &textFg,
+ const QColor &highlightBg, const QColor &highlightFg)
+ : textBackground(textBg), textForeground(textFg),
+ highlightBackground(highlightBg), highlightForeground(highlightFg)
+ {
+ if (!highlightBackground.isValid())
+ highlightBackground = textBackground;
+ if (!highlightForeground.isValid())
+ highlightForeground = textForeground;
+ }
+
QColor textBackground;
QColor textForeground;
QColor highlightBackground;
QColor highlightForeground;
};
-} // namespace Internal
+
+inline uint qHash(SearchResultColor::Style style)
+{
+ return QT_PREPEND_NAMESPACE(qHash(int(style)));
+}
+
+using SearchResultColors = QHash<SearchResultColor::Style, SearchResultColor>;
+
} // namespace Core