Skip to content

Commit 18308bc

Browse files
committed
feat: wire detector verification UI, about page, and auto theme
1 parent 2abbae7 commit 18308bc

4 files changed

Lines changed: 200 additions & 384 deletions

File tree

src/main.cpp

Lines changed: 39 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,45 @@
1-
#include <QApplication>\n#include <QQmlApplicationEngine>\n#include <QQmlContext>\n#include <QIcon>
1+
#include <QApplication>
2+
#include <QIcon>
3+
#include <QQmlApplicationEngine>
4+
#include <QQmlContext>
25

36
#include "backend/nvidia/detector.h"
47
#include "backend/nvidia/installer.h"
58
#include "backend/nvidia/updater.h"
69

7-
int main(int argc, char *argv[])
8-
{
9-
// QApplication: Widgets backend (pencere, sistem tray vb.) için gerekli
10-
QApplication app(argc, argv);
11-
12-
// Uygulama meta bilgileri — Q_PROPERTY ve sistem entegrasyonunda kullanılır
13-
app.setApplicationName("ro-control");
14-
app.setApplicationDisplayName("ro-Control");
15-
app.setApplicationVersion("0.1.0");
16-
app.setOrganizationName("Acik-Kaynak-Gelistirme-Toplulugu");
17-
app.setOrganizationDomain("github.com/Acik-Kaynak-Gelistirme-Toplulugu");
18-
app.setWindowIcon(QIcon::fromTheme("ro-control"));
19-
20-
// Backend nesneleri
21-
NvidiaDetector detector;
22-
NvidiaInstaller installer;
23-
NvidiaUpdater updater;
24-
25-
// QML motorunu başlat
26-
QQmlApplicationEngine engine;
27-
28-
// Backend'i QML'e aç
29-
engine.rootContext()->setContextProperty("nvidiaDetector", &detector);
30-
engine.rootContext()->setContextProperty("nvidiaInstaller", &installer);
31-
engine.rootContext()->setContextProperty("nvidiaUpdater", &updater);
32-
33-
// Ana QML dosyasını yükle
34-
using namespace Qt::StringLiterals;
35-
const QUrl url(u"qrc:/rocontrol/src/qml/Main.qml"_s);
36-
37-
// QML yüklenemezse uygulamayı kapat
38-
QObject::connect(
39-
&engine,
40-
&QQmlApplicationEngine::objectCreationFailed,
41-
&app,
42-
[]() { QCoreApplication::exit(-1); },
43-
Qt::QueuedConnection
44-
);
45-
46-
engine.load(url);
47-
48-
return app.exec();
10+
int main(int argc, char *argv[]) {
11+
// QApplication: Widgets backend (pencere, sistem tray vb.) için gerekli
12+
QApplication app(argc, argv);
13+
14+
// Uygulama meta bilgileri — Q_PROPERTY ve sistem entegrasyonunda kullanılır
15+
app.setApplicationName("ro-control");
16+
app.setApplicationDisplayName("ro-Control");
17+
app.setApplicationVersion("0.1.0");
18+
app.setOrganizationName("Acik-Kaynak-Gelistirme-Toplulugu");
19+
app.setOrganizationDomain("github.com/Acik-Kaynak-Gelistirme-Toplulugu");
20+
app.setWindowIcon(QIcon::fromTheme("ro-control"));
21+
22+
NvidiaDetector detector;
23+
NvidiaInstaller installer;
24+
NvidiaUpdater updater;
25+
26+
// QML motorunu başlat
27+
QQmlApplicationEngine engine;
28+
29+
engine.rootContext()->setContextProperty("nvidiaDetector", &detector);
30+
engine.rootContext()->setContextProperty("nvidiaInstaller", &installer);
31+
engine.rootContext()->setContextProperty("nvidiaUpdater", &updater);
32+
33+
// Ana QML dosyasını yükle
34+
using namespace Qt::StringLiterals;
35+
const QUrl url(u"qrc:/rocontrol/src/qml/Main.qml"_s);
36+
37+
// QML yüklenemezse uygulamayı kapat
38+
QObject::connect(
39+
&engine, &QQmlApplicationEngine::objectCreationFailed, &app,
40+
[]() { QCoreApplication::exit(-1); }, Qt::QueuedConnection);
41+
42+
engine.load(url);
43+
44+
return app.exec();
4945
}

src/qml/Main.qml

Lines changed: 54 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,30 +5,70 @@ import QtQuick.Layouts
55
ApplicationWindow {
66
id: root
77
visible: true
8-
width: 1000
9-
height: 650
10-
minimumWidth: 800
11-
minimumHeight: 500
8+
width: 980
9+
height: 640
1210
title: "ro-Control"
13-
color: "#11111b"
1411

15-
Row {
12+
readonly property bool darkMode: Qt.styleHints.colorScheme === Qt.Dark
13+
color: darkMode ? "#141822" : "#f3f5fa"
14+
15+
ColumnLayout {
1616
anchors.fill: parent
17+
spacing: 0
18+
19+
ToolBar {
20+
Layout.fillWidth: true
21+
background: Rectangle {
22+
color: root.darkMode ? "#1b2130" : "#ffffff"
23+
}
24+
25+
RowLayout {
26+
anchors.fill: parent
27+
anchors.margins: 8
28+
29+
Label {
30+
text: "ro-Control"
31+
font.pixelSize: 20
32+
font.bold: true
33+
color: root.darkMode ? "#e9eefc" : "#101520"
34+
}
35+
36+
Item {
37+
Layout.fillWidth: true
38+
}
39+
40+
Label {
41+
text: root.darkMode ? "Tema: Sistem (Koyu)" : "Tema: Sistem (Acik)"
42+
color: root.darkMode ? "#c9d1e8" : "#2b364b"
43+
}
44+
}
45+
}
46+
47+
TabBar {
48+
id: tabs
49+
Layout.fillWidth: true
1750

18-
SidebarMenu {
19-
id: sidebar
20-
height: parent.height
51+
TabButton {
52+
text: "Surucu"
53+
}
54+
TabButton {
55+
text: "Izleme"
56+
}
57+
TabButton {
58+
text: "Ayarlar"
59+
}
2160
}
2261

2362
StackLayout {
24-
id: stack
25-
width: parent.width - sidebar.width
26-
height: parent.height
27-
currentIndex: sidebar.currentIndex
63+
Layout.fillWidth: true
64+
Layout.fillHeight: true
65+
currentIndex: tabs.currentIndex
2866

2967
DriverPage {}
3068
MonitorPage {}
31-
SettingsPage {}
69+
SettingsPage {
70+
darkMode: root.darkMode
71+
}
3272
}
3373
}
3474
}

0 commit comments

Comments
 (0)