Skip to content

TagSpaces is an offline, open source, document manager with tagging support

fix: dragable about and add tags dialogs

Ilian Sapundshiev059a11f8760e
diff --git a/app/components/dialogs/AboutDialog.tsx b/app/components/dialogs/AboutDialog.tsx
index 53e358fc1..1c79152a6 100644
--- a/app/components/dialogs/AboutDialog.tsx
+++ b/app/components/dialogs/AboutDialog.tsx
@@ -17,7 +17,9 @@
*/
import React, { useState } from 'react';
+import Draggable from 'react-draggable';
import Button from '@mui/material/Button';
+import Paper, { PaperProps } from '@mui/material/Paper';
import Typography from '@mui/material/Typography';
import DialogActions from '@mui/material/DialogActions';
import DialogContent from '@mui/material/DialogContent';
@@ -43,6 +45,17 @@ interface Props {
onClose: () => void;
}
+function PaperComponent(props: PaperProps) {
+ return (
+ <Draggable
+ handle="#draggable-dialog-title"
+ cancel={'[class*="MuiDialogContent-root"]'}
+ >
+ <Paper {...props} />
+ </Draggable>
+ );
+}
+
let buildID = versionMeta.commitId;
if (buildID && buildID.length >= 11) {
buildID = buildID.slice(0, 11);
@@ -101,8 +114,10 @@ function AboutDialog(props: Props) {
fullScreen={fullScreen}
keepMounted
scroll="paper"
+ PaperComponent={fullScreen ? Paper : PaperComponent}
+ aria-labelledby="draggable-dialog-title"
>
- <DialogTitle>
+ <DialogTitle style={{ cursor: 'move' }} id="draggable-dialog-title">
{productName}
<DialogCloseButton onClose={onClose} />
</DialogTitle>
diff --git a/app/components/dialogs/AddRemoveTagsDialog.tsx b/app/components/dialogs/AddRemoveTagsDialog.tsx
index a0e51e4b3..c8187fa71 100644
--- a/app/components/dialogs/AddRemoveTagsDialog.tsx
+++ b/app/components/dialogs/AddRemoveTagsDialog.tsx
@@ -130,8 +130,9 @@ function AddRemoveTagsDialog(props: Props) {
keepMounted
scroll="paper"
PaperComponent={fullScreen ? Paper : PaperComponent}
+ aria-labelledby="draggable-dialog-title"
>
- <DialogTitle id="draggable-dialog-title">
+ <DialogTitle style={{ cursor: 'move' }} id="draggable-dialog-title">
{i18n.t('core:tagOperationTitle')}
<DialogCloseButton onClose={onClose} />
</DialogTitle>