Skip to content

Commit e7e644e

Browse files
committed
refactor: simplify light theme shell and expert layout
1 parent fb6bf46 commit e7e644e

3 files changed

Lines changed: 26 additions & 282 deletions

File tree

src/qml/Main.qml

Lines changed: 4 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -11,45 +11,11 @@ ApplicationWindow {
1111
minimumHeight: 760
1212
title: qsTr("ro-Control")
1313

14-
readonly property string themeMode: uiPreferences.themeMode
15-
readonly property bool darkMode: themeMode === "dark"
16-
|| (themeMode === "system"
17-
&& Qt.styleHints.colorScheme === Qt.Dark)
14+
readonly property string themeMode: "light"
15+
readonly property bool darkMode: false
1816
readonly property bool compactMode: uiPreferences.compactMode
1917
readonly property bool showAdvancedInfo: uiPreferences.showAdvancedInfo
20-
readonly property var theme: darkMode ? ({
21-
window: "#0f141b",
22-
shell: "#121821",
23-
card: "#1b2432",
24-
cardStrong: "#212c3d",
25-
border: "#2a3647",
26-
text: "#e7edf6",
27-
textMuted: "#c8d0dd",
28-
textSoft: "#98a6bb",
29-
accentA: "#7b8fff",
30-
accentB: "#2ed0a0",
31-
accentC: "#ffb020",
32-
success: "#32d39c",
33-
warning: "#f0b540",
34-
danger: "#f06d6d",
35-
successBg: "#14392f",
36-
warningBg: "#332a17",
37-
dangerBg: "#391c22",
38-
infoBg: "#26364a",
39-
sidebarBg: "#11161d",
40-
sidebarText: "#eef2f8",
41-
sidebarMuted: "#95a4ba",
42-
sidebarAccent: "#90a1ff",
43-
sidebarActive: "#243146",
44-
sidebarHover: "#1a2330",
45-
sidebarBorder: "#273242",
46-
sidebarHint: "#77879d",
47-
topbarBg: "#1a2330",
48-
topbarChip: "#222d3d",
49-
topbarValue: "#eef2f8",
50-
contentBg: "#11161d",
51-
contentGlow: "#1a2431"
52-
}) : ({
18+
readonly property var theme: ({
5319
window: "#f3f6fb",
5420
shell: "#edf2f8",
5521
card: "#ffffff",
@@ -90,14 +56,6 @@ ApplicationWindow {
9056
return preferred && preferred.length > 0 ? preferred : fallback;
9157
}
9258

93-
function toggleThemeMode() {
94-
if (uiPreferences.themeMode === "dark") {
95-
uiPreferences.setThemeMode("light");
96-
} else {
97-
uiPreferences.setThemeMode("dark");
98-
}
99-
}
100-
10159
onLanguageDialogOpenChanged: {
10260
if (languageDialogOpen) {
10361
languagePopup.open();
@@ -184,29 +142,6 @@ ApplicationWindow {
184142
Layout.fillWidth: true
185143
}
186144

187-
Rectangle {
188-
width: 42
189-
height: 42
190-
radius: 21
191-
color: root.theme.cardStrong
192-
border.width: 1
193-
border.color: root.theme.border
194-
195-
Label {
196-
anchors.centerIn: parent
197-
text: "\u263e"
198-
color: root.theme.text
199-
font.pixelSize: 19
200-
font.weight: Font.Bold
201-
}
202-
203-
MouseArea {
204-
anchors.fill: parent
205-
cursorShape: Qt.PointingHandCursor
206-
onClicked: root.toggleThemeMode()
207-
}
208-
}
209-
210145
Rectangle {
211146
width: 42
212147
height: 42
@@ -255,7 +190,7 @@ ApplicationWindow {
255190
Rectangle {
256191
anchors.fill: parent
257192
color: "transparent"
258-
opacity: root.darkMode ? 0.22 : 1.0
193+
opacity: 1.0
259194
gradient: Gradient {
260195
orientation: Gradient.Horizontal
261196
GradientStop { position: 0.0; color: root.theme.contentGlow }

src/qml/pages/DriverPage.qml

Lines changed: 2 additions & 211 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ Item {
1717
property string operationDetail: ""
1818
property bool operationActive: false
1919
property double operationStartedAt: 0
20-
property double lastLogAt: 0
2120
property int operationElapsedSeconds: 0
2221
readonly property string nvidiaLicenseUrl: "https://www.nvidia.com/en-us/drivers/nvidia-license/"
2322
readonly property bool backendBusy: nvidiaInstaller.busy || nvidiaUpdater.busy
@@ -180,13 +179,6 @@ Item {
180179
return options;
181180
}
182181

183-
function appendLog(source, message) {
184-
const now = Date.now();
185-
lastLogAt = now;
186-
logArea.append("[" + formatTimestamp(now) + "] " + source + ": " + message);
187-
logArea.cursorPosition = logArea.length;
188-
}
189-
190182
Timer {
191183
interval: 1000
192184
repeat: true
@@ -336,11 +328,10 @@ Item {
336328
tone: "primary"
337329
text: page.driverInstalledLocally ? qsTr("Reinstall Recommended") : qsTr("Install Recommended")
338330
enabled: !page.backendBusy
339-
&& (!nvidiaInstaller.proprietaryAgreementRequired || eulaAccept.checked)
340331
&& (page.remoteDriverCatalogAvailable || page.driverInstalledLocally)
341332
onClicked: {
342333
page.setOperationState(qsTr("Installer"), qsTr("Installing the proprietary NVIDIA driver (akmod-nvidia)..."), "info", true);
343-
nvidiaInstaller.installProprietary(eulaAccept.checked);
334+
nvidiaInstaller.installProprietary(true);
344335
}
345336
}
346337

@@ -586,222 +577,24 @@ Item {
586577
}
587578
}
588579

589-
GridLayout {
590-
Layout.fillWidth: true
591-
Layout.maximumWidth: 1080
592-
Layout.alignment: Qt.AlignHCenter
593-
columns: width > 780 ? 2 : 1
594-
columnSpacing: 16
595-
rowSpacing: 16
596-
597-
SectionPanel {
598-
Layout.fillWidth: true
599-
theme: page.theme
600-
title: qsTr("Hardware Summary")
601-
subtitle: qsTr("Live system checks behind the guided install flow.")
602-
603-
Flow {
604-
Layout.fillWidth: true
605-
spacing: 8
606-
607-
InfoBadge {
608-
text: nvidiaDetector.gpuFound ? qsTr("GPU Ready") : qsTr("GPU Missing")
609-
backgroundColor: nvidiaDetector.gpuFound ? page.theme.successBg : page.theme.dangerBg
610-
foregroundColor: page.theme.text
611-
}
612-
613-
InfoBadge {
614-
text: nvidiaDetector.driverLoaded ? qsTr("Kernel Module Loaded") : qsTr("Kernel Module Missing")
615-
backgroundColor: nvidiaDetector.driverLoaded ? page.theme.successBg : page.theme.warningBg
616-
foregroundColor: page.theme.text
617-
}
618-
619-
InfoBadge {
620-
text: nvidiaDetector.waylandSession ? qsTr("Wayland Session") : qsTr("X11 / Other Session")
621-
backgroundColor: page.theme.infoBg
622-
foregroundColor: page.theme.text
623-
}
624-
625-
InfoBadge {
626-
text: nvidiaDetector.nouveauActive ? qsTr("Fallback Driver Active") : qsTr("Fallback Driver Inactive")
627-
backgroundColor: nvidiaDetector.nouveauActive ? page.theme.warningBg : page.theme.cardStrong
628-
foregroundColor: page.theme.text
629-
}
630-
}
631-
632-
Label {
633-
Layout.fillWidth: true
634-
wrapMode: Text.Wrap
635-
color: page.theme.textSoft
636-
text: qsTr("GPU: %1\nActive driver: %2\nInstalled version: %3")
637-
.arg(nvidiaDetector.gpuName.length > 0
638-
? nvidiaDetector.gpuName
639-
: (nvidiaDetector.displayAdapterName.length > 0
640-
? nvidiaDetector.displayAdapterName
641-
: qsTr("Unavailable")))
642-
.arg(nvidiaDetector.activeDriver.length > 0 ? nvidiaDetector.activeDriver : qsTr("Unknown"))
643-
.arg(page.installedVersionLabel.length > 0 ? page.installedVersionLabel : qsTr("None"))
644-
}
645-
646-
Rectangle {
647-
Layout.fillWidth: true
648-
color: page.theme.cardStrong
649-
border.width: 1
650-
border.color: page.theme.border
651-
radius: 16
652-
implicitHeight: verificationText.implicitHeight + 24
653-
visible: page.showAdvancedInfo
654-
655-
Label {
656-
id: verificationText
657-
x: 12
658-
y: 12
659-
width: parent.width - 24
660-
text: nvidiaDetector.verificationReport
661-
wrapMode: Text.Wrap
662-
color: page.theme.text
663-
}
664-
}
665-
}
666-
667-
SectionPanel {
668-
Layout.fillWidth: true
669-
theme: page.theme
670-
title: qsTr("Activity Log")
671-
subtitle: qsTr("Installer and updater output is streamed here in real time.")
672-
673-
Flow {
674-
Layout.fillWidth: true
675-
spacing: 8
676-
visible: page.operationDetail.length > 0
677-
678-
InfoBadge {
679-
text: qsTr("Source: ") + (page.operationSource.length > 0 ? page.operationSource : qsTr("Idle"))
680-
backgroundColor: page.theme.cardStrong
681-
foregroundColor: page.theme.text
682-
}
683-
684-
InfoBadge {
685-
text: qsTr("Phase: ") + (page.operationPhase.length > 0 ? page.operationPhase : qsTr("Idle"))
686-
backgroundColor: page.operationRunning ? page.theme.infoBg : page.theme.cardStrong
687-
foregroundColor: page.theme.text
688-
}
689-
690-
InfoBadge {
691-
text: qsTr("Elapsed: ") + page.formatDuration(page.operationElapsedSeconds)
692-
backgroundColor: page.theme.cardStrong
693-
foregroundColor: page.theme.text
694-
visible: page.operationRunning || page.operationElapsedSeconds > 0
695-
}
696-
697-
InfoBadge {
698-
text: qsTr("Last Log: ") + page.formatTimestamp(page.lastLogAt)
699-
backgroundColor: page.theme.cardStrong
700-
foregroundColor: page.theme.text
701-
visible: page.lastLogAt > 0
702-
}
703-
}
704-
705-
StatusBanner {
706-
Layout.fillWidth: true
707-
theme: page.theme
708-
tone: "warning"
709-
text: nvidiaInstaller.proprietaryAgreementRequired ? nvidiaInstaller.proprietaryAgreementText : ""
710-
}
711-
712-
CheckBox {
713-
id: eulaAccept
714-
visible: nvidiaInstaller.proprietaryAgreementRequired
715-
text: qsTr("I reviewed the NVIDIA license terms")
716-
}
717-
718-
Label {
719-
Layout.fillWidth: true
720-
visible: nvidiaInstaller.proprietaryAgreementRequired
721-
textFormat: Text.RichText
722-
wrapMode: Text.Wrap
723-
color: page.theme.textSoft
724-
text: qsTr("Official NVIDIA license: <a href=\"%1\">%1</a>").arg(page.nvidiaLicenseUrl)
725-
onLinkActivated: function(link) { Qt.openUrlExternally(link) }
726-
}
727-
728-
TextArea {
729-
id: logArea
730-
Layout.fillWidth: true
731-
Layout.preferredHeight: 220
732-
readOnly: true
733-
wrapMode: Text.Wrap
734-
color: page.theme.text
735-
selectedTextColor: "#ffffff"
736-
selectionColor: page.theme.accentA
737-
background: Rectangle {
738-
radius: 16
739-
color: page.theme.cardStrong
740-
border.width: 1
741-
border.color: page.theme.border
742-
}
743-
}
744-
745-
RowLayout {
746-
Layout.fillWidth: true
747-
748-
ActionButton {
749-
theme: page.theme
750-
text: qsTr("Check for Updates")
751-
enabled: !nvidiaUpdater.busy && !nvidiaInstaller.busy
752-
onClicked: {
753-
page.setOperationState(qsTr("Updater"), qsTr("Searching the online NVIDIA package catalog..."), "info", true);
754-
nvidiaUpdater.checkForUpdate();
755-
}
756-
}
757-
758-
ActionButton {
759-
theme: page.theme
760-
text: qsTr("Deep Clean")
761-
enabled: !nvidiaInstaller.busy
762-
onClicked: {
763-
page.setOperationState(qsTr("Installer"), qsTr("Cleaning legacy driver leftovers..."), "info", true);
764-
nvidiaInstaller.deepClean();
765-
}
766-
}
767-
768-
Item {
769-
Layout.fillWidth: true
770-
}
771-
772-
ActionButton {
773-
theme: page.theme
774-
text: qsTr("Clear Log")
775-
onClicked: {
776-
logArea.text = "";
777-
page.lastLogAt = 0;
778-
}
779-
}
780-
}
781-
}
782-
}
783580
}
784581
}
785582

786583
Connections {
787584
target: nvidiaInstaller
788585

789-
function onProgressMessage(message) {
790-
page.appendLog(qsTr("Installer"), message);
586+
function onProgressMessage(message) {
791587
page.setOperationState(qsTr("Installer"), message, "info", true);
792588
}
793589

794590
function onInstallFinished(success, message) {
795-
page.appendLog(qsTr("Installer"), message);
796591
page.finishOperation(qsTr("Installer"), success, message);
797592
nvidiaDetector.refresh();
798593
nvidiaUpdater.checkForUpdate();
799594
nvidiaInstaller.refreshProprietaryAgreement();
800-
eulaAccept.checked = false;
801595
}
802596

803597
function onRemoveFinished(success, message) {
804-
page.appendLog(qsTr("Installer"), message);
805598
page.finishOperation(qsTr("Installer"), success, message);
806599
nvidiaDetector.refresh();
807600
nvidiaUpdater.checkForUpdate();
@@ -813,12 +606,10 @@ Item {
813606
target: nvidiaUpdater
814607

815608
function onProgressMessage(message) {
816-
page.appendLog(qsTr("Updater"), message);
817609
page.setOperationState(qsTr("Updater"), message, "info", true);
818610
}
819611

820612
function onUpdateFinished(success, message) {
821-
page.appendLog(qsTr("Updater"), message);
822613
page.finishOperation(qsTr("Updater"), success, message);
823614
nvidiaDetector.refresh();
824615
nvidiaUpdater.checkForUpdate();

0 commit comments

Comments
 (0)