From b6ebe8a4d41c0dc259c9f291f2c93efe5bb5f93e Mon Sep 17 00:00:00 2001 From: featureJosh <201660770+featureJosh@users.noreply.github.com> Date: Mon, 16 Nov 2026 21:53:12 -0500 Subject: [PATCH] Launcher: Font Awesome icons on the Settings tabs Each Settings section pill gets a Font Awesome Free solid icon (faIcon in ui.js, segmented options take an icon). Credited in CREDITS.md (CC BY 4.0). --- CHANGELOG.md | 3 +++ CREDITS.md | 2 +- launcher/package-lock.json | 22 ++++++++++++++++++++++ launcher/package.json | 1 + launcher/src/components.css | 3 +++ launcher/src/pages/settings.js | 4 ++-- launcher/src/settings-schema.js | 8 ++++++++ launcher/src/ui.js | 21 +++++++++++++++++++-- 8 files changed, 59 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 06bd6cde..4c4c0294 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,9 @@ ## Unreleased +### Launcher +- Added icons to the Settings tabs + ## 0.14.1 (build R: Raccoon Hotfix a1) **Update:** press **Update** in the launcher. No **Set up again** needed. diff --git a/CREDITS.md b/CREDITS.md index e95d3fba..e2b95287 100644 --- a/CREDITS.md +++ b/CREDITS.md @@ -1,6 +1,6 @@ # Credits -Parent project: [pokopia-native](https://github.com/xFractals/pokopia-native) (MIT; its `ampere-lower/` is GPL-3.0-or-later), whose updates this project follows. Built on [nxrecomp](https://github.com/drakolordx7/nxrecomp). Uses code from [Ryujinx](https://github.com/Ryubing/Ryujinx), [Mesa](https://gitlab.freedesktop.org/mesa/mesa), [pokopia-native](https://github.com/xFractals/pokopia-native), smo-recomp, ScarletNX, ssbu-recomp, SuperMarioWonderRecomp, yuzu, Eden, libnx, [astc-encoder](https://github.com/ARM-software/astc-encoder), [bc7enc_rdo](https://github.com/richgel999/bc7enc_rdo), [libvpx](https://chromium.googlesource.com/webm/libvpx), AMD FidelityFX, NVIDIA Image Scaling, [SDL3](https://github.com/libsdl-org/SDL), [Tauri](https://tauri.app), [Zig](https://ziglang.org) and Python, plus [Kenney input prompts](https://kenney.nl/assets/input-prompts), DejaVu fonts, and in the launcher [Inter](https://rsms.me/inter/) (SIL OFL 1.1) and [Lucide](https://lucide.dev) icons (ISC). Mods run on [Modtopia](runtime/third_party/modtopia) by the pokopia-native team (MIT). The Pokémon cap mod (`runtime/games/pkp/core/pkp_pokemon_cap.cpp`) ports the default behaviour of the Eglantine cap, and the account id token answers (`runtime/src/services/acc.cpp`) follow Lichii / Eglantine (GPL-3.0, yuzu family). Design ideas (no code) from totk-pc-recomp (shadow storage for guest memory), ultratears (memory pool copies), pokopia-native (uniform data copied into video memory when a draw binds it; sparse pool copies bound in 2 MB granules) and [seedds/nxnative](https://github.com/seedds/nxnative) (MIT; Ampere shader layout notes, texture swizzle and NVN key findings). +Parent project: [pokopia-native](https://github.com/xFractals/pokopia-native) (MIT; its `ampere-lower/` is GPL-3.0-or-later), whose updates this project follows. Built on [nxrecomp](https://github.com/drakolordx7/nxrecomp). Uses code from [Ryujinx](https://github.com/Ryubing/Ryujinx), [Mesa](https://gitlab.freedesktop.org/mesa/mesa), [pokopia-native](https://github.com/xFractals/pokopia-native), smo-recomp, ScarletNX, ssbu-recomp, SuperMarioWonderRecomp, yuzu, Eden, libnx, [astc-encoder](https://github.com/ARM-software/astc-encoder), [bc7enc_rdo](https://github.com/richgel999/bc7enc_rdo), [libvpx](https://chromium.googlesource.com/webm/libvpx), AMD FidelityFX, NVIDIA Image Scaling, [SDL3](https://github.com/libsdl-org/SDL), [Tauri](https://tauri.app), [Zig](https://ziglang.org) and Python, plus [Kenney input prompts](https://kenney.nl/assets/input-prompts), DejaVu fonts, and in the launcher [Inter](https://rsms.me/inter/) (SIL OFL 1.1) [Lucide](https://lucide.dev) icons (ISC) and [Font Awesome Free](https://fontawesome.com) icons by Fonticons, Inc. (CC BY 4.0). Mods run on [Modtopia](runtime/third_party/modtopia) by the pokopia-native team (MIT). The Pokémon cap mod (`runtime/games/pkp/core/pkp_pokemon_cap.cpp`) ports the default behaviour of the Eglantine cap, and the account id token answers (`runtime/src/services/acc.cpp`) follow Lichii / Eglantine (GPL-3.0, yuzu family). Design ideas (no code) from totk-pc-recomp (shadow storage for guest memory), ultratears (memory pool copies), pokopia-native (uniform data copied into video memory when a draw binds it; sparse pool copies bound in 2 MB granules) and [seedds/nxnative](https://github.com/seedds/nxnative) (MIT; Ampere shader layout notes, texture swizzle and NVN key findings). The macOS port draws on [PokoMac](https://github.com/Chaos192/PokoMac) by Chaos192 (GPL-3.0), the Apple-silicon port of this project: the native Linux and macOS environment ([#562](https://github.com/Dittobyte/Recompia/pull/562)) follows its Win32-over-POSIX layer (`runtime/src/os/`), and the macOS tuning in commit `72e2221` (ARMv8 SHA-1 for the shader cache key, LDAR/STLR ordering, `VK_KHR_portability_*`, 16 KiB write tracking, pool mirrors off, the Metal shader-cache identity, the frame limit through loading, vsync on by default) comes from it. See `docs/macos-optimisations.md`. diff --git a/launcher/package-lock.json b/launcher/package-lock.json index 4067db76..960389cc 100644 --- a/launcher/package-lock.json +++ b/launcher/package-lock.json @@ -10,6 +10,7 @@ "license": "GPL-3.0-or-later", "dependencies": { "@fontsource-variable/inter": "^5.3.0", + "@fortawesome/free-solid-svg-icons": "^7.3.1", "@tauri-apps/api": "^2.12.4", "lucide": "^1.66.0" }, @@ -27,6 +28,27 @@ "url": "https://github.com/sponsors/ayuhito" } }, + "node_modules/@fortawesome/fontawesome-common-types": { + "version": "7.3.1", + "resolved": "https://registry.npmjs.org/@fortawesome/fontawesome-common-types/-/fontawesome-common-types-7.3.1.tgz", + "integrity": "sha512-k0C0sdHmZtAo6dRDtd1Z/qcpyHbL0CKsjV8seMY/21xGhY5Wsv0XRmiI/xEEH4y2c9b1+jvgNs/3EqhV27yUEA==", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/@fortawesome/free-solid-svg-icons": { + "version": "7.3.1", + "resolved": "https://registry.npmjs.org/@fortawesome/free-solid-svg-icons/-/free-solid-svg-icons-7.3.1.tgz", + "integrity": "sha512-v0BLa0eqg7ubvVWeNSHVBs8fWH/GJicERZoJaxJ3FE/lj67VSqzoMg9pzfZVOfLMX10y0pGwQAuxoRVVH2patg==", + "license": "(CC-BY-4.0 AND MIT)", + "dependencies": { + "@fortawesome/fontawesome-common-types": "7.3.1" + }, + "engines": { + "node": ">=6" + } + }, "node_modules/@oxc-project/types": { "version": "0.156.0", "resolved": "https://registry.npmjs.org/@oxc-project/types/-/types-0.156.0.tgz", diff --git a/launcher/package.json b/launcher/package.json index b896a7ae..278ebf11 100644 --- a/launcher/package.json +++ b/launcher/package.json @@ -17,6 +17,7 @@ }, "dependencies": { "@fontsource-variable/inter": "^5.3.0", + "@fortawesome/free-solid-svg-icons": "^7.3.1", "@tauri-apps/api": "^2.12.4", "lucide": "^1.66.0" } diff --git a/launcher/src/components.css b/launcher/src/components.css index 1ffeb879..a72352ce 100644 --- a/launcher/src/components.css +++ b/launcher/src/components.css @@ -38,6 +38,7 @@ body.pad-nav .slider input:focus::-webkit-slider-thumb { outline: 3px solid var( stroke-linecap: round; stroke-linejoin: round; } +.icon.fa { fill: currentColor; stroke: none; } .i-play { fill: currentColor; } .spin { animation: spin 900ms linear infinite; } @keyframes spin { to { transform: rotate(360deg); } } @@ -403,6 +404,8 @@ button.chip:hover { background: var(--surface-3); } transition: background var(--dur) var(--ease), color var(--dur) var(--ease); } .seg input:hover:not(:checked):not(:disabled) + span { color: var(--color-text); } +.seg span .icon { width: var(--icon-sm); height: var(--icon-sm); margin-right: 7px; } +.seg input:checked + span .icon { color: var(--color-accent); } .seg input:checked + span { background: var(--surface-3); color: var(--color-text); box-shadow: var(--glass-highlight), var(--shadow-sm); } .seg input:focus-visible + span { outline: 2px solid var(--color-focus); outline-offset: 1px; } .seg input:disabled + span { color: var(--color-text-3); } diff --git a/launcher/src/pages/settings.js b/launcher/src/pages/settings.js index 95120906..4f82a975 100644 --- a/launcher/src/pages/settings.js +++ b/launcher/src/pages/settings.js @@ -6,7 +6,7 @@ import './settings.css'; import { api } from '../api.js'; import { setLanguage, t } from '../i18n.js'; -import { errText, esc, segmented, toast } from '../ui.js'; +import { errText, esc, faIcon, segmented, toast } from '../ui.js'; import { store } from '../store.js'; import { SECTIONS } from '../settings-schema.js'; import { createState, env, rememberSection } from './settings/state.js'; @@ -38,7 +38,7 @@ export async function render(el, ctx) {

${esc(t('Settings'))}

-
${segmented('section', SECTIONS.map((s) => ({ value: s.id, label: s.label })), st.section, { label: t('Settings section') })}
+
${segmented('section', SECTIONS.map((s) => ({ value: s.id, label: s.label, icon: faIcon(s.icon) })), st.section, { label: t('Settings section') })}
`; diff --git a/launcher/src/settings-schema.js b/launcher/src/settings-schema.js index 164bbf55..547565ff 100644 --- a/launcher/src/settings-schema.js +++ b/launcher/src/settings-schema.js @@ -8,6 +8,7 @@ // A source is { pkp, controls, config, controls_exists }: read_settings' `section.key` maps plus get_config. // An edit is { file, section, key, value }. file 'pkp' and 'controls' go to write_settings, 'config' to save_config. // +// A section: { id, icon (a Font Awesome solid name for faIcon), label, groups }. // Field: { id, label, type, at, def, options, min, max, step, suffix, ... } // type segmented | select | choice | size | toggle | slider | path | clock // at where it lives: controls(), pkp() or config(); an array when it has two keys @@ -362,6 +363,7 @@ export const IMPORT_FACTS = t('Your current save moves to a backup folder first, export const SECTIONS = [ { id: 'display', + icon: 'display', label: t('Display'), groups: [ { @@ -417,6 +419,7 @@ export const SECTIONS = [ }, { id: 'graphics', + icon: 'wand-magic-sparkles', label: t('Graphics'), groups: [ { @@ -469,6 +472,7 @@ export const SECTIONS = [ }, { id: 'audio', + icon: 'volume-high', label: t('Audio'), groups: [ { @@ -485,6 +489,7 @@ export const SECTIONS = [ }, { id: 'controls', + icon: 'gamepad', label: t('Controls'), groups: [ { @@ -530,6 +535,7 @@ export const SECTIONS = [ }, { id: 'saves', + icon: 'floppy-disk', label: t('Saves'), groups: [ { @@ -609,6 +615,7 @@ export const SECTIONS = [ }, { id: 'game', + icon: 'sliders', label: t('Game'), groups: [ { @@ -740,6 +747,7 @@ export const SECTIONS = [ }, { id: 'about', + icon: 'circle-info', label: t('About'), groups: [ { diff --git a/launcher/src/ui.js b/launcher/src/ui.js index dfd36f16..123fb164 100644 --- a/launcher/src/ui.js +++ b/launcher/src/ui.js @@ -5,6 +5,9 @@ import { Folder, FolderOpen, Gamepad2, Globe, HardDrive, House, Info, Keyboard, Link, LoaderCircle, Lock, LockOpen, Minus, Mouse, Newspaper, Palette, Pause, Pencil, Play, Plus, Puzzle, RefreshCw, RotateCcw, Save, Settings, Square, Trash2, TriangleAlert, Trophy, Upload, UserCheck, Users, Wrench, X, } from 'lucide'; +import { + faCircleInfo, faDisplay, faFloppyDisk, faGamepad, faSliders, faVolumeHigh, faWandMagicSparkles, +} from '@fortawesome/free-solid-svg-icons'; const ICONS = { ArrowDown, ArrowLeft, ArrowUp, Check, ChevronDown, ChevronRight, CircleAlert, CircleCheck, CircleX, Clock, Copy, Download, ExternalLink, Eye, EyeOff, FileArchive, FileText, @@ -38,6 +41,20 @@ export function icon(name, cls = '') { return ``; } +const FA_ICONS = { faCircleInfo, faDisplay, faFloppyDisk, faGamepad, faSliders, faVolumeHigh, faWandMagicSparkles }; + +/** Finished SVG markup for a Font Awesome solid icon by kebab name ("floppy-disk"). A new name is added to the import list above. */ +export function faIcon(name, cls = '') { + const def = FA_ICONS[`fa${pascal(name)}`]; + if (!def) { + if (import.meta.env?.DEV) console.warn(`Font Awesome icon "${name}" is not in ui.js`); + return ''; + } + const [w, h, , , path] = def.icon; + const paths = (Array.isArray(path) ? path : [path]).map((d) => ``).join(''); + return ``; +} + const MAX_TOASTS = 3; /** Short status message. kind: '' | 'ok' | 'error' (errors stay longer and are announced at once). */ @@ -157,11 +174,11 @@ export function group(title, rows) { `; } -/** Pill radio group: read it with a `change` listener, e.target.name / e.target.value. */ +/** Pill radio group: read it with a `change` listener, e.target.name / e.target.value. An option's `icon` is SVG markup (icon() / faIcon()) before its label. */ export function segmented(name, opts, value, { label = '', disabled = false } = {}) { const items = opts.map(optionOf).map((o) => ``); return `
${items.join('')}
`; }