From 7957365c1eb47ac5d1483756d255b3ab2b3ec945 Mon Sep 17 00:00:00 2001 From: uncor3 Date: Fri, 20 Mar 2026 03:07:10 +0000 Subject: [PATCH] refactor: move isDarkMode helper function --- src/core/helpers/is_dark_mode.cpp | 35 ------------------------------- 1 file changed, 35 deletions(-) delete mode 100644 src/core/helpers/is_dark_mode.cpp diff --git a/src/core/helpers/is_dark_mode.cpp b/src/core/helpers/is_dark_mode.cpp deleted file mode 100644 index 89bd24e..0000000 --- a/src/core/helpers/is_dark_mode.cpp +++ /dev/null @@ -1,35 +0,0 @@ -/* - * iDescriptor: A free and open-source idevice management tool. - * - * Copyright (C) 2025 Uncore - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published - * by the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -#include -#include -#include - -bool isDarkMode() -{ -#if QT_VERSION >= QT_VERSION_CHECK(6, 5, 0) - const auto scheme = QGuiApplication::styleHints()->colorScheme(); - return scheme == Qt::ColorScheme::Dark; -#else - const QPalette defaultPalette; - const auto text = defaultPalette.color(QPalette::WindowText); - const auto window = defaultPalette.color(QPalette::Window); - return text.lightness() > window.lightness(); -#endif // QT_VERSION -} \ No newline at end of file