diff options
| author | Kurt Himebauch <136133082+xXJSONDeruloXx@users.noreply.github.com> | 2026-09-10 16:32:15 -0400 |
|---|---|---|
| committer | Kurt Himebauch <136133082+xXJSONDeruloXx@users.noreply.github.com> | 2026-09-10 16:32:15 -0400 |
| commit | 8090b237a34140343b13efc845f8123730989cbf (patch) | |
| tree | 040a7d27ec0dc508011d7b4ea4950dd1912ef3ac /src/components | |
| parent | 6671a5c51fef98c07369f5e5be5ce498a317e868 (diff) | |
| download | decky-lsfg-vk-8090b237a34140343b13efc845f8123730989cbf.tar.gz decky-lsfg-vk-8090b237a34140343b13efc845f8123730989cbf.zip | |
feat: show running flatpak profiles
Diffstat (limited to 'src/components')
| -rw-r--r-- | src/components/FlatpakNowPlayingTab.tsx | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/src/components/FlatpakNowPlayingTab.tsx b/src/components/FlatpakNowPlayingTab.tsx new file mode 100644 index 0000000..9e5a0db --- /dev/null +++ b/src/components/FlatpakNowPlayingTab.tsx @@ -0,0 +1,39 @@ +import { Field, Focusable, PanelSection, PanelSectionRow } from "@decky/ui"; +import type { FlatpakApp, LsfgConfig, WorkaroundState } from "../api/lsfgApi"; +import { ConfigurationSection } from "./ConfigurationSection"; +import { FlatpakWorkaroundsSection } from "./FlatpakWorkaroundsSection"; +import { FpsMultiplierControl } from "./FpsMultiplierControl"; + +interface Props { + app: FlatpakApp; + busy: boolean; + onConfigChange: (appId: string, config: LsfgConfig) => Promise<boolean>; + onWorkaroundChange: (appId: string, state: WorkaroundState) => Promise<boolean>; +} + +export function FlatpakNowPlayingTab({ app, busy, onConfigChange, onWorkaroundChange }: Props) { + if (!app.config) return null; + const changeConfig = async ( + field: keyof LsfgConfig, + value: boolean | number | string | string[], + ) => { + await onConfigChange(app.app_id, { ...app.config!, [field]: value }); + }; + + return ( + <Focusable> + <PanelSection title="Now Playing"> + <PanelSectionRow> + <Field label={app.app_name} description={`Flatpak ยท ${app.app_id}`} /> + </PanelSectionRow> + </PanelSection> + <FpsMultiplierControl config={app.config} onConfigChange={changeConfig} /> + <ConfigurationSection config={app.config} onConfigChange={changeConfig} /> + <FlatpakWorkaroundsSection + state={app.workarounds} + disabled={busy} + onChange={(state) => onWorkaroundChange(app.app_id, state)} + /> + </Focusable> + ); +} |
