Browse Source

fixed carboxyl impl

Signed-off-by: crueter <crueter@eden-emu.dev>
crueter 4 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") title: qsTr("Configuration")
standardButtons: Dialog.Ok | Dialog.Cancel standardButtons: Dialog.Ok | Dialog.Cancel
Component.onCompleted: configs = Util.searchItem(swipe, "BaseField")
Component.onCompleted: configs = Util.searchItem(swipe, "PageScrollView")
onAccepted: { onAccepted: {
console.log("Accepted")
configs.forEach(config => { configs.forEach(config => {
config.apply() config.apply()
console.log(config.setting.label)
}) })
// console.log("Saving")
QtConfig.save() QtConfig.save()
} }
onRejected: { onRejected: {
console.log("Rejected") console.log("Rejected")
configs.forEach(config => config.sync())
// TODO
// configs.forEach(config => config.sync())
// QtConfig.reload() // QtConfig.reload()
} }

2
src/Eden/Config/fields/BaseField.qml

@ -23,7 +23,7 @@ Item {
Component.onCompleted: sync() Component.onCompleted: sync()
function apply() { function apply() {
console.log("Applying value", value, "to", setting.label)
// console.log("Applying value", value, "to", setting.label)
if (setting.value !== value) { if (setting.value !== value) {
setting.value = value setting.value = value
} }

14
src/Eden/Config/fields/ConfigComboBox.qml

@ -6,6 +6,8 @@ import Eden.Constants
import Eden.Config import Eden.Config
BaseField { BaseField {
id: field
contentItem: ComboBox { contentItem: ComboBox {
id: control id: control
enabled: enable enabled: enable
@ -15,6 +17,16 @@ BaseField {
font.pixelSize: 14 font.pixelSize: 14
model: setting.combo 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 { ScrollView {
id: scroll id: scroll
readonly property string typeName: "PageScrollView"
WheelHandler { WheelHandler {
target: scroll target: scroll
onWheel: event => { onWheel: event => {

10
src/Eden/Config/pages/SettingsList.qml

@ -5,6 +5,8 @@ import Eden.Config
import Eden.Interface import Eden.Interface
ListView { ListView {
id: list
required property int category required property int category
property bool inset: false property bool inset: false
@ -12,6 +14,14 @@ ListView {
property list<string> idInclude: [] property list<string> idInclude: []
property list<string> idExclude: [] property list<string> idExclude: []
function apply() {
for (var i = 0; i < count; ++i) {
var itm = itemAtIndex(i)
if (itm !== null)
itm.apply()
}
}
clip: true clip: true
boundsBehavior: Flickable.StopAtBounds boundsBehavior: Flickable.StopAtBounds

6
src/Eden/Config/pages/audio/AudioGeneralPage.qml

@ -7,10 +7,16 @@ import Eden.Config
PageScrollView { PageScrollView {
id: scroll id: scroll
function apply() {
audio.apply()
}
ColumnLayout { ColumnLayout {
width: scroll.width - scroll.effectiveScrollBarWidth width: scroll.width - scroll.effectiveScrollBarWidth
SettingsList { SettingsList {
id: audio
category: SettingsCategories.Audio category: SettingsCategories.Audio
} }
} }

6
src/Eden/Config/pages/cpu/CpuGeneralPage.qml

@ -7,10 +7,16 @@ import Eden.Config
PageScrollView { PageScrollView {
id: scroll id: scroll
function apply() {
cpu.apply()
}
ColumnLayout { ColumnLayout {
width: scroll.width - scroll.effectiveScrollBarWidth width: scroll.width - scroll.effectiveScrollBarWidth
SettingsList { SettingsList {
id: cpu
category: SettingsCategories.Cpu category: SettingsCategories.Cpu
} }
} }

5
src/Eden/Config/pages/debug/DebugAdvancedPage.qml

@ -8,11 +8,16 @@ import Eden.Config
PageScrollView { PageScrollView {
id: scroll id: scroll
function apply() {
debug.apply()
}
ColumnLayout { ColumnLayout {
width: scroll.width - scroll.effectiveScrollBarWidth width: scroll.width - scroll.effectiveScrollBarWidth
// TODO: filter // TODO: filter
SettingsList { SettingsList {
id: debug
category: SettingsCategories.Debugging category: SettingsCategories.Debugging
} }
} }

5
src/Eden/Config/pages/debug/DebugCpuPage.qml

@ -8,10 +8,15 @@ import Eden.Config
PageScrollView { PageScrollView {
id: scroll id: scroll
function apply() {
cpu.apply()
}
ColumnLayout { ColumnLayout {
width: scroll.width - scroll.effectiveScrollBarWidth width: scroll.width - scroll.effectiveScrollBarWidth
SettingsList { SettingsList {
id: cpu
category: SettingsCategories.CpuDebug category: SettingsCategories.CpuDebug
} }
} }

7
src/Eden/Config/pages/debug/DebugGeneralPage.qml

@ -8,6 +8,11 @@ import Eden.Config
PageScrollView { PageScrollView {
id: scroll id: scroll
function apply() {
debug.apply()
misc.apply()
}
ColumnLayout { ColumnLayout {
width: scroll.width - scroll.effectiveScrollBarWidth width: scroll.width - scroll.effectiveScrollBarWidth
@ -16,11 +21,13 @@ PageScrollView {
// TODO: split // TODO: split
SettingsList { SettingsList {
id: debug
category: SettingsCategories.Debugging category: SettingsCategories.Debugging
} }
// TODO: wrong category? // TODO: wrong category?
SettingsList { SettingsList {
id: misc
category: SettingsCategories.Miscellaneous category: SettingsCategories.Miscellaneous
} }
} }

7
src/Eden/Config/pages/debug/DebugGraphicsPage.qml

@ -8,12 +8,15 @@ import Eden.Config
PageScrollView { PageScrollView {
id: scroll id: scroll
function apply() {
gfx.apply()
}
ColumnLayout { ColumnLayout {
width: scroll.width - scroll.effectiveScrollBarWidth width: scroll.width - scroll.effectiveScrollBarWidth
SettingsList { SettingsList {
Layout.fillWidth: true
id: gfx
category: SettingsCategories.DebuggingGraphics category: SettingsCategories.DebuggingGraphics
} }
} }

5
src/Eden/Config/pages/general/UiGameListPage.qml

@ -8,11 +8,16 @@ import Eden.Config
PageScrollView { PageScrollView {
id: scroll id: scroll
function apply() {
ui.apply()
}
// TODO: language, theme // TODO: language, theme
ColumnLayout { ColumnLayout {
width: scroll.width - scroll.effectiveScrollBarWidth width: scroll.width - scroll.effectiveScrollBarWidth
SettingsList { SettingsList {
id: ui
category: SettingsCategories.UiGameList category: SettingsCategories.UiGameList
} }
} }

37
src/Eden/Config/pages/general/UiGeneralPage.qml

@ -5,12 +5,28 @@ import QtQuick.Layouts
import Eden.Interface import Eden.Interface
import Eden.Config import Eden.Config
import Carboxyl.Base
PageScrollView { PageScrollView {
id: scroll 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 { ColumnLayout {
width: scroll.width - scroll.effectiveScrollBarWidth width: scroll.width - scroll.effectiveScrollBarWidth
SettingsList { SettingsList {
id: ui
category: SettingsCategories.UiGeneral category: SettingsCategories.UiGeneral
} }
@ -20,6 +36,7 @@ PageScrollView {
} }
SettingsList { SettingsList {
id: linux
category: SettingsCategories.Linux category: SettingsCategories.Linux
visible: Qt.platform.os === "linux" visible: Qt.platform.os === "linux"
} }
@ -28,8 +45,22 @@ PageScrollView {
text: qsTr("Theming") 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 { PageScrollView {
id: scroll id: scroll
function apply() {
gfx.apply()
}
ColumnLayout { ColumnLayout {
width: scroll.width - scroll.effectiveScrollBarWidth width: scroll.width - scroll.effectiveScrollBarWidth
SettingsList { SettingsList {
id: gfx
category: SettingsCategories.RendererAdvanced category: SettingsCategories.RendererAdvanced
} }
} }

5
src/Eden/Config/pages/graphics/RendererExtensionsPage.qml

@ -7,10 +7,15 @@ import Eden.Config
PageScrollView { PageScrollView {
id: scroll id: scroll
function apply() {
ext.apply()
}
ColumnLayout { ColumnLayout {
width: scroll.width - scroll.effectiveScrollBarWidth width: scroll.width - scroll.effectiveScrollBarWidth
SettingsList { SettingsList {
id: ext
category: SettingsCategories.RendererExtensions category: SettingsCategories.RendererExtensions
} }
} }

6
src/Eden/Config/pages/graphics/RendererPage.qml

@ -7,10 +7,16 @@ import Eden.Config
PageScrollView { PageScrollView {
id: scroll id: scroll
function apply() {
gfx.apply()
}
ColumnLayout { ColumnLayout {
width: scroll.width - scroll.effectiveScrollBarWidth width: scroll.width - scroll.effectiveScrollBarWidth
SettingsList { SettingsList {
id: gfx
category: SettingsCategories.Renderer category: SettingsCategories.Renderer
} }
} }

5
src/Eden/Config/pages/system/AppletsPage.qml

@ -7,10 +7,15 @@ import Eden.Config
PageScrollView { PageScrollView {
id: scroll id: scroll
function apply() {
app.apply()
}
ColumnLayout { ColumnLayout {
width: scroll.width - scroll.effectiveScrollBarWidth width: scroll.width - scroll.effectiveScrollBarWidth
SettingsList { SettingsList {
id: app
category: SettingsCategories.LibraryApplet category: SettingsCategories.LibraryApplet
} }
} }

6
src/Eden/Config/pages/system/FileSystemPage.qml

@ -7,10 +7,16 @@ import Eden.Config
PageScrollView { PageScrollView {
id: scroll id: scroll
function apply() {
fs.apply()
}
ColumnLayout { ColumnLayout {
width: scroll.width - scroll.effectiveScrollBarWidth width: scroll.width - scroll.effectiveScrollBarWidth
SettingsList { SettingsList {
id: fs
category: SettingsCategories.DataStorage category: SettingsCategories.DataStorage
} }
} }

6
src/Eden/Config/pages/system/SystemCorePage.qml

@ -7,10 +7,16 @@ import Eden.Config
PageScrollView { PageScrollView {
id: scroll id: scroll
function apply() {
core.apply()
}
ColumnLayout { ColumnLayout {
width: scroll.width - scroll.effectiveScrollBarWidth width: scroll.width - scroll.effectiveScrollBarWidth
SettingsList { SettingsList {
id: core
category: SettingsCategories.Core category: SettingsCategories.Core
} }
} }

8
src/Eden/Config/pages/system/SystemGeneralPage.qml

@ -7,14 +7,22 @@ import Eden.Config
PageScrollView { PageScrollView {
id: scroll id: scroll
function apply() {
net.apply()
sys.apply()
}
ColumnLayout { ColumnLayout {
width: scroll.width - scroll.effectiveScrollBarWidth width: scroll.width - scroll.effectiveScrollBarWidth
SettingsList { SettingsList {
id: net
category: SettingsCategories.Network category: SettingsCategories.Network
} }
SettingsList { SettingsList {
id: sys
category: SettingsCategories.System category: SettingsCategories.System
idExclude: ["custom_rtc", "custom_rtc_offset", "current_user"] idExclude: ["custom_rtc", "custom_rtc_offset", "current_user"]
} }

4
src/Eden/Main/GameCarousel.qml

@ -51,7 +51,7 @@ ListView {
color: "transparent" color: "transparent"
border { border {
color: "deepskyblue"
color: palette.accent
width: 4 width: 4
} }
@ -69,7 +69,7 @@ ListView {
font.pixelSize: 22 font.pixelSize: 22
font.family: "Monospace" font.family: "Monospace"
color: "lightblue"
color: palette.accent
background: "transparent" background: "transparent"
} }
} }

2
src/Eden/Main/GameCarouselCard.qml

@ -18,7 +18,7 @@ Item {
color: "transparent" color: "transparent"
border { border {
width: 4 width: 4
color: PathView.isCurrentItem ? "deepskyblue" : "transparent"
color: PathView.isCurrentItem ? palette.accent : "transparent"
} }
Image { Image {

2
src/Eden/Main/GameGrid.qml

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

4
src/Eden/Main/GameGridCard.qml

@ -5,6 +5,8 @@ import QtCore
import Eden.Constants import Eden.Constants
import Carboxyl.Base
Rectangle { Rectangle {
id: wrapper id: wrapper
@ -73,7 +75,7 @@ Rectangle {
font.pixelSize: 18 font.pixelSize: 18
font.family: "Monospace" font.family: "Monospace"
color: "lightblue"
color: palette.accent
background: "transparent" background: "transparent"
canMarquee: wrapper.GridView.isCurrentItem canMarquee: wrapper.GridView.isCurrentItem

28
src/Eden/Main/GameList.qml

@ -72,24 +72,24 @@ Rectangle {
margins: 8 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 palette: Palettes.theme
property var theme: SettingsInterface.setting("carboxyl_theme")
property var accent: SettingsInterface.setting("carboxyl_accent")
GameList { GameList {
anchors { anchors {
top: parent.top top: parent.top
@ -24,6 +27,11 @@ ApplicationWindow {
} }
} }
Component.onCompleted: {
Palettes.theme = Palettes.themes[theme.value]
Palettes.accent = Palettes.accents[accent.value]
}
/** Dialogs */ /** Dialogs */
GlobalConfigureDialog { GlobalConfigureDialog {
id: globalConfig 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> SettingsModel::roleNames() const
{ {
QHash<int,QByteArray> rez; QHash<int,QByteArray> rez;

2
src/Eden/Models/SettingsModel.h

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

2
src/Eden/Util/Util.qml

@ -3,6 +3,8 @@ pragma Singleton
import QtQuick import QtQuick
QtObject { QtObject {
/** /**
* Recursively search an Item for children matching the specified type. * Recursively search an Item for children matching the specified type.
* @return A list of found items. * @return A list of found items.

2
src/qt_common/config/qt_config.cpp

@ -309,7 +309,7 @@ void QtConfig::ReadUIGamelistValues() {
} }
void QtConfig::ReadUILayoutValues() { void QtConfig::ReadUILayoutValues() {
BeginGroup(Settings::TranslateCategory(Settings::Category::UiGameList));
BeginGroup(Settings::TranslateCategory(Settings::Category::UiLayout));
ReadCategory(Settings::Category::UiLayout); ReadCategory(Settings::Category::UiLayout);

9
src/qt_common/config/uisettings.h

@ -158,9 +158,12 @@ struct Values {
#ifdef YUZU_QT_QML #ifdef YUZU_QT_QML
// TODO: native-like style default // 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 #endif
// Discord RPC // Discord RPC

Loading…
Cancel
Save