Fix theming on Windows

- Use Unix path separator
- Strip off UNC prefix when running under Bazel
This commit is contained in:
Damien Elmes 2022-09-28 15:12:14 +10:00
parent f72570c604
commit 6944210fbe

View file

@ -94,7 +94,11 @@ class ThemeManager:
filename = f"{name}-{'dark' if self.night_mode else 'light'}.svg"
return os.path.join(aqt_data_folder(), "qt", "icons", filename)
return (
os.path.join(aqt_data_folder(), "qt", "icons", filename)
.replace("\\\\?\\", "")
.replace("\\", "/")
)
def icon_from_resources(self, path: str | ColoredIcon) -> QIcon:
"Fetch icon from Qt resources."