mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-08-19 04:49:47 -07:00
parent
7b0b3a1522
commit
3aefc16c57
4 changed files with 53 additions and 17 deletions
|
@ -1738,6 +1738,19 @@ window.addEventListener("load", () => {
|
|||
window.qBittorrent.Cache.preferences.init();
|
||||
window.qBittorrent.Cache.qbtVersion.init();
|
||||
|
||||
// Setup color scheme switching
|
||||
const colorSchemeQuery = window.matchMedia("(prefers-color-scheme: dark)");
|
||||
const updateColorScheme = () => {
|
||||
const root = document.documentElement;
|
||||
const colorScheme = LocalPreferences.get("color_scheme");
|
||||
const validScheme = (colorScheme === "light") || (colorScheme === "dark");
|
||||
const isDark = colorSchemeQuery.matches;
|
||||
root.classList.toggle("dark", ((!validScheme && isDark) || (colorScheme === "dark")));
|
||||
};
|
||||
|
||||
colorSchemeQuery.addEventListener("change", updateColorScheme);
|
||||
updateColorScheme();
|
||||
|
||||
// switch to previously used tab
|
||||
const previouslyUsedTab = LocalPreferences.get("selected_window_tab", "transfers");
|
||||
switch (previouslyUsedTab) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue