mirror of
https://github.com/hyprwm/hyprsysteminfo.git
synced 2024-11-24 08:05:58 +01:00
core: use QApplication and respect user theme choice (#6)
Fixes qqc2-desktop-style usage
This commit is contained in:
parent
49f20fbcc5
commit
52a32d3afe
2 changed files with 7 additions and 5 deletions
|
@ -8,7 +8,7 @@ project(hsi VERSION ${VER} LANGUAGES CXX)
|
||||||
|
|
||||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||||
|
|
||||||
find_package(Qt6 6.5 REQUIRED COMPONENTS Quick QuickControls2)
|
find_package(Qt6 6.5 REQUIRED COMPONENTS Widgets Quick QuickControls2)
|
||||||
find_package(PkgConfig REQUIRED)
|
find_package(PkgConfig REQUIRED)
|
||||||
set(CMAKE_CXX_STANDARD 23)
|
set(CMAKE_CXX_STANDARD 23)
|
||||||
|
|
||||||
|
@ -41,7 +41,7 @@ qt_add_resources(hyprsysteminfo "resource"
|
||||||
)
|
)
|
||||||
|
|
||||||
target_link_libraries(hyprsysteminfo
|
target_link_libraries(hyprsysteminfo
|
||||||
PRIVATE Qt6::Quick Qt6::Gui Qt6::QuickControls2 PkgConfig::deps
|
PRIVATE Qt6::Widgets Qt6::Quick Qt6::Gui Qt6::QuickControls2 PkgConfig::deps
|
||||||
)
|
)
|
||||||
|
|
||||||
include(GNUInstallDirs)
|
include(GNUInstallDirs)
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#include "qmlSources/SystemIconProvider.hpp"
|
#include "qmlSources/SystemIconProvider.hpp"
|
||||||
#include "qmlSources/SystemInternals.hpp"
|
#include "qmlSources/SystemInternals.hpp"
|
||||||
#include <QGuiApplication>
|
#include <QApplication>
|
||||||
#include <QQmlApplicationEngine>
|
#include <QQmlApplicationEngine>
|
||||||
#include <QQmlContext>
|
#include <QQmlContext>
|
||||||
#include <QQuickStyle>
|
#include <QQuickStyle>
|
||||||
|
@ -11,6 +11,7 @@
|
||||||
|
|
||||||
#include <hyprutils/string/VarList.hpp>
|
#include <hyprutils/string/VarList.hpp>
|
||||||
#include <hyprutils/string/String.hpp>
|
#include <hyprutils/string/String.hpp>
|
||||||
|
#include <qtenvironmentvariables.h>
|
||||||
using namespace Hyprutils::String;
|
using namespace Hyprutils::String;
|
||||||
|
|
||||||
static std::string readFile(const std::string& filename) {
|
static std::string readFile(const std::string& filename) {
|
||||||
|
@ -205,10 +206,11 @@ static void getSystemInfo(CSystemInternals* hsi, QGuiApplication* app) {
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(int argc, char* argv[]) {
|
int main(int argc, char* argv[]) {
|
||||||
QGuiApplication app(argc, argv);
|
QApplication app(argc, argv);
|
||||||
|
|
||||||
app.setApplicationName("Hyprland System Info");
|
app.setApplicationName("Hyprland System Info");
|
||||||
|
|
||||||
|
if (qEnvironmentVariableIsEmpty("QT_QUICK_CONTROLS_STYLE"))
|
||||||
QQuickStyle::setStyle("org.kde.desktop");
|
QQuickStyle::setStyle("org.kde.desktop");
|
||||||
|
|
||||||
auto systemInternals = new CSystemInternals;
|
auto systemInternals = new CSystemInternals;
|
||||||
|
|
Loading…
Reference in a new issue