mirror of
https://github.com/hyprwm/hyprsysteminfo.git
synced 2024-11-24 04:35:59 +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)
|
||||
|
||||
find_package(Qt6 6.5 REQUIRED COMPONENTS Quick QuickControls2)
|
||||
find_package(Qt6 6.5 REQUIRED COMPONENTS Widgets Quick QuickControls2)
|
||||
find_package(PkgConfig REQUIRED)
|
||||
set(CMAKE_CXX_STANDARD 23)
|
||||
|
||||
|
@ -41,7 +41,7 @@ qt_add_resources(hyprsysteminfo "resource"
|
|||
)
|
||||
|
||||
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)
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#include "qmlSources/SystemIconProvider.hpp"
|
||||
#include "qmlSources/SystemInternals.hpp"
|
||||
#include <QGuiApplication>
|
||||
#include <QApplication>
|
||||
#include <QQmlApplicationEngine>
|
||||
#include <QQmlContext>
|
||||
#include <QQuickStyle>
|
||||
|
@ -11,6 +11,7 @@
|
|||
|
||||
#include <hyprutils/string/VarList.hpp>
|
||||
#include <hyprutils/string/String.hpp>
|
||||
#include <qtenvironmentvariables.h>
|
||||
using namespace Hyprutils::String;
|
||||
|
||||
static std::string readFile(const std::string& filename) {
|
||||
|
@ -205,11 +206,12 @@ static void getSystemInfo(CSystemInternals* hsi, QGuiApplication* app) {
|
|||
}
|
||||
|
||||
int main(int argc, char* argv[]) {
|
||||
QGuiApplication app(argc, argv);
|
||||
QApplication app(argc, argv);
|
||||
|
||||
app.setApplicationName("Hyprland System Info");
|
||||
|
||||
QQuickStyle::setStyle("org.kde.desktop");
|
||||
if (qEnvironmentVariableIsEmpty("QT_QUICK_CONTROLS_STYLE"))
|
||||
QQuickStyle::setStyle("org.kde.desktop");
|
||||
|
||||
auto systemInternals = new CSystemInternals;
|
||||
|
||||
|
|
Loading…
Reference in a new issue