添加可以选择悬浮按钮单击操作的设置选项 (#313)

* Add an option in Settings to provide choices for the FAB Single Click action.

* Complete Translation

---------

Co-authored-by: 1030283726 <1030283726@qq.com>
This commit is contained in:
Zack C
2025-09-21 00:50:39 +10:00
committed by GitHub
parent d39a016d5f
commit 563242c5f1
4 changed files with 40 additions and 3 deletions

View File

@@ -33,6 +33,8 @@ export default function Action({ translator, fab }) {
});
const [moved, setMoved] = useState(false);
const { fabClickAction = 0 } = fab || {};
const handleWindowResize = useMemo(
() =>
debounce(() => {
@@ -215,7 +217,14 @@ export default function Action({ translator, fab }) {
color="primary"
onClick={(e) => {
if (!moved) {
setShowPopup((pre) => !pre);
if (fabClickAction === 1) {
translator.toggle();
sendIframeMsg(MSG_TRANS_TOGGLE);
setShowPopup(false);
}
else {
setShowPopup((pre) => !pre);
}
}
}}
>