ui: refactor & descriptions

This commit is contained in:
PancakeTAS 2025-07-24 03:29:19 +02:00 committed by Pancake
parent 0003cd6eb2
commit f46817e862
16 changed files with 146 additions and 28 deletions

View file

@ -1,7 +1,7 @@
fn main() {
glib_build_tools::compile_resources(
&["rsc"],
"rsc/resources.gresource.xml",
"ui.gresource",
"rsc/lsfg-vk.xml",
"lsfg-vk.gresource",
);
}

View file

@ -1,8 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<gresources>
<gresource prefix="/gay/pancake/lsfg-vk/">
<file compressed="true" preprocess="xml-stripblanks">entry.ui</file>
<file compressed="true" preprocess="xml-stripblanks">window.ui</file>
<file compressed="true" preprocess="xml-stripblanks">entry/entry.ui</file>
<file compressed="true" preprocess="xml-stripblanks">pane/main.ui</file>
<file compressed="true" preprocess="xml-stripblanks">pane/sidebar.ui</file>
<file compressed="true" preprocess="xml-stripblanks">pref/dropdown.ui</file>
@ -10,5 +9,6 @@
<file compressed="true" preprocess="xml-stripblanks">pref/entry.ui</file>
<file compressed="true" preprocess="xml-stripblanks">pref/slider.ui</file>
<file compressed="true" preprocess="xml-stripblanks">pref/switch.ui</file>
<file compressed="true" preprocess="xml-stripblanks">window.ui</file>
</gresource>
</gresources>

View file

@ -34,12 +34,14 @@
<child>
<object class="LSPrefEntry" id="dll">
<property name="opt-name">Path to Lossless.dll</property>
<property name="opt-subtitle">(Global Option) Override where lsfg-vk finds Lossless Scaling</property>
</object>
</child>
<!--General Properties: Preset name -->
<child>
<object class="LSPrefEntry" id="preset_name">
<property name="opt-name">Preset name</property>
<property name="opt-subtitle">Command name used for automatically activating in games.</property>
</object>
</child>
</object>
@ -52,18 +54,21 @@
<child>
<object class="LSPrefNumber" id="multiplier">
<property name="opt-name">Multiplier</property>
<property name="opt-subtitle">Double, triple or quadruple your FPS.</property>
</object>
</child>
<!-- Frame Generation: Flow Scale -->
<child>
<object class="LSPrefSlider" id="flow_scale">
<property name="opt-name">Flow Scale</property>
<property name="opt-subtitle">Lowers the internal motion estimation resolution</property>
</object>
</child>
<!-- Frame Generation: Performance Mode -->
<child>
<object class="LSPrefSwitch" id="performance_mode">
<property name="opt-name">Performance Mode</property>
<property name="opt-subtitle">Massively improve performance at the cost of quality.</property>
<property name="default-state">false</property>
</object>
</child>
@ -77,18 +82,20 @@
<child>
<object class="LSPrefSwitch" id="hdr_mode">
<property name="opt-name">HDR Mode</property>
<property name="opt-subtitle">Enable special HDR-only behavior.</property>
<property name="default-state">false</property>
</object>
</child>
<!-- Misc: Experimental Present Mode -->
<child>
<object class="LSPrefDropdown" id="experimental_present_mode">
<property name="opt-name">Experimental Present Mode</property>
<property name="opt-name">Present Mode</property>
<property name="opt-subtitle">(Experimental) Override the present mode to immediate or mailbox.</property>
<property name="default-selection">0</property>
<property name="options">
<object class="GtkStringList">
<items>
<item>VSync/FIFO</item>
<item>VSync/FIFO (Default, Recommended)</item>
<item>Mailbox</item>
<item>Immediate</item>
</items>

View file

@ -11,11 +11,31 @@
<property name="margin-top">8</property>
<property name="margin-bottom">8</property>
<child>
<object class="GtkLabel">
<property name="label"
bind-source="LSPrefDropdown" bind-property="opt-name" bind-flags="sync-create"/>
<property name="halign">start</property>
<object class="GtkBox">
<property name="orientation">vertical</property>
<property name="spacing">4</property>
<property name="valign">center</property>
<property name="hexpand">true</property>
<child>
<object class="GtkLabel">
<property name="label"
bind-source="LSPrefDropdown" bind-property="opt-name" bind-flags="sync-create"/>
<property name="halign">start</property>
<property name="hexpand">true</property>
</object>
</child>
<child>
<object class="GtkLabel">
<property name="label"
bind-source="LSPrefDropdown" bind-property="opt-subtitle" bind-flags="sync-create"/>
<property name="halign">start</property>
<property name="hexpand">true</property>
<style>
<class name="dim-label"/>
<class name="caption"/>
</style>
</object>
</child>
</object>
</child>
<child>

View file

@ -11,11 +11,31 @@
<property name="margin-top">8</property>
<property name="margin-bottom">8</property>
<child>
<object class="GtkLabel">
<property name="label"
bind-source="LSPrefEntry" bind-property="opt-name" bind-flags="sync-create"/>
<property name="halign">start</property>
<object class="GtkBox">
<property name="orientation">vertical</property>
<property name="spacing">4</property>
<property name="valign">center</property>
<property name="hexpand">true</property>
<child>
<object class="GtkLabel">
<property name="label"
bind-source="LSPrefEntry" bind-property="opt-name" bind-flags="sync-create"/>
<property name="halign">start</property>
<property name="hexpand">true</property>
</object>
</child>
<child>
<object class="GtkLabel">
<property name="label"
bind-source="LSPrefEntry" bind-property="opt-subtitle" bind-flags="sync-create"/>
<property name="halign">start</property>
<property name="hexpand">true</property>
<style>
<class name="dim-label"/>
<class name="caption"/>
</style>
</object>
</child>
</object>
</child>
<child>

View file

@ -11,11 +11,31 @@
<property name="margin-top">8</property>
<property name="margin-bottom">8</property>
<child>
<object class="GtkLabel">
<property name="label"
bind-source="LSPrefNumber" bind-property="opt-name" bind-flags="sync-create"/>
<property name="halign">start</property>
<object class="GtkBox">
<property name="orientation">vertical</property>
<property name="spacing">4</property>
<property name="valign">center</property>
<property name="hexpand">true</property>
<child>
<object class="GtkLabel">
<property name="label"
bind-source="LSPrefNumber" bind-property="opt-name" bind-flags="sync-create"/>
<property name="halign">start</property>
<property name="hexpand">true</property>
</object>
</child>
<child>
<object class="GtkLabel">
<property name="label"
bind-source="LSPrefNumber" bind-property="opt-subtitle" bind-flags="sync-create"/>
<property name="halign">start</property>
<property name="hexpand">true</property>
<style>
<class name="dim-label"/>
<class name="caption"/>
</style>
</object>
</child>
</object>
</child>
<child>

View file

@ -11,11 +11,31 @@
<property name="margin-top">8</property>
<property name="margin-bottom">8</property>
<child>
<object class="GtkLabel">
<property name="label"
bind-source="LSPrefSlider" bind-property="opt-name" bind-flags="sync-create"/>
<property name="halign">start</property>
<object class="GtkBox">
<property name="orientation">vertical</property>
<property name="spacing">4</property>
<property name="valign">center</property>
<property name="hexpand">true</property>
<child>
<object class="GtkLabel">
<property name="label"
bind-source="LSPrefSlider" bind-property="opt-name" bind-flags="sync-create"/>
<property name="halign">start</property>
<property name="hexpand">true</property>
</object>
</child>
<child>
<object class="GtkLabel">
<property name="label"
bind-source="LSPrefSlider" bind-property="opt-subtitle" bind-flags="sync-create"/>
<property name="halign">start</property>
<property name="hexpand">true</property>
<style>
<class name="dim-label"/>
<class name="caption"/>
</style>
</object>
</child>
</object>
</child>
<child>

View file

@ -11,11 +11,31 @@
<property name="margin-top">8</property>
<property name="margin-bottom">8</property>
<child>
<object class="GtkLabel">
<property name="label"
bind-source="LSPrefSwitch" bind-property="opt-name" bind-flags="sync-create"/>
<property name="halign">start</property>
<object class="GtkBox">
<property name="orientation">vertical</property>
<property name="spacing">4</property>
<property name="valign">center</property>
<property name="hexpand">true</property>
<child>
<object class="GtkLabel">
<property name="label"
bind-source="LSPrefSwitch" bind-property="opt-name" bind-flags="sync-create"/>
<property name="halign">start</property>
<property name="hexpand">true</property>
</object>
</child>
<child>
<object class="GtkLabel">
<property name="label"
bind-source="LSPrefSwitch" bind-property="opt-subtitle" bind-flags="sync-create"/>
<property name="halign">start</property>
<property name="hexpand">true</property>
<style>
<class name="dim-label"/>
<class name="caption"/>
</style>
</object>
</child>
</object>
</child>
<child>
@ -23,6 +43,7 @@
<property name="active"
bind-source="LSPrefSwitch" bind-property="default-state" bind-flags="sync-create"/>
<property name="css-classes">compact</property>
<property name="width-request">70</property>
</object>
</child>
</object>

View file

@ -17,7 +17,7 @@ struct State {
static STATE: OnceLock<Arc<RwLock<State>>> = OnceLock::new();
fn main() {
gio::resources_register_include!("ui.gresource")
gio::resources_register_include!("lsfg-vk.gresource")
.expect("Failed to register resources");
config::load_config()
.expect("Failed to load configuration");

View file

@ -6,7 +6,7 @@ use gtk::prelude::*;
#[derive(gtk::CompositeTemplate, glib::Properties, Default)]
#[properties(wrapper_type = super::Entry)]
#[template(resource = "/gay/pancake/lsfg-vk/entry.ui")]
#[template(resource = "/gay/pancake/lsfg-vk/entry/entry.ui")]
pub struct Entry {
#[property(get, set)]
exe: RefCell<String>,

View file

@ -12,6 +12,8 @@ pub struct PrefDropdown {
#[property(get, set)]
opt_name: RefCell<String>,
#[property(get, set)]
opt_subtitle: RefCell<String>,
#[property(get, set)]
default_selection: RefCell<u32>,
#[property(get, set)]
options: RefCell<gtk::StringList>,

View file

@ -12,6 +12,8 @@ pub struct PrefEntry {
#[property(get, set)]
opt_name: RefCell<String>,
#[property(get, set)]
opt_subtitle: RefCell<String>,
#[property(get, set)]
default_text: RefCell<String>,
#[property(get, set)]
tooltip_text: RefCell<String>,

View file

@ -11,6 +11,8 @@ use adw::prelude::*;
pub struct PrefNumber {
#[property(get, set)]
opt_name: RefCell<String>,
#[property(get, set)]
opt_subtitle: RefCell<String>,
#[template_child]
pub number: TemplateChild<gtk::SpinButton>,

View file

@ -11,6 +11,8 @@ use adw::prelude::*;
pub struct PrefSlider {
#[property(get, set)]
opt_name: RefCell<String>,
#[property(get, set)]
opt_subtitle: RefCell<String>,
#[template_child]
pub slider: TemplateChild<gtk::Scale>,

View file

@ -12,6 +12,8 @@ pub struct PrefSwitch {
#[property(get, set)]
opt_name: RefCell<String>,
#[property(get, set)]
opt_subtitle: RefCell<String>,
#[property(get, set)]
default_state: RefCell<bool>,
#[template_child]