Skip to content

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

chore: small improvement in dialogs

Ilian Sapundshievc9b2ada40527
diff --git a/src/renderer/components/dialogs/CreateDirectoryDialog.tsx b/src/renderer/components/dialogs/CreateDirectoryDialog.tsx
index a68812d04..bb27f22d3 100644
--- a/src/renderer/components/dialogs/CreateDirectoryDialog.tsx
+++ b/src/renderer/components/dialogs/CreateDirectoryDialog.tsx
@@ -16,6 +16,7 @@
*
*/
+import AppConfig from '-/AppConfig';
import DraggablePaper from '-/components/DraggablePaper';
import TsButton from '-/components/TsButton';
import TsIconButton from '-/components/TsIconButton';
@@ -76,37 +77,6 @@ function CreateDirectoryDialog(props: Props) {
const [ignored, forceUpdate] = useReducer((x) => x + 1, 0, undefined);
const { open, onClose, selectedDirectoryPath, skipSelection } = props;
- const defaultBackgrounds = [
- 'transparent',
- // '#00000044',
- '#ac725e44',
- '#f83a2244',
- // '#ff753744',
- '#ffad4644',
- '#42d69244',
- // '#00800044',
- '#7bd14844',
- '#fad16544',
- '#92e1c044',
- '#9fe1e744',
- '#9fc6e744',
- '#4986e744',
- '#9a9cff44',
- '#c2c2c244',
- '#cca6ac44',
- '#f691b244',
- // '#cd74e644',
- // '#a47ae244',
- // '#845EC260',
- // '#D65DB160',
- // '#FF6F9160',
- // '#FF967160',
- // '#FFC75F60',
- // '#F9F87160',
- // '#008E9B60',
- // '#008F7A60',
- ];
-
function handleValidation(dirName) {
if (!dirNameValidation(dirName)) {
setInputError(false);
@@ -247,8 +217,15 @@ function CreateDirectoryDialog(props: Props) {
readOnly: true,
endAdornment: (
<InputAdornment position="end" sx={{ height: '300px' }}>
- <Box sx={{ padding: '10px', width: '300px' }}>
- {defaultBackgrounds.map((background, cnt) => (
+ <Box
+ sx={{
+ margin: '10px',
+ width: '400px',
+ height: '200px',
+ overflow: 'auto',
+ }}
+ >
+ {AppConfig.backgroundColors.map((background, cnt) => (
<React.Fragment key={cnt}>
<TsIconButton
tooltip={background}
diff --git a/src/renderer/components/dialogs/EditTagDialog.tsx b/src/renderer/components/dialogs/EditTagDialog.tsx
index ed30a8154..13bed3713 100644
--- a/src/renderer/components/dialogs/EditTagDialog.tsx
+++ b/src/renderer/components/dialogs/EditTagDialog.tsx
@@ -16,14 +16,18 @@
*
*/
+import AppConfig from '-/AppConfig';
+import DraggablePaper from '-/components/DraggablePaper';
import Tag from '-/components/Tag';
+import TransparentBackground from '-/components/TransparentBackground';
import TsButton from '-/components/TsButton';
import TsTextField from '-/components/TsTextField';
+import ColorPickerDialog from '-/components/dialogs/ColorPickerDialog';
import TsDialogActions from '-/components/dialogs/components/TsDialogActions';
import TsDialogTitle from '-/components/dialogs/components/TsDialogTitle';
import { useTaggingActionsContext } from '-/hooks/useTaggingActionsContext';
import { TS } from '-/tagspaces.namespace';
-import { useTheme } from '@mui/material';
+import { Paper, useTheme } from '@mui/material';
import Dialog from '@mui/material/Dialog';
import DialogContent from '@mui/material/DialogContent';
import FormControl from '@mui/material/FormControl';
@@ -34,8 +38,6 @@ import useMediaQuery from '@mui/material/useMediaQuery';
import { format } from 'date-fns';
import React, { useEffect, useState } from 'react';
import { useTranslation } from 'react-i18next';
-import TransparentBackground from '../TransparentBackground';
-import ColorPickerDialog from './ColorPickerDialog';
interface Props {
open: boolean;
@@ -134,6 +136,7 @@ function EditTagDialog(props: Props) {
<Dialog
open={open}
fullScreen={smallScreen}
+ PaperComponent={smallScreen ? Paper : DraggablePaper}
onClose={onClose}
keepMounted
scroll="paper"
@@ -210,7 +213,7 @@ function EditTagDialog(props: Props) {
data-tid="tagBackgroundColorEditTagDialog"
sx={{
height: '30px',
- borderRadius: '2px',
+ borderRadius: AppConfig.defaultCSSRadius,
borderWidth: '1px',
borderStyle: 'solid',
borderColor: 'gray',
@@ -239,7 +242,7 @@ function EditTagDialog(props: Props) {
data-tid="tagForegroundColorEditTagDialog"
sx={{
height: '30px',
- borderRadius: '2px',
+ borderRadius: AppConfig.defaultCSSRadius,
borderWidth: '1px',
borderStyle: 'solid',
borderColor: 'gray',