mirror of
https://git.eden-emu.dev/eden-emu/eden.git
synced 2026-09-09 13:36:35 +00:00
I think this are the final UI adjustments, hopefully.
This commit is contained in:
+13
@@ -0,0 +1,13 @@
|
||||
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
package org.yuzu.yuzu_emu.features.settings.model.view
|
||||
|
||||
import androidx.annotation.StringRes
|
||||
|
||||
class FxButtonSetting(
|
||||
@StringRes titleId: Int,
|
||||
val onClick: () -> Unit
|
||||
) : SettingsItem(emptySetting, titleId, "", 0, "") {
|
||||
override val type = TYPE_FX_BUTTON
|
||||
}
|
||||
-4
@@ -11,12 +11,8 @@ class FxShaderCardSetting(
|
||||
val index: Int,
|
||||
val expanded: Boolean,
|
||||
val uniforms: List<NativePostProcessing.Uniform>,
|
||||
val canMoveUp: Boolean,
|
||||
val canMoveDown: Boolean,
|
||||
val onToggle: () -> Unit,
|
||||
val onRemove: () -> Unit,
|
||||
val onMoveUp: () -> Unit,
|
||||
val onMoveDown: () -> Unit,
|
||||
val onReset: () -> Unit
|
||||
) : SettingsItem(emptySetting, 0, titleString, 0, descriptionString) {
|
||||
override val type = TYPE_FX_SHADER
|
||||
|
||||
+1
@@ -147,6 +147,7 @@ abstract class SettingsItem(
|
||||
const val TYPE_FX_TOOLBAR = 16
|
||||
const val TYPE_FX_PRESET = 17
|
||||
const val TYPE_FX_SHADER = 18
|
||||
const val TYPE_FX_BUTTON = 19
|
||||
|
||||
const val FASTMEM_COMBINED = "fastmem_combined"
|
||||
const val GPU_UNSWIZZLE_COMBINED = "gpu_unswizzle_combined"
|
||||
|
||||
+8
@@ -23,6 +23,7 @@ import com.google.android.material.timepicker.TimeFormat
|
||||
import org.yuzu.yuzu_emu.R
|
||||
import org.yuzu.yuzu_emu.SettingsNavigationDirections
|
||||
import org.yuzu.yuzu_emu.databinding.ListItemSettingBinding
|
||||
import org.yuzu.yuzu_emu.databinding.ListItemSettingFxButtonBinding
|
||||
import org.yuzu.yuzu_emu.databinding.ListItemSettingFxPresetBinding
|
||||
import org.yuzu.yuzu_emu.databinding.ListItemSettingFxShaderBinding
|
||||
import org.yuzu.yuzu_emu.databinding.ListItemSettingFxToolbarBinding
|
||||
@@ -130,6 +131,13 @@ class SettingsAdapter(
|
||||
)
|
||||
}
|
||||
|
||||
SettingsItem.TYPE_FX_BUTTON -> {
|
||||
FxButtonViewHolder(
|
||||
ListItemSettingFxButtonBinding.inflate(inflater, parent, false),
|
||||
this
|
||||
)
|
||||
}
|
||||
|
||||
else -> {
|
||||
HeaderViewHolder(ListItemSettingsHeaderBinding.inflate(inflater), this)
|
||||
}
|
||||
|
||||
+1
-18
@@ -345,10 +345,7 @@ class SettingsFragmentPresenter(
|
||||
|
||||
if (active.isNotEmpty()) {
|
||||
add(
|
||||
RunnableSetting(
|
||||
titleId = R.string.post_processing_preset_reset,
|
||||
isRunnable = true
|
||||
) {
|
||||
FxButtonSetting(titleId = R.string.post_processing_preset_reset) {
|
||||
NativePostProcessing.applyPreset(active)
|
||||
NativePostProcessing.store()
|
||||
expandedShaderSlots.clear()
|
||||
@@ -382,8 +379,6 @@ class SettingsFragmentPresenter(
|
||||
index = index,
|
||||
expanded = isOpen,
|
||||
uniforms = uniforms,
|
||||
canMoveUp = index > 0,
|
||||
canMoveDown = index < chain.size - 1,
|
||||
onToggle = {
|
||||
if (isOpen) {
|
||||
expandedShaderSlots.remove(index)
|
||||
@@ -398,18 +393,6 @@ class SettingsFragmentPresenter(
|
||||
expandedShaderSlots.clear()
|
||||
settingsViewModel.setReloadListAndNotifyDataset(true)
|
||||
},
|
||||
onMoveUp = {
|
||||
NativePostProcessing.move(index, -1)
|
||||
NativePostProcessing.store()
|
||||
expandedShaderSlots.clear()
|
||||
settingsViewModel.setReloadListAndNotifyDataset(true)
|
||||
},
|
||||
onMoveDown = {
|
||||
NativePostProcessing.move(index, 1)
|
||||
NativePostProcessing.store()
|
||||
expandedShaderSlots.clear()
|
||||
settingsViewModel.setReloadListAndNotifyDataset(true)
|
||||
},
|
||||
onReset = {
|
||||
NativePostProcessing.resetValues(index)
|
||||
NativePostProcessing.store()
|
||||
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
package org.yuzu.yuzu_emu.features.settings.ui.viewholder
|
||||
|
||||
import android.view.View
|
||||
import org.yuzu.yuzu_emu.databinding.ListItemSettingFxButtonBinding
|
||||
import org.yuzu.yuzu_emu.features.settings.model.view.FxButtonSetting
|
||||
import org.yuzu.yuzu_emu.features.settings.model.view.SettingsItem
|
||||
import org.yuzu.yuzu_emu.features.settings.ui.SettingsAdapter
|
||||
|
||||
class FxButtonViewHolder(
|
||||
val binding: ListItemSettingFxButtonBinding,
|
||||
adapter: SettingsAdapter
|
||||
) : SettingViewHolder(binding.root, adapter) {
|
||||
private lateinit var setting: FxButtonSetting
|
||||
|
||||
override fun bind(item: SettingsItem) {
|
||||
setting = item as FxButtonSetting
|
||||
|
||||
binding.fxButton.text = item.title
|
||||
binding.fxButton.setOnClickListener { setting.onClick.invoke() }
|
||||
}
|
||||
|
||||
override fun onClick(clicked: View) {}
|
||||
|
||||
override fun onLongClick(clicked: View): Boolean = true
|
||||
}
|
||||
-6
@@ -89,12 +89,6 @@ class FxShaderCardViewHolder(
|
||||
private fun addActions(inflater: LayoutInflater) {
|
||||
val row = ItemSettingFxActionsBinding.inflate(inflater, binding.shaderBody, false)
|
||||
|
||||
row.fxMoveUp.isEnabled = setting.canMoveUp
|
||||
row.fxMoveUp.setOnClickListener { setting.onMoveUp.invoke() }
|
||||
|
||||
row.fxMoveDown.isEnabled = setting.canMoveDown
|
||||
row.fxMoveDown.setOnClickListener { setting.onMoveDown.invoke() }
|
||||
|
||||
row.fxReset.setOnClickListener { setting.onReset.invoke() }
|
||||
|
||||
binding.shaderBody.addView(row.root)
|
||||
|
||||
@@ -1,41 +1,18 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:baselineAligned="false"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
android:paddingStart="20dp"
|
||||
android:paddingEnd="20dp"
|
||||
android:paddingTop="8dp"
|
||||
android:paddingBottom="8dp">
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/fx_move_up"
|
||||
style="@style/Widget.Material3.Button.IconButton.Filled.Tonal"
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="48dp"
|
||||
android:contentDescription="@string/post_processing_move_up"
|
||||
android:rotation="180"
|
||||
app:icon="@drawable/ic_dropdown_arrow" />
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/fx_move_down"
|
||||
style="@style/Widget.Material3.Button.IconButton.Filled.Tonal"
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="48dp"
|
||||
android:layout_marginStart="8dp"
|
||||
android:contentDescription="@string/post_processing_move_down"
|
||||
app:icon="@drawable/ic_dropdown_arrow" />
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/fx_reset"
|
||||
style="@style/Widget.Material3.Button.TonalButton"
|
||||
android:layout_width="0dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="48dp"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_weight="1"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="1"
|
||||
android:text="@string/post_processing_reset" />
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:layout_marginTop="6dp"
|
||||
android:layout_marginBottom="6dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/fx_button"
|
||||
style="@style/Widget.Material3.Button.TonalButton"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="48dp"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="1" />
|
||||
|
||||
</LinearLayout>
|
||||
@@ -315,9 +315,7 @@
|
||||
<string name="post_processing_preset_none">No preset</string>
|
||||
<string name="post_processing_preset_delete">Delete preset</string>
|
||||
<string name="post_processing_preset_reset">Reset preset values</string>
|
||||
<string name="post_processing_move_up">Move up</string>
|
||||
<string name="post_processing_move_down">Move down</string>
|
||||
<string name="post_processing_reset">Reset to defaults</string>
|
||||
<string name="post_processing_reset">Reset to default</string>
|
||||
<string name="post_processing_empty">No effects found. Place .fx files in this folder:</string>
|
||||
<string name="frame_gen">Frame generation</string>
|
||||
<string name="frame_gen_per_game_description">Configure frame generation for this game</string>
|
||||
|
||||
Reference in New Issue
Block a user