Deskflow 1.22.0.197
Keyboard and mouse sharing utility
Loading...
Searching...
No Matches
StyleUtils.h
Go to the documentation of this file.
1/*
2 * Deskflow -- mouse and keyboard sharing utility
3 * SPDX-FileCopyrightText: (C) 2024 Symless Ltd.
4 * SPDX-License-Identifier: GPL-2.0-only WITH LicenseRef-OpenSSL-Exception
5 */
6
7#pragma once
8
9#include <QDir>
10#include <QFileInfoList>
11#include <QPalette>
12#include <QStyleHints>
13
14namespace deskflow::gui {
15
22inline bool isDarkMode()
23{
24 const QPalette defaultPalette;
25 const auto text = defaultPalette.color(QPalette::WindowText);
26 const auto window = defaultPalette.color(QPalette::Window);
27 return text.lightness() > window.lightness();
28}
29
33inline QString iconMode()
34{
35 return isDarkMode() ? QStringLiteral("dark") : QStringLiteral("light");
36}
37
38} // namespace deskflow::gui
Definition IServerConfig.h:14
QString iconMode()
get a string for the iconMode
Definition StyleUtils.h:33
bool isDarkMode()
Detects dark mode in a universal manner (all Qt versions). Until better platform support is added,...
Definition StyleUtils.h:22