Skip to content

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

chore: making the background of some dialog translucent

Ilian Sapundshiev3b60d9bd2435
diff --git a/src/renderer/components/dialogs/AboutDialog.tsx b/src/renderer/components/dialogs/AboutDialog.tsx
index 159a74dd5..a1f5a32a9 100644
--- a/src/renderer/components/dialogs/AboutDialog.tsx
+++ b/src/renderer/components/dialogs/AboutDialog.tsx
@@ -24,7 +24,6 @@ import DialogActions from '@mui/material/DialogActions';
import DialogContent from '@mui/material/DialogContent';
import DialogTitle from '@mui/material/DialogTitle';
import Tooltip from '-/components/Tooltip';
-import Dialog from '@mui/material/Dialog';
import semver from 'semver';
import DraggablePaper from '-/components/DraggablePaper';
import LogoIcon from '-/assets/images/icon100x100.svg';
@@ -40,6 +39,7 @@ import { openURLExternally } from '-/services/utils-io';
import { useTranslation } from 'react-i18next';
import { useLicenseDialogContext } from '-/components/dialogs/hooks/useLicenseDialogContext';
import { useThirdPartyLibsDialogContext } from '-/components/dialogs/hooks/useThirdPartyLibsDialogContext';
+import TranslucentDialog from './TranslucentDialog';
interface Props {
open: boolean;
@@ -117,7 +117,7 @@ function AboutDialog(props: Props) {
const theme = useTheme();
const fullScreen = useMediaQuery(theme.breakpoints.down('md'));
return (
- <Dialog
+ <TranslucentDialog
open={open}
onClose={onClose}
fullScreen={fullScreen}
@@ -271,7 +271,7 @@ function AboutDialog(props: Props) {
{t('core:ok')}
</Button>
</DialogActions>
- </Dialog>
+ </TranslucentDialog>
);
}
diff --git a/src/renderer/components/dialogs/TranslucentDialog.tsx b/src/renderer/components/dialogs/TranslucentDialog.tsx
new file mode 100644
index 000000000..308d44ae3
--- /dev/null
+++ b/src/renderer/components/dialogs/TranslucentDialog.tsx
@@ -0,0 +1,30 @@
+/**
+ * TagSpaces - universal file and folder organizer
+ * Copyright (C) 2024-present TagSpaces GmbH
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License (version 3) as
+ * published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+import React, { useState, useEffect, useRef } from 'react';
+import { alpha, useTheme, styled } from '@mui/material/styles';
+import Dialog from '@mui/material/Dialog';
+
+const TranslucentDialog = styled(Dialog)(({ theme }) => ({
+ '& .MuiDialog-paper': {
+ background: alpha(theme.palette.background.default, 0.8),
+ backdropFilter: 'blur(5px)',
+ },
+})) as typeof Dialog;
+
+export default TranslucentDialog;
diff --git a/src/renderer/components/dialogs/settings/SettingsDialog.tsx b/src/renderer/components/dialogs/settings/SettingsDialog.tsx
index b7149b6b3..538b94833 100644
--- a/src/renderer/components/dialogs/settings/SettingsDialog.tsx
+++ b/src/renderer/components/dialogs/settings/SettingsDialog.tsx
@@ -25,7 +25,6 @@ import { useTheme } from '@mui/material/styles';
import AppBar from '@mui/material/AppBar';
import Tabs from '@mui/material/Tabs';
import Tab from '@mui/material/Tab';
-import Dialog from '@mui/material/Dialog';
import DialogActions from '@mui/material/DialogActions';
import DialogContent from '@mui/material/DialogContent';
import DialogTitle from '@mui/material/DialogTitle';
@@ -41,19 +40,7 @@ import SettingsExtensions from '-/components/dialogs/settings/SettingsExtensions
import { openURLExternally } from '-/services/utils-io';
import { useTranslation } from 'react-i18next';
import AppConfig from '-/AppConfig';
-
-const PREFIX = 'SettingsDialog';
-
-const classes = {
- mainContent: `${PREFIX}-mainContent`,
-};
-
-const StyledDialog = styled(Dialog)(() => ({
- [`& .${classes.mainContent}`]: {
- overflowY: 'auto',
- overflowX: 'hidden',
- },
-}));
+import TranslucentDialog from '-/components/dialogs/TranslucentDialog';
interface Props {
open: boolean;
@@ -108,7 +95,12 @@ function SettingsDialog(props: Props) {
);
const renderContent = () => (
- <DialogContent className={classes.mainContent}>
+ <DialogContent
+ style={{
+ overflowY: 'auto',
+ overflowX: 'hidden',
+ }}
+ >
{isResetSettingsDialogOpened && (
<ConfirmDialog
open={isResetSettingsDialogOpened}
@@ -140,7 +132,7 @@ function SettingsDialog(props: Props) {
/>
)}
- <div data-tid="settingsDialog" className={classes.mainContent}>
+ <div data-tid="settingsDialog">
{currentTab === 0 && <SettingsGeneral />}
{currentTab === 1 && <SettingsFileTypes />}
{currentTab === 2 && <SettingsKeyBindings />}
@@ -186,7 +178,7 @@ function SettingsDialog(props: Props) {
const theme = useTheme();
const fullScreen = useMediaQuery(theme.breakpoints.down('md'));
return (
- <StyledDialog
+ <TranslucentDialog
fullScreen={fullScreen}
open={open}
keepMounted
@@ -196,7 +188,7 @@ function SettingsDialog(props: Props) {
{renderTitle()}
{renderContent()}
{renderActions()}
- </StyledDialog>
+ </TranslucentDialog>
);
}