summaryrefslogtreecommitdiff
path: root/Userland/Libraries
diff options
context:
space:
mode:
authorKarol Kosek <krkk@krkk.ct8.pl>2021-09-15 21:05:33 +0200
committerAndreas Kling <kling@serenityos.org>2021-09-16 16:52:55 +0200
commitd1e1096bc0ef4d2438ff7a251fd89bc808ba9e5f (patch)
treeac001645f8fc5d6e86eca0776c46539f878e24b2 /Userland/Libraries
parent6f4333fca728caf7140c487176b8ea5671b63860 (diff)
downloadserenity-d1e1096bc0ef4d2438ff7a251fd89bc808ba9e5f.zip
LibGfx: Enumerate metric theme roles
This change does practically nothing except that you no longer have to put new roles there, as they are now automatically read from the enum list.
Diffstat (limited to 'Userland/Libraries')
-rw-r--r--Userland/Libraries/LibGfx/SystemTheme.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/Userland/Libraries/LibGfx/SystemTheme.cpp b/Userland/Libraries/LibGfx/SystemTheme.cpp
index 5bfac555e7..261daf3f23 100644
--- a/Userland/Libraries/LibGfx/SystemTheme.cpp
+++ b/Userland/Libraries/LibGfx/SystemTheme.cpp
@@ -77,12 +77,11 @@ Core::AnonymousBuffer load_system_theme(Core::ConfigFile const& file)
ENUMERATE_COLOR_ROLES(__ENUMERATE_COLOR_ROLE)
#undef __ENUMERATE_COLOR_ROLE
-#define DO_METRIC(x) \
- data->metric[(int)MetricRole::x] = get_metric(#x, (int)MetricRole::x)
-
- DO_METRIC(TitleHeight);
- DO_METRIC(TitleButtonWidth);
- DO_METRIC(TitleButtonHeight);
+#undef __ENUMERATE_METRIC_ROLE
+#define __ENUMERATE_METRIC_ROLE(role) \
+ data->metric[(int)MetricRole::role] = get_metric(#role, (int)MetricRole::role);
+ ENUMERATE_METRIC_ROLES(__ENUMERATE_METRIC_ROLE)
+#undef __ENUMERATE_METRIC_ROLE
#define DO_PATH(x, allow_empty) \
do { \