aboutsummaryrefslogtreecommitdiff
path: root/src/Theme.cpp
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2024-08-01 18:38:06 +0200
committerdec05eba <dec05eba@protonmail.com>2024-08-01 18:38:06 +0200
commit6624db873c91087bc1805b9d018c92c455b85190 (patch)
tree169010942015f1ff209cd56600f4de433c8792ef /src/Theme.cpp
parent5d40409fc6e54af4c4dccdab11f03bce21c5a9a2 (diff)
Move dropdown button text and icon code to dropdown button class
Diffstat (limited to 'src/Theme.cpp')
-rw-r--r--src/Theme.cpp34
1 files changed, 34 insertions, 0 deletions
diff --git a/src/Theme.cpp b/src/Theme.cpp
new file mode 100644
index 0000000..0f44126
--- /dev/null
+++ b/src/Theme.cpp
@@ -0,0 +1,34 @@
+#include "../include/Theme.hpp"
+#include "../include/GsrInfo.hpp"
+#include <assert.h>
+
+namespace gsr {
+ static Theme theme;
+ static bool initialized = false;
+
+ void init_theme(const gsr::GsrInfo &gsr_info) {
+ switch(gsr_info.gpu_info.vendor) {
+ case gsr::GpuVendor::UNKNOWN: {
+ break;
+ }
+ case gsr::GpuVendor::AMD: {
+ theme.tint_color = mgl::Color(221, 0, 49);
+ break;
+ }
+ case gsr::GpuVendor::INTEL: {
+ theme.tint_color = mgl::Color(8, 109, 183);
+ break;
+ }
+ case gsr::GpuVendor::NVIDIA: {
+ theme.tint_color = mgl::Color(118, 185, 0);
+ break;
+ }
+ }
+ initialized = true;
+ }
+
+ const Theme& get_theme() {
+ assert(initialized);
+ return theme;
+ }
+} \ No newline at end of file