From aab803866ea4f96d3b0eae826247d7c7d74fc1ac Mon Sep 17 00:00:00 2001 From: crueter Date: Mon, 27 Oct 2025 15:47:57 -0400 Subject: [PATCH] fixed carboxyl impl Signed-off-by: crueter --- src/Eden/Config/GlobalConfigureDialog.qml | 9 +++-- src/Eden/Config/fields/BaseField.qml | 2 +- src/Eden/Config/fields/ConfigComboBox.qml | 14 ++++++- src/Eden/Config/pages/PageScrollView.qml | 2 + src/Eden/Config/pages/SettingsList.qml | 10 +++++ .../Config/pages/audio/AudioGeneralPage.qml | 6 +++ src/Eden/Config/pages/cpu/CpuGeneralPage.qml | 6 +++ .../Config/pages/debug/DebugAdvancedPage.qml | 5 +++ src/Eden/Config/pages/debug/DebugCpuPage.qml | 5 +++ .../Config/pages/debug/DebugGeneralPage.qml | 7 ++++ .../Config/pages/debug/DebugGraphicsPage.qml | 7 +++- .../Config/pages/general/UiGameListPage.qml | 5 +++ .../Config/pages/general/UiGeneralPage.qml | 37 +++++++++++++++++-- .../pages/graphics/RendererAdvancedPage.qml | 6 +++ .../pages/graphics/RendererExtensionsPage.qml | 5 +++ .../Config/pages/graphics/RendererPage.qml | 6 +++ src/Eden/Config/pages/system/AppletsPage.qml | 5 +++ .../Config/pages/system/FileSystemPage.qml | 6 +++ .../Config/pages/system/SystemCorePage.qml | 6 +++ .../Config/pages/system/SystemGeneralPage.qml | 8 ++++ src/Eden/Main/GameCarousel.qml | 4 +- src/Eden/Main/GameCarouselCard.qml | 2 +- src/Eden/Main/GameGrid.qml | 2 +- src/Eden/Main/GameGridCard.qml | 4 +- src/Eden/Main/GameList.qml | 28 +++++++------- src/Eden/Main/Main.qml | 8 ++++ src/Eden/Models/SettingsModel.cpp | 5 +++ src/Eden/Models/SettingsModel.h | 2 + src/Eden/Util/Util.qml | 2 + src/qt_common/config/qt_config.cpp | 2 +- src/qt_common/config/uisettings.h | 9 +++-- 31 files changed, 191 insertions(+), 34 deletions(-) diff --git a/src/Eden/Config/GlobalConfigureDialog.qml b/src/Eden/Config/GlobalConfigureDialog.qml index 64c074562e..026b033a77 100644 --- a/src/Eden/Config/GlobalConfigureDialog.qml +++ b/src/Eden/Config/GlobalConfigureDialog.qml @@ -22,18 +22,19 @@ Dialog { title: qsTr("Configuration") standardButtons: Dialog.Ok | Dialog.Cancel - Component.onCompleted: configs = Util.searchItem(swipe, "BaseField") + Component.onCompleted: configs = Util.searchItem(swipe, "PageScrollView") onAccepted: { - console.log("Accepted") configs.forEach(config => { config.apply() - console.log(config.setting.label) }) + + // console.log("Saving") QtConfig.save() } onRejected: { console.log("Rejected") - configs.forEach(config => config.sync()) + // TODO + // configs.forEach(config => config.sync()) // QtConfig.reload() } diff --git a/src/Eden/Config/fields/BaseField.qml b/src/Eden/Config/fields/BaseField.qml index 550deae535..39780a38f4 100644 --- a/src/Eden/Config/fields/BaseField.qml +++ b/src/Eden/Config/fields/BaseField.qml @@ -23,7 +23,7 @@ Item { Component.onCompleted: sync() function apply() { - console.log("Applying value", value, "to", setting.label) + // console.log("Applying value", value, "to", setting.label) if (setting.value !== value) { setting.value = value } diff --git a/src/Eden/Config/fields/ConfigComboBox.qml b/src/Eden/Config/fields/ConfigComboBox.qml index a030856c71..4fb4a47999 100644 --- a/src/Eden/Config/fields/ConfigComboBox.qml +++ b/src/Eden/Config/fields/ConfigComboBox.qml @@ -6,6 +6,8 @@ import Eden.Constants import Eden.Config BaseField { + id: field + contentItem: ComboBox { id: control enabled: enable @@ -15,6 +17,16 @@ BaseField { font.pixelSize: 14 model: setting.combo - currentIndex: value + + currentIndex: -1 + + // currentIndex: value + Component.onCompleted: { + currentIndex = setting.value === undefined ? 0 : setting.value + } + onCurrentIndexChanged: { + if (currentIndex !== undefined) + field.value = currentIndex + } } } diff --git a/src/Eden/Config/pages/PageScrollView.qml b/src/Eden/Config/pages/PageScrollView.qml index 22078b1105..7eadd040b6 100644 --- a/src/Eden/Config/pages/PageScrollView.qml +++ b/src/Eden/Config/pages/PageScrollView.qml @@ -5,6 +5,8 @@ import QtQuick.Layouts ScrollView { id: scroll + readonly property string typeName: "PageScrollView" + WheelHandler { target: scroll onWheel: event => { diff --git a/src/Eden/Config/pages/SettingsList.qml b/src/Eden/Config/pages/SettingsList.qml index 5370d45dc8..691f79d1b1 100644 --- a/src/Eden/Config/pages/SettingsList.qml +++ b/src/Eden/Config/pages/SettingsList.qml @@ -5,6 +5,8 @@ import Eden.Config import Eden.Interface ListView { + id: list + required property int category property bool inset: false @@ -12,6 +14,14 @@ ListView { property list idInclude: [] property list idExclude: [] + function apply() { + for (var i = 0; i < count; ++i) { + var itm = itemAtIndex(i) + if (itm !== null) + itm.apply() + } + } + clip: true boundsBehavior: Flickable.StopAtBounds diff --git a/src/Eden/Config/pages/audio/AudioGeneralPage.qml b/src/Eden/Config/pages/audio/AudioGeneralPage.qml index df4c279bb6..837193b265 100644 --- a/src/Eden/Config/pages/audio/AudioGeneralPage.qml +++ b/src/Eden/Config/pages/audio/AudioGeneralPage.qml @@ -7,10 +7,16 @@ import Eden.Config PageScrollView { id: scroll + + function apply() { + audio.apply() + } + ColumnLayout { width: scroll.width - scroll.effectiveScrollBarWidth SettingsList { + id: audio category: SettingsCategories.Audio } } diff --git a/src/Eden/Config/pages/cpu/CpuGeneralPage.qml b/src/Eden/Config/pages/cpu/CpuGeneralPage.qml index 6438e59a02..68e8ada5a0 100644 --- a/src/Eden/Config/pages/cpu/CpuGeneralPage.qml +++ b/src/Eden/Config/pages/cpu/CpuGeneralPage.qml @@ -7,10 +7,16 @@ import Eden.Config PageScrollView { id: scroll + + function apply() { + cpu.apply() + } + ColumnLayout { width: scroll.width - scroll.effectiveScrollBarWidth SettingsList { + id: cpu category: SettingsCategories.Cpu } } diff --git a/src/Eden/Config/pages/debug/DebugAdvancedPage.qml b/src/Eden/Config/pages/debug/DebugAdvancedPage.qml index 35a5a7bbc2..f2e16ebed9 100644 --- a/src/Eden/Config/pages/debug/DebugAdvancedPage.qml +++ b/src/Eden/Config/pages/debug/DebugAdvancedPage.qml @@ -8,11 +8,16 @@ import Eden.Config PageScrollView { id: scroll + function apply() { + debug.apply() + } + ColumnLayout { width: scroll.width - scroll.effectiveScrollBarWidth // TODO: filter SettingsList { + id: debug category: SettingsCategories.Debugging } } diff --git a/src/Eden/Config/pages/debug/DebugCpuPage.qml b/src/Eden/Config/pages/debug/DebugCpuPage.qml index 213720e4a6..7f64c2522a 100644 --- a/src/Eden/Config/pages/debug/DebugCpuPage.qml +++ b/src/Eden/Config/pages/debug/DebugCpuPage.qml @@ -8,10 +8,15 @@ import Eden.Config PageScrollView { id: scroll + function apply() { + cpu.apply() + } + ColumnLayout { width: scroll.width - scroll.effectiveScrollBarWidth SettingsList { + id: cpu category: SettingsCategories.CpuDebug } } diff --git a/src/Eden/Config/pages/debug/DebugGeneralPage.qml b/src/Eden/Config/pages/debug/DebugGeneralPage.qml index 16652e4a4d..d122525268 100644 --- a/src/Eden/Config/pages/debug/DebugGeneralPage.qml +++ b/src/Eden/Config/pages/debug/DebugGeneralPage.qml @@ -8,6 +8,11 @@ import Eden.Config PageScrollView { id: scroll + function apply() { + debug.apply() + misc.apply() + } + ColumnLayout { width: scroll.width - scroll.effectiveScrollBarWidth @@ -16,11 +21,13 @@ PageScrollView { // TODO: split SettingsList { + id: debug category: SettingsCategories.Debugging } // TODO: wrong category? SettingsList { + id: misc category: SettingsCategories.Miscellaneous } } diff --git a/src/Eden/Config/pages/debug/DebugGraphicsPage.qml b/src/Eden/Config/pages/debug/DebugGraphicsPage.qml index 9626a68683..1c132a421e 100644 --- a/src/Eden/Config/pages/debug/DebugGraphicsPage.qml +++ b/src/Eden/Config/pages/debug/DebugGraphicsPage.qml @@ -8,12 +8,15 @@ import Eden.Config PageScrollView { id: scroll + function apply() { + gfx.apply() + } + ColumnLayout { width: scroll.width - scroll.effectiveScrollBarWidth SettingsList { - Layout.fillWidth: true - + id: gfx category: SettingsCategories.DebuggingGraphics } } diff --git a/src/Eden/Config/pages/general/UiGameListPage.qml b/src/Eden/Config/pages/general/UiGameListPage.qml index db17fa9104..405a513f27 100644 --- a/src/Eden/Config/pages/general/UiGameListPage.qml +++ b/src/Eden/Config/pages/general/UiGameListPage.qml @@ -8,11 +8,16 @@ import Eden.Config PageScrollView { id: scroll + function apply() { + ui.apply() + } + // TODO: language, theme ColumnLayout { width: scroll.width - scroll.effectiveScrollBarWidth SettingsList { + id: ui category: SettingsCategories.UiGameList } } diff --git a/src/Eden/Config/pages/general/UiGeneralPage.qml b/src/Eden/Config/pages/general/UiGeneralPage.qml index 91feba70ed..3587ab5c0e 100644 --- a/src/Eden/Config/pages/general/UiGeneralPage.qml +++ b/src/Eden/Config/pages/general/UiGeneralPage.qml @@ -5,12 +5,28 @@ import QtQuick.Layouts import Eden.Interface import Eden.Config +import Carboxyl.Base + PageScrollView { id: scroll + function apply() { + ui.apply() + style.apply() + theme.apply() + accent.apply() + + Palettes.accent = Palettes.accents[accent.contentItem.currentIndex] + Palettes.theme = Palettes.themes[theme.contentItem.currentIndex] + + if (linux.visible) + linux.apply() + } + ColumnLayout { width: scroll.width - scroll.effectiveScrollBarWidth SettingsList { + id: ui category: SettingsCategories.UiGeneral } @@ -20,6 +36,7 @@ PageScrollView { } SettingsList { + id: linux category: SettingsCategories.Linux visible: Qt.platform.os === "linux" } @@ -28,8 +45,22 @@ PageScrollView { text: qsTr("Theming") } - // SettingsList { - // category: SettingsCategories.UiLayout - // } + ConfigComboBox { + Layout.fillWidth: true + id: style + setting: SettingsInterface.setting("carboxyl_style") + } + + ConfigComboBox { + Layout.fillWidth: true + id: theme + setting: SettingsInterface.setting("carboxyl_theme") + } + + ConfigComboBox { + Layout.fillWidth: true + id: accent + setting: SettingsInterface.setting("carboxyl_accent") + } } } diff --git a/src/Eden/Config/pages/graphics/RendererAdvancedPage.qml b/src/Eden/Config/pages/graphics/RendererAdvancedPage.qml index d27b30abd7..d3e79ab031 100644 --- a/src/Eden/Config/pages/graphics/RendererAdvancedPage.qml +++ b/src/Eden/Config/pages/graphics/RendererAdvancedPage.qml @@ -7,10 +7,16 @@ import Eden.Config PageScrollView { id: scroll + + function apply() { + gfx.apply() + } + ColumnLayout { width: scroll.width - scroll.effectiveScrollBarWidth SettingsList { + id: gfx category: SettingsCategories.RendererAdvanced } } diff --git a/src/Eden/Config/pages/graphics/RendererExtensionsPage.qml b/src/Eden/Config/pages/graphics/RendererExtensionsPage.qml index 1bb54b7bbd..8d09fcad8f 100644 --- a/src/Eden/Config/pages/graphics/RendererExtensionsPage.qml +++ b/src/Eden/Config/pages/graphics/RendererExtensionsPage.qml @@ -7,10 +7,15 @@ import Eden.Config PageScrollView { id: scroll + function apply() { + ext.apply() + } + ColumnLayout { width: scroll.width - scroll.effectiveScrollBarWidth SettingsList { + id: ext category: SettingsCategories.RendererExtensions } } diff --git a/src/Eden/Config/pages/graphics/RendererPage.qml b/src/Eden/Config/pages/graphics/RendererPage.qml index a5389ed16a..aaccc945f1 100644 --- a/src/Eden/Config/pages/graphics/RendererPage.qml +++ b/src/Eden/Config/pages/graphics/RendererPage.qml @@ -7,10 +7,16 @@ import Eden.Config PageScrollView { id: scroll + + function apply() { + gfx.apply() + } + ColumnLayout { width: scroll.width - scroll.effectiveScrollBarWidth SettingsList { + id: gfx category: SettingsCategories.Renderer } } diff --git a/src/Eden/Config/pages/system/AppletsPage.qml b/src/Eden/Config/pages/system/AppletsPage.qml index d0e477b773..7658438851 100644 --- a/src/Eden/Config/pages/system/AppletsPage.qml +++ b/src/Eden/Config/pages/system/AppletsPage.qml @@ -7,10 +7,15 @@ import Eden.Config PageScrollView { id: scroll + function apply() { + app.apply() + } + ColumnLayout { width: scroll.width - scroll.effectiveScrollBarWidth SettingsList { + id: app category: SettingsCategories.LibraryApplet } } diff --git a/src/Eden/Config/pages/system/FileSystemPage.qml b/src/Eden/Config/pages/system/FileSystemPage.qml index f9dfb9f917..56b97bf4de 100644 --- a/src/Eden/Config/pages/system/FileSystemPage.qml +++ b/src/Eden/Config/pages/system/FileSystemPage.qml @@ -7,10 +7,16 @@ import Eden.Config PageScrollView { id: scroll + + function apply() { + fs.apply() + } + ColumnLayout { width: scroll.width - scroll.effectiveScrollBarWidth SettingsList { + id: fs category: SettingsCategories.DataStorage } } diff --git a/src/Eden/Config/pages/system/SystemCorePage.qml b/src/Eden/Config/pages/system/SystemCorePage.qml index be822bf1a3..3682aaf407 100644 --- a/src/Eden/Config/pages/system/SystemCorePage.qml +++ b/src/Eden/Config/pages/system/SystemCorePage.qml @@ -7,10 +7,16 @@ import Eden.Config PageScrollView { id: scroll + + function apply() { + core.apply() + } + ColumnLayout { width: scroll.width - scroll.effectiveScrollBarWidth SettingsList { + id: core category: SettingsCategories.Core } } diff --git a/src/Eden/Config/pages/system/SystemGeneralPage.qml b/src/Eden/Config/pages/system/SystemGeneralPage.qml index 1f59b29e98..c275cb4f4f 100644 --- a/src/Eden/Config/pages/system/SystemGeneralPage.qml +++ b/src/Eden/Config/pages/system/SystemGeneralPage.qml @@ -7,14 +7,22 @@ import Eden.Config PageScrollView { id: scroll + + function apply() { + net.apply() + sys.apply() + } + ColumnLayout { width: scroll.width - scroll.effectiveScrollBarWidth SettingsList { + id: net category: SettingsCategories.Network } SettingsList { + id: sys category: SettingsCategories.System idExclude: ["custom_rtc", "custom_rtc_offset", "current_user"] } diff --git a/src/Eden/Main/GameCarousel.qml b/src/Eden/Main/GameCarousel.qml index 29bcb2df17..93c274ba5e 100644 --- a/src/Eden/Main/GameCarousel.qml +++ b/src/Eden/Main/GameCarousel.qml @@ -51,7 +51,7 @@ ListView { color: "transparent" border { - color: "deepskyblue" + color: palette.accent width: 4 } @@ -69,7 +69,7 @@ ListView { font.pixelSize: 22 font.family: "Monospace" - color: "lightblue" + color: palette.accent background: "transparent" } } diff --git a/src/Eden/Main/GameCarouselCard.qml b/src/Eden/Main/GameCarouselCard.qml index 3e630d4453..f4b293eff8 100644 --- a/src/Eden/Main/GameCarouselCard.qml +++ b/src/Eden/Main/GameCarouselCard.qml @@ -18,7 +18,7 @@ Item { color: "transparent" border { width: 4 - color: PathView.isCurrentItem ? "deepskyblue" : "transparent" + color: PathView.isCurrentItem ? palette.accent : "transparent" } Image { diff --git a/src/Eden/Main/GameGrid.qml b/src/Eden/Main/GameGrid.qml index 11c4336219..2f3c8a4e1c 100644 --- a/src/Eden/Main/GameGrid.qml +++ b/src/Eden/Main/GameGrid.qml @@ -44,7 +44,7 @@ GridView { radius: 16 border { - color: "deepskyblue" + color: palette.accent width: 4 } } diff --git a/src/Eden/Main/GameGridCard.qml b/src/Eden/Main/GameGridCard.qml index 3f2f03e032..4fe36d5441 100644 --- a/src/Eden/Main/GameGridCard.qml +++ b/src/Eden/Main/GameGridCard.qml @@ -5,6 +5,8 @@ import QtCore import Eden.Constants +import Carboxyl.Base + Rectangle { id: wrapper @@ -73,7 +75,7 @@ Rectangle { font.pixelSize: 18 font.family: "Monospace" - color: "lightblue" + color: palette.accent background: "transparent" canMarquee: wrapper.GridView.isCurrentItem diff --git a/src/Eden/Main/GameList.qml b/src/Eden/Main/GameList.qml index 5fb320bbc9..b1690ae98e 100644 --- a/src/Eden/Main/GameList.qml +++ b/src/Eden/Main/GameList.qml @@ -72,24 +72,24 @@ Rectangle { margins: 8 } - GameGrid { - setting: root.setting + // GameGrid { + // setting: root.setting - id: grid + // id: grid - anchors.fill: parent - } - // GameCarousel { - // id: carousel + // anchors.fill: parent + // } + GameCarousel { + id: carousel - // height: 300 + height: 300 - // anchors { - // right: view.right - // left: view.left + anchors { + right: view.right + left: view.left - // verticalCenter: view.verticalCenter - // } - // } + verticalCenter: view.verticalCenter + } + } } } diff --git a/src/Eden/Main/Main.qml b/src/Eden/Main/Main.qml index 988bbd40af..5fde154db0 100644 --- a/src/Eden/Main/Main.qml +++ b/src/Eden/Main/Main.qml @@ -15,6 +15,9 @@ ApplicationWindow { palette: Palettes.theme + property var theme: SettingsInterface.setting("carboxyl_theme") + property var accent: SettingsInterface.setting("carboxyl_accent") + GameList { anchors { top: parent.top @@ -24,6 +27,11 @@ ApplicationWindow { } } + Component.onCompleted: { + Palettes.theme = Palettes.themes[theme.value] + Palettes.accent = Palettes.accents[accent.value] + } + /** Dialogs */ GlobalConfigureDialog { id: globalConfig diff --git a/src/Eden/Models/SettingsModel.cpp b/src/Eden/Models/SettingsModel.cpp index a6a9d1bb62..6ccade42d7 100644 --- a/src/Eden/Models/SettingsModel.cpp +++ b/src/Eden/Models/SettingsModel.cpp @@ -72,6 +72,11 @@ void SettingsModel::append(QList settings) } } +QList SettingsModel::items() +{ + return m_data; +} + QHash SettingsModel::roleNames() const { QHash rez; diff --git a/src/Eden/Models/SettingsModel.h b/src/Eden/Models/SettingsModel.h index 215ce32b00..b039a282f2 100644 --- a/src/Eden/Models/SettingsModel.h +++ b/src/Eden/Models/SettingsModel.h @@ -32,6 +32,8 @@ public: void append(QMLSetting *setting); void append(QList settings); + Q_INVOKABLE QList items(); + protected: QHash roleNames() const override; diff --git a/src/Eden/Util/Util.qml b/src/Eden/Util/Util.qml index 03d2a09beb..d3c1dd07b1 100644 --- a/src/Eden/Util/Util.qml +++ b/src/Eden/Util/Util.qml @@ -3,6 +3,8 @@ pragma Singleton import QtQuick QtObject { + + /** * Recursively search an Item for children matching the specified type. * @return A list of found items. diff --git a/src/qt_common/config/qt_config.cpp b/src/qt_common/config/qt_config.cpp index 65bf488c5c..88c93cefbc 100644 --- a/src/qt_common/config/qt_config.cpp +++ b/src/qt_common/config/qt_config.cpp @@ -309,7 +309,7 @@ void QtConfig::ReadUIGamelistValues() { } void QtConfig::ReadUILayoutValues() { - BeginGroup(Settings::TranslateCategory(Settings::Category::UiGameList)); + BeginGroup(Settings::TranslateCategory(Settings::Category::UiLayout)); ReadCategory(Settings::Category::UiLayout); diff --git a/src/qt_common/config/uisettings.h b/src/qt_common/config/uisettings.h index d1a97966fb..0c2688f289 100644 --- a/src/qt_common/config/uisettings.h +++ b/src/qt_common/config/uisettings.h @@ -158,9 +158,12 @@ struct Values { #ifdef YUZU_QT_QML // TODO: native-like style default - Setting carboxyl_theme{linkage, Settings::Theme::System, "carboyl_theme", Category::UiLayout}; - Setting carboxyl_style{linkage, Settings::Style::Trioxide, "carboyl_style", Category::UiLayout}; - Setting carboxyl_accent{linkage, Settings::Accent::System, "carboyl_accent", Category::UiLayout}; + Setting carboxyl_theme{linkage, Settings::Theme::System , "carboxyl_theme", Category::UiLayout}; + Setting carboxyl_style{linkage, + Settings::Style::Trioxide, + "carboxyl_style", + Category::UiLayout}; + Setting carboxyl_accent{linkage, Settings::Accent::System , "carboxyl_accent", Category::UiLayout}; #endif // Discord RPC