summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfero <hi@evan.graphics>2023-07-09 01:43:00 -0700
committerGitHub <noreply@github.com>2023-07-09 09:43:00 +0100
commit7c805e9b80996c69e4401514c5468a5fdc40e178 (patch)
tree48d8ea94efaae839a981e44b3ebacb90c632df11
parent6b3f9e4a9ef55b1372da72f02c48de183e5fa626 (diff)
downloaddecky-loader-7c805e9b80996c69e4401514c5468a5fdc40e178.tar.gz
decky-loader-7c805e9b80996c69e4401514c5468a5fdc40e178.zip
Add descriptions to Decky titleview DialogButtons (#502)
* chore: add onOKActionDescriptions to decky titleview This is in preparation for beebles' custom titleview. Since plugins may reuse the same icons in their custom titleviews, it will be a good practice to disambiguate their meanings. In the Steam UI, any icon button has a matching description. * chore: implement it using the translation framework --------- Co-authored-by: Marco Rodolfi <marco.rodolfi@tuta.io>
-rw-r--r--backend/locales/en-US.json4
-rw-r--r--frontend/src/components/TitleView.tsx4
2 files changed, 8 insertions, 0 deletions
diff --git a/backend/locales/en-US.json b/backend/locales/en-US.json
index 180a8a70..82ad3800 100644
--- a/backend/locales/en-US.json
+++ b/backend/locales/en-US.json
@@ -234,6 +234,10 @@
"testing": "Testing"
}
},
+ "TitleView":{
+ "decky_store_desc": "Open Decky Store",
+ "settings_desc": "Open Decky Settings"
+ },
"Updater": {
"decky_updates": "Decky Updates",
"no_patch_notes_desc": "no patch notes for this version",
diff --git a/frontend/src/components/TitleView.tsx b/frontend/src/components/TitleView.tsx
index 7e529d21..6ae6b2ae 100644
--- a/frontend/src/components/TitleView.tsx
+++ b/frontend/src/components/TitleView.tsx
@@ -1,5 +1,6 @@
import { DialogButton, Focusable, Router, staticClasses } from 'decky-frontend-lib';
import { CSSProperties, VFC } from 'react';
+import { useTranslation } from 'react-i18next';
import { BsGearFill } from 'react-icons/bs';
import { FaArrowLeft, FaStore } from 'react-icons/fa';
@@ -13,6 +14,7 @@ const titleStyles: CSSProperties = {
const TitleView: VFC = () => {
const { activePlugin, closeActivePlugin } = useDeckyState();
+ const { t } = useTranslation();
const onSettingsClick = () => {
Router.CloseSideMenus();
@@ -31,12 +33,14 @@ const TitleView: VFC = () => {
<DialogButton
style={{ height: '28px', width: '40px', minWidth: 0, padding: '10px 12px' }}
onClick={onStoreClick}
+ onOKActionDescription={t('TitleView.decky_store_desc')}
>
<FaStore style={{ marginTop: '-4px', display: 'block' }} />
</DialogButton>
<DialogButton
style={{ height: '28px', width: '40px', minWidth: 0, padding: '10px 12px' }}
onClick={onSettingsClick}
+ onOKActionDescription={t('TitleView.settings_desc')}
>
<BsGearFill style={{ marginTop: '-4px', display: 'block' }} />
</DialogButton>