mirror of
https://github.com/SteamDeckHomebrew/decky-loader.git
synced 2026-07-11 22:01:59 +00:00
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>
This commit is contained in:
@@ -234,6 +234,10 @@
|
|||||||
"testing": "Testing"
|
"testing": "Testing"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"TitleView":{
|
||||||
|
"decky_store_desc": "Open Decky Store",
|
||||||
|
"settings_desc": "Open Decky Settings"
|
||||||
|
},
|
||||||
"Updater": {
|
"Updater": {
|
||||||
"decky_updates": "Decky Updates",
|
"decky_updates": "Decky Updates",
|
||||||
"no_patch_notes_desc": "no patch notes for this version",
|
"no_patch_notes_desc": "no patch notes for this version",
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import { DialogButton, Focusable, Router, staticClasses } from 'decky-frontend-lib';
|
import { DialogButton, Focusable, Router, staticClasses } from 'decky-frontend-lib';
|
||||||
import { CSSProperties, VFC } from 'react';
|
import { CSSProperties, VFC } from 'react';
|
||||||
|
import { useTranslation } from 'react-i18next';
|
||||||
import { BsGearFill } from 'react-icons/bs';
|
import { BsGearFill } from 'react-icons/bs';
|
||||||
import { FaArrowLeft, FaStore } from 'react-icons/fa';
|
import { FaArrowLeft, FaStore } from 'react-icons/fa';
|
||||||
|
|
||||||
@@ -13,6 +14,7 @@ const titleStyles: CSSProperties = {
|
|||||||
|
|
||||||
const TitleView: VFC = () => {
|
const TitleView: VFC = () => {
|
||||||
const { activePlugin, closeActivePlugin } = useDeckyState();
|
const { activePlugin, closeActivePlugin } = useDeckyState();
|
||||||
|
const { t } = useTranslation();
|
||||||
|
|
||||||
const onSettingsClick = () => {
|
const onSettingsClick = () => {
|
||||||
Router.CloseSideMenus();
|
Router.CloseSideMenus();
|
||||||
@@ -31,12 +33,14 @@ const TitleView: VFC = () => {
|
|||||||
<DialogButton
|
<DialogButton
|
||||||
style={{ height: '28px', width: '40px', minWidth: 0, padding: '10px 12px' }}
|
style={{ height: '28px', width: '40px', minWidth: 0, padding: '10px 12px' }}
|
||||||
onClick={onStoreClick}
|
onClick={onStoreClick}
|
||||||
|
onOKActionDescription={t('TitleView.decky_store_desc')}
|
||||||
>
|
>
|
||||||
<FaStore style={{ marginTop: '-4px', display: 'block' }} />
|
<FaStore style={{ marginTop: '-4px', display: 'block' }} />
|
||||||
</DialogButton>
|
</DialogButton>
|
||||||
<DialogButton
|
<DialogButton
|
||||||
style={{ height: '28px', width: '40px', minWidth: 0, padding: '10px 12px' }}
|
style={{ height: '28px', width: '40px', minWidth: 0, padding: '10px 12px' }}
|
||||||
onClick={onSettingsClick}
|
onClick={onSettingsClick}
|
||||||
|
onOKActionDescription={t('TitleView.settings_desc')}
|
||||||
>
|
>
|
||||||
<BsGearFill style={{ marginTop: '-4px', display: 'block' }} />
|
<BsGearFill style={{ marginTop: '-4px', display: 'block' }} />
|
||||||
</DialogButton>
|
</DialogButton>
|
||||||
|
|||||||
Reference in New Issue
Block a user