Browse Source

fixed carboxyl impl

Signed-off-by: crueter <crueter@eden-emu.dev>
pull/3016/head
crueter 2 months ago
parent
commit
aab803866e
No known key found for this signature in database GPG Key ID: 425ACD2D4830EBC6
  1. 9
      src/Eden/Config/GlobalConfigureDialog.qml
  2. 2
      src/Eden/Config/fields/BaseField.qml
  3. 14
      src/Eden/Config/fields/ConfigComboBox.qml
  4. 2
      src/Eden/Config/pages/PageScrollView.qml
  5. 10
      src/Eden/Config/pages/SettingsList.qml
  6. 6
      src/Eden/Config/pages/audio/AudioGeneralPage.qml
  7. 6
      src/Eden/Config/pages/cpu/CpuGeneralPage.qml
  8. 5
      src/Eden/Config/pages/debug/DebugAdvancedPage.qml
  9. 5
      src/Eden/Config/pages/debug/DebugCpuPage.qml
  10. 7
      src/Eden/Config/pages/debug/DebugGeneralPage.qml
  11. 7
      src/Eden/Config/pages/debug/DebugGraphicsPage.qml
  12. 5
      src/Eden/Config/pages/general/UiGameListPage.qml
  13. 37
      src/Eden/Config/pages/general/UiGeneralPage.qml
  14. 6
      src/Eden/Config/pages/graphics/RendererAdvancedPage.qml
  15. 5
      src/Eden/Config/pages/graphics/RendererExtensionsPage.qml
  16. 6
      src/Eden/Config/pages/graphics/RendererPage.qml
  17. 5
      src/Eden/Config/pages/system/AppletsPage.qml
  18. 6
      src/Eden/Config/pages/system/FileSystemPage.qml
  19. 6
      src/Eden/Config/pages/system/SystemCorePage.qml
  20. 8
      src/Eden/Config/pages/system/SystemGeneralPage.qml
  21. 4
      src/Eden/Main/GameCarousel.qml
  22. 2
      src/Eden/Main/GameCarouselCard.qml
  23. 2
      src/Eden/Main/GameGrid.qml
  24. 4
      src/Eden/Main/GameGridCard.qml
  25. 28
      src/Eden/Main/GameList.qml
  26. 8
      src/Eden/Main/Main.qml
  27. 5
      src/Eden/Models/SettingsModel.cpp
  28. 2
      src/Eden/Models/SettingsModel.h
  29. 2
      src/Eden/Util/Util.qml
  30. 2
      src/qt_common/config/qt_config.cpp
  31. 9
      src/qt_common/config/uisettings.h

9
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()
}

2
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
}

14
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
}
}
}

2
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 => {

10
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<string> idInclude: []
property list<string> idExclude: []
function apply() {
for (var i = 0; i < count; ++i) {
var itm = itemAtIndex(i)
if (itm !== null)
itm.apply()
}
}
clip: true
boundsBehavior: Flickable.StopAtBounds

6
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
}
}

6
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
}
}

5
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
}
}

5
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
}
}

7
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
}
}

7
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
}
}

5
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
}
}

37
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")
}
}
}

6
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
}
}

5
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
}
}

6
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
}
}

5
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
}
}

6
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
}
}

6
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
}
}

8
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"]
}

4
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"
}
}

2
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 {

2
src/Eden/Main/GameGrid.qml

@ -44,7 +44,7 @@ GridView {
radius: 16
border {
color: "deepskyblue"
color: palette.accent
width: 4
}
}

4
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

28
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
}
}
}
}

8
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

5
src/Eden/Models/SettingsModel.cpp

@ -72,6 +72,11 @@ void SettingsModel::append(QList<QMLSetting *> settings)
}
}
QList<QMLSetting *> SettingsModel::items()
{
return m_data;
}
QHash<int, QByteArray> SettingsModel::roleNames() const
{
QHash<int,QByteArray> rez;

2
src/Eden/Models/SettingsModel.h

@ -32,6 +32,8 @@ public:
void append(QMLSetting *setting);
void append(QList<QMLSetting *> settings);
Q_INVOKABLE QList<QMLSetting *> items();
protected:
QHash<int, QByteArray> roleNames() const override;

2
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.

2
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);

9
src/qt_common/config/uisettings.h

@ -158,9 +158,12 @@ struct Values {
#ifdef YUZU_QT_QML
// TODO: native-like style default
Setting<Settings::Theme> carboxyl_theme{linkage, Settings::Theme::System, "carboyl_theme", Category::UiLayout};
Setting<Settings::Style> carboxyl_style{linkage, Settings::Style::Trioxide, "carboyl_style", Category::UiLayout};
Setting<Settings::Accent> carboxyl_accent{linkage, Settings::Accent::System, "carboyl_accent", Category::UiLayout};
Setting<Settings::Theme> carboxyl_theme{linkage, Settings::Theme::System , "carboxyl_theme", Category::UiLayout};
Setting<Settings::Style> carboxyl_style{linkage,
Settings::Style::Trioxide,
"carboxyl_style",
Category::UiLayout};
Setting<Settings::Accent> carboxyl_accent{linkage, Settings::Accent::System , "carboxyl_accent", Category::UiLayout};
#endif
// Discord RPC

Loading…
Cancel
Save