comparison src/main.cpp @ 5:51ae25154b70

Fix OS X support code
author Paper <mrpapersonic@gmail.com>
date Sat, 12 Aug 2023 13:10:34 -0400
parents 23d0d9319a00
children 1d82f6e04d7d
comparison
equal deleted inserted replaced
4:5af270662505 5:51ae25154b70
1 #include "window.h" 1 #include "window.h"
2 #include "config.h" 2 #include "config.h"
3 #include "anime.h" 3 #include "anime.h"
4 #if APPLE 4 #if MACOSX
5 #include "sys/osx/dark_theme.h" 5 #include "sys/osx/dark_theme.h"
6 #elif WIN32 6 #elif WIN32
7 #include "sys/win32/dark_theme.h" 7 #include "sys/win32/dark_theme.h"
8 #endif 8 #endif
9 9
136 } 136 }
137 137
138 void MainWindow::ThemeChanged() { 138 void MainWindow::ThemeChanged() {
139 switch (session.config.theme) { 139 switch (session.config.theme) {
140 case LIGHT: { 140 case LIGHT: {
141 #if APPLE 141 #if MACOSX
142 if (osx::DarkThemeAvailable()) 142 if (osx::DarkThemeAvailable())
143 osx::SetToLightTheme(); 143 osx::SetToLightTheme();
144 else 144 else
145 SetStyleSheet(LIGHT); 145 SetStyleSheet(LIGHT);
146 #else 146 #else
147 SetStyleSheet(LIGHT); 147 SetStyleSheet(LIGHT);
148 #endif 148 #endif
149 break; 149 break;
150 } 150 }
151 case DARK: { 151 case DARK: {
152 #if APPLE 152 #if MACOSX
153 if (osx::DarkThemeAvailable()) 153 if (osx::DarkThemeAvailable())
154 osx::SetToDarkTheme(); 154 osx::SetToDarkTheme();
155 else 155 else
156 SetStyleSheet(DARK); 156 SetStyleSheet(DARK);
157 #else 157 #else
158 SetStyleSheet(DARK); 158 SetStyleSheet(DARK);
159 #endif 159 #endif
160 break; 160 break;
161 } 161 }
162 case OS: { 162 case OS: {
163 #if APPLE 163 #if MACOSX
164 if (osx::DarkThemeAvailable()) 164 if (osx::DarkThemeAvailable())
165 osx::SetToAutoTheme(); 165 osx::SetToAutoTheme();
166 else 166 else
167 SetStyleSheet(LIGHT); 167 SetStyleSheet(LIGHT);
168 #elif defined(WIN32) 168 #elif defined(WIN32)