mirror of
https://github.com/SteamDeckHomebrew/decky-loader.git
synced 2026-06-15 10:04:03 +03:00
Add Plugin Reload Button to Settings (#128)
* feat: add reload button to plugin list Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net> * refactor: move plugin actions into context menu Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { DialogButton, staticClasses } from 'decky-frontend-lib';
|
||||
import { FaTrash } from 'react-icons/fa';
|
||||
import { DialogButton, Menu, MenuItem, showContextMenu, staticClasses } from 'decky-frontend-lib';
|
||||
import { FaEllipsisH } from 'react-icons/fa';
|
||||
|
||||
import { useDeckyState } from '../../../DeckyState';
|
||||
|
||||
@@ -22,9 +22,17 @@ export default function PluginList() {
|
||||
<div className={staticClasses.Title} style={{ marginLeft: 'auto', boxShadow: 'none' }}>
|
||||
<DialogButton
|
||||
style={{ height: '40px', width: '40px', padding: '10px 12px' }}
|
||||
onClick={() => window.DeckyPluginLoader.uninstallPlugin(name)}
|
||||
onClick={(e: MouseEvent) =>
|
||||
showContextMenu(
|
||||
<Menu label="Plugin Actions">
|
||||
<MenuItem onSelected={() => window.DeckyPluginLoader.importPlugin(name)}>Reload</MenuItem>
|
||||
<MenuItem onSelected={() => window.DeckyPluginLoader.uninstallPlugin(name)}>Uninstall</MenuItem>
|
||||
</Menu>,
|
||||
e.currentTarget ?? window,
|
||||
)
|
||||
}
|
||||
>
|
||||
<FaTrash />
|
||||
<FaEllipsisH />
|
||||
</DialogButton>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
Reference in New Issue
Block a user