Skip to content

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

fear: making some dialogs movable

Ilian Sapundshievbf175ef19e5d
diff --git a/app/components/dialogs/ConfirmDialog.tsx b/app/components/dialogs/ConfirmDialog.tsx
index 1fc4ae076..e190487d9 100644
--- a/app/components/dialogs/ConfirmDialog.tsx
+++ b/app/components/dialogs/ConfirmDialog.tsx
@@ -22,6 +22,7 @@ import DialogActions from '@mui/material/DialogActions';
import DialogContent from '@mui/material/DialogContent';
import DialogTitle from '@mui/material/DialogTitle';
import DialogContentText from '@mui/material/DialogContentText';
+import DraggablePaper from '-/components/DraggablePaper';
import List from '@mui/material/List';
import ListItem from '@mui/material/ListItem';
import BulletIcon from '@mui/icons-material/Remove';
@@ -52,8 +53,15 @@ function ConfirmDialog(props: Props) {
}
return (
- <Dialog open={open} onClose={onClose} keepMounted scroll="paper">
- <DialogTitle>
+ <Dialog
+ aria-labelledby="draggable-dialog-title"
+ PaperComponent={DraggablePaper}
+ open={open}
+ onClose={onClose}
+ keepMounted
+ scroll="paper"
+ >
+ <DialogTitle style={{ cursor: 'move' }} id="draggable-dialog-title">
{props.title}
<DialogCloseButton onClose={onClose} />
</DialogTitle>
diff --git a/app/components/dialogs/CreateDialog.tsx b/app/components/dialogs/CreateDialog.tsx
index 6bb7036bc..f8c7b0669 100644
--- a/app/components/dialogs/CreateDialog.tsx
+++ b/app/components/dialogs/CreateDialog.tsx
@@ -28,6 +28,8 @@ import DialogTitle from '@mui/material/DialogTitle';
import Grid from '@mui/material/Grid';
import withStyles from '@mui/styles/withStyles';
import Dialog from '@mui/material/Dialog';
+import Paper from '@mui/material/Paper';
+import DraggablePaper from '-/components/DraggablePaper';
import { Progress } from 'aws-sdk/clients/s3';
import { formatDateTime4Tag } from '@tagspaces/tagspaces-common/misc';
import AppConfig from '-/AppConfig';
@@ -315,9 +317,11 @@ function CreateDialog(props: Props) {
onClose={onClose}
fullScreen={fullScreen}
keepMounted
+ aria-labelledby="draggable-dialog-title"
+ PaperComponent={fullScreen ? Paper : DraggablePaper}
scroll="paper"
>
- <DialogTitle>
+ <DialogTitle style={{ cursor: 'move' }} id="draggable-dialog-title">
{i18n.t('core:create') + '...'}
<DialogCloseButton onClose={onClose} />
</DialogTitle>
diff --git a/app/components/dialogs/FilePreviewDialog.tsx b/app/components/dialogs/FilePreviewDialog.tsx
index 8741fd4d2..dac0561ab 100644
--- a/app/components/dialogs/FilePreviewDialog.tsx
+++ b/app/components/dialogs/FilePreviewDialog.tsx
@@ -23,6 +23,7 @@ import DialogTitle from '@mui/material/DialogTitle';
import Dialog from '@mui/material/Dialog';
import DialogCloseButton from '-/components/dialogs/DialogCloseButton';
import { extractContainingDirectoryPath } from '@tagspaces/tagspaces-common/paths';
+import DraggablePaper from '-/components/DraggablePaper';
import { actions as AppActions, OpenedEntry } from '-/reducers/app';
import { TS } from '-/tagspaces.namespace';
import { findExtensionsForEntry } from '-/services/utils-io';
@@ -182,10 +183,16 @@ function FilePreviewDialog(props: Props) {
scroll="paper"
fullWidth
maxWidth="md"
+ aria-labelledby="draggable-dialog-title"
+ PaperComponent={DraggablePaper}
PaperProps={{ sx: { width: '100%', height: '100%' } }}
BackdropProps={{ style: { backgroundColor: 'transparent' } }}
>
- <DialogTitle data-tid="importDialogTitle">
+ <DialogTitle
+ data-tid="importDialogTitle"
+ style={{ cursor: 'move' }}
+ id="draggable-dialog-title"
+ >
{/*{i18n.t('core:importDialogTitle')}*/}
<DialogCloseButton onClose={onClose} />
</DialogTitle>
diff --git a/app/components/dialogs/FileUploadDialog.tsx b/app/components/dialogs/FileUploadDialog.tsx
index 6f25cd75b..b1ee5d476 100644
--- a/app/components/dialogs/FileUploadDialog.tsx
+++ b/app/components/dialogs/FileUploadDialog.tsx
@@ -31,6 +31,7 @@ import Box from '@mui/material/Box';
import { LinearProgress, Grid, Tooltip } from '@mui/material';
import WarningIcon from '@mui/icons-material/Warning';
import PlatformIO from '-/services/platform-facade';
+import DraggablePaper from '-/components/DraggablePaper';
import {
actions as AppActions,
getCurrentDirectoryPerspective,
@@ -147,9 +148,15 @@ function FileUploadDialog(props: Props) {
scroll="paper"
fullWidth={true}
maxWidth="sm"
+ aria-labelledby="draggable-dialog-title"
+ PaperComponent={DraggablePaper}
BackdropProps={{ style: { backgroundColor: 'transparent' } }}
>
- <DialogTitle data-tid="importDialogTitle">
+ <DialogTitle
+ data-tid="importDialogTitle"
+ style={{ cursor: 'move' }}
+ id="draggable-dialog-title"
+ >
{i18n.t(
'core:' +
(props.title && props.title.length > 0
diff --git a/app/components/dialogs/ProgressDialog.tsx b/app/components/dialogs/ProgressDialog.tsx
index 549ede2fc..dc3b932bc 100644
--- a/app/components/dialogs/ProgressDialog.tsx
+++ b/app/components/dialogs/ProgressDialog.tsx
@@ -21,6 +21,7 @@ import DialogContent from '@mui/material/DialogContent';
import DialogTitle from '@mui/material/DialogTitle';
import Dialog from '@mui/material/Dialog';
import { CircularProgress } from '@mui/material';
+import DraggablePaper from '-/components/DraggablePaper';
import DialogCloseButton from '-/components/dialogs/DialogCloseButton';
interface Props {
@@ -30,8 +31,17 @@ interface Props {
function ProgressDialog(props: Props) {
return (
- <Dialog open={props.open} onClose={props.onClose}>
- <DialogTitle data-tid="progressDialogTitle">
+ <Dialog
+ aria-labelledby="draggable-dialog-title"
+ PaperComponent={DraggablePaper}
+ open={props.open}
+ onClose={props.onClose}
+ >
+ <DialogTitle
+ style={{ cursor: 'move' }}
+ data-tid="progressDialogTitle"
+ id="draggable-dialog-title"
+ >
<DialogCloseButton onClose={props.onClose} />
</DialogTitle>
<DialogContent