Skip to content

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

chore: redesigning tstextfields

Ilian Sapundshiev981003abb2d9
diff --git a/src/renderer/components/EntryProperties.tsx b/src/renderer/components/EntryProperties.tsx
index 5c6d70dce..26c23bc28 100644
--- a/src/renderer/components/EntryProperties.tsx
+++ b/src/renderer/components/EntryProperties.tsx
@@ -165,7 +165,6 @@ const Root = styled('div')(({ theme }) => ({
}));
const ThumbnailTextField = styled(TextField)(({ theme }) => ({
- //[`& .MuiInputBase-root}`]: {
[`& .${inputBaseClasses.root}`]: {
height: 220,
},
@@ -635,7 +634,7 @@ function EntryProperties(props: Props) {
onChange={handleFileNameChange}
/>
{fileNameError.current && (
- <FormHelperText>
+ <FormHelperText style={{ marginTop: 0 }}>
{t(
'core:' +
(openedEntry.isFile ? 'fileNameHelp' : 'directoryNameHelp'),
@@ -643,7 +642,7 @@ function EntryProperties(props: Props) {
</FormHelperText>
)}
</Grid>
- <Grid item xs={12} style={{ marginTop: 10 }}>
+ <Grid item xs={12}>
<TagDropContainer entryPath={openedEntry.path}>
<TagsSelect
label={t('core:fileTags')}
@@ -948,7 +947,7 @@ function EntryProperties(props: Props) {
</Grid>
{!openedEntry.isFile && (
- <Grid item xs={12} style={{ marginTop: 10 }}>
+ <Grid item xs={12}>
<PerspectiveSelector
onChange={changePerspective}
defaultValue={perspectiveDefault}
@@ -966,7 +965,7 @@ function EntryProperties(props: Props) {
InputProps={{
readOnly: true,
startAdornment: (
- <InputAdornment position="start" style={{ marginTop: 14 }}>
+ <InputAdornment position="start">
<TransparentBackground>
<Tooltip title={t('editBackgroundColor')}>
<Button
@@ -1065,10 +1064,11 @@ function EntryProperties(props: Props) {
)}
<Grid container item xs={12} spacing={1}>
<Grid item xs={openedEntry.isFile ? 12 : 6}>
+ <FormHelperText>{t('core:thumbnail')}</FormHelperText>
<ThumbnailTextField
margin="dense"
- label={t('core:thumbnail')}
- variant="filled"
+ variant="outlined"
+ style={{ marginTop: 0 }}
fullWidth
InputProps={{
readOnly: true,
@@ -1116,11 +1116,12 @@ function EntryProperties(props: Props) {
</Grid>
{!openedEntry.isFile && (
<Grid item xs={6}>
+ <FormHelperText>{t('core:backgroundImage')}</FormHelperText>
<ThumbnailTextField
margin="dense"
- label={t('core:backgroundImage')}
fullWidth
- variant="filled"
+ style={{ marginTop: 0 }}
+ variant="outlined"
InputProps={{
readOnly: true,
startAdornment: (
diff --git a/src/renderer/components/SearchPopover.tsx b/src/renderer/components/SearchPopover.tsx
index 345cd2e7f..77c6b189b 100644
--- a/src/renderer/components/SearchPopover.tsx
+++ b/src/renderer/components/SearchPopover.tsx
@@ -26,9 +26,10 @@ import MenuItem from '@mui/material/MenuItem';
import Tooltip from '-/components/Tooltip';
import Button from '@mui/material/Button';
import Grid from '@mui/material/Grid';
-import FilledInput from '@mui/material/FilledInput';
+import OutlinedInput from '@mui/material/OutlinedInput';
import TsTextField from '-/components/TsTextField';
import InputLabel from '@mui/material/InputLabel';
+import FormHelperText from '@mui/material/FormHelperText';
import InputAdornment from '@mui/material/InputAdornment';
import { InfoTooltipIcon } from '-/components/CommonIcons';
import IconButton from '@mui/material/IconButton';
@@ -545,16 +546,9 @@ function SearchPopover(props: Props) {
variant="outlined"
style={{ width: '100%', marginTop: 6 }}
>
- <InputLabel
- id="saved-searches"
- style={{
- padding: 3,
- borderRadius: 4,
- backgroundColor: theme.palette.background.default,
- }}
- >
+ <FormHelperText style={{ marginLeft: 0 }}>
{t('core:savedSearchesTitle')}
- </InputLabel>
+ </FormHelperText>
<Select
name="savedSearch"
labelId="saved-searches"
@@ -563,7 +557,7 @@ function SearchPopover(props: Props) {
onChange={handleSavedSearchChange}
displayEmpty
fullWidth
- variant="filled"
+ variant="outlined"
value={searchQuery.uuid ? searchQuery.uuid : -1}
>
<MenuItem value={-1} style={{ display: 'none' }} />
@@ -796,14 +790,16 @@ function SearchPopover(props: Props) {
disabled={isIndexing !== undefined || !Pro}
>
<ProTooltip tooltip={t('filterByTypTooltip')}>
- <InputLabel htmlFor="file-type">{t('core:fileType')}</InputLabel>
+ <FormHelperText style={{ marginLeft: 0 }}>
+ {t('core:fileType')}
+ </FormHelperText>
<Select
fullWidth
value={JSON.stringify(fileTypes.current)}
onChange={handleFileTypeChange}
size={desktopMode ? 'small' : 'medium'}
input={
- <FilledInput
+ <OutlinedInput
name="fileTypes"
id="file-type"
// label={t('core:fileType')}
@@ -920,20 +916,16 @@ function SearchPopover(props: Props) {
disabled={isIndexing !== undefined || !Pro}
>
<ProTooltip tooltip={t('filterBySizeTooltip')}>
- <InputLabel
- style={{ backgroundColor: theme.palette.background.default }}
- shrink
- htmlFor="file-size"
- >
+ <FormHelperText style={{ marginLeft: 0 }}>
{t('core:sizeSearchTitle')}
- </InputLabel>
+ </FormHelperText>
<Select
fullWidth
value={fileSize.current}
onChange={handleFileSizeChange}
size={desktopMode ? 'small' : 'medium'}
input={
- <FilledInput
+ <OutlinedInput
name="fileSize"
id="file-size"
// label={t('core:sizeSearchTitle')}
@@ -975,20 +967,16 @@ function SearchPopover(props: Props) {
disabled={isIndexing !== undefined || !Pro}
>
<ProTooltip tooltip={t('filterByLastModifiedDateTooltip')}>
- <InputLabel
- style={{ backgroundColor: theme.palette.background.default }}
- shrink
- htmlFor="modification-date"
- >
+ <FormHelperText style={{ marginLeft: 0 }}>
{t('core:lastModifiedSearchTitle')}
- </InputLabel>
+ </FormHelperText>
<Select
fullWidth
value={lastModified.current}
onChange={handleLastModifiedChange}
size={desktopMode ? 'small' : 'medium'}
input={
- <FilledInput
+ <OutlinedInput
name="lastModified"
id="modification-date"
// label={t('core:lastModifiedSearchTitle')}
@@ -1014,40 +1002,48 @@ function SearchPopover(props: Props) {
/*utils={DateFnsUtils}*/
>
<Box position="relative" display="inline-flex">
- <DatePicker
- label={t('enterTagTimePeriodFrom')}
- disabled={isIndexing !== undefined || !Pro}
- inputFormat="yyyy-MM-dd"
- value={tagTimePeriodFrom && new Date(tagTimePeriodFrom)}
- onChange={(fromDataTime: Date) => {
- if (fromDataTime) {
- setSearchQuery({
- ...searchQuery,
- tagTimePeriodFrom: fromDataTime.getTime(),
- executeSearch: false,
- });
- }
- }}
- renderInput={(params) => <TsTextField {...params} />}
- />
- <DatePicker
- label={t('enterTagTimePeriodTo')}
- disabled={isIndexing !== undefined || !Pro}
- inputFormat="yyyy-MM-dd"
- value={tagTimePeriodTo && new Date(tagTimePeriodTo)}
- onChange={(toDataTime: Date) => {
- if (toDataTime) {
- setSearchQuery({
- ...searchQuery,
- tagTimePeriodTo: toDataTime.getTime(),
- executeSearch: false,
- });
- }
- }}
- renderInput={(params) => (
- <TsTextField style={{ marginLeft: 5 }} {...params} />
- )}
- />
+ <div>
+ <FormHelperText style={{ marginLeft: 0, marginTop: 0 }}>
+ {t('core:enterTagTimePeriodFrom')}
+ </FormHelperText>
+ <DatePicker
+ // label={t('enterTagTimePeriodFrom')}
+ disabled={isIndexing !== undefined || !Pro}
+ inputFormat="yyyy-MM-dd"
+ value={tagTimePeriodFrom && new Date(tagTimePeriodFrom)}
+ onChange={(fromDataTime: Date) => {
+ if (fromDataTime) {
+ setSearchQuery({
+ ...searchQuery,
+ tagTimePeriodFrom: fromDataTime.getTime(),
+ executeSearch: false,
+ });
+ }
+ }}
+ renderInput={(params) => <TsTextField {...params} />}
+ />
+ </div>
+ <div style={{ marginLeft: 5 }}>
+ <FormHelperText style={{ marginLeft: 0, marginTop: 0 }}>
+ {t('core:enterTagTimePeriodTo')}
+ </FormHelperText>
+ <DatePicker
+ // label={t('enterTagTimePeriodTo')}
+ disabled={isIndexing !== undefined || !Pro}
+ inputFormat="yyyy-MM-dd"
+ value={tagTimePeriodTo && new Date(tagTimePeriodTo)}
+ onChange={(toDataTime: Date) => {
+ if (toDataTime) {
+ setSearchQuery({
+ ...searchQuery,
+ tagTimePeriodTo: toDataTime.getTime(),
+ executeSearch: false,
+ });
+ }
+ }}
+ renderInput={(params) => <TsTextField {...params} />}
+ />
+ </div>
</Box>
</LocalizationProvider>
</ProTooltip>
diff --git a/src/renderer/components/TagsSelect.tsx b/src/renderer/components/TagsSelect.tsx
index f7757267a..132be0ad7 100644
--- a/src/renderer/components/TagsSelect.tsx
+++ b/src/renderer/components/TagsSelect.tsx
@@ -198,10 +198,11 @@ function TagsSelect(props: Props) {
)}
renderInput={(params) => (
<>
+ <FormHelperText style={{ marginLeft: 0 }}>{label}</FormHelperText>
<TextField
{...params}
- variant="filled"
- label={label}
+ variant="outlined"
+ label={undefined}
placeholder={placeholderText}
margin="normal"
autoFocus={autoFocus}
diff --git a/src/renderer/components/TsTextField.tsx b/src/renderer/components/TsTextField.tsx
index 076603921..470c5531d 100644
--- a/src/renderer/components/TsTextField.tsx
+++ b/src/renderer/components/TsTextField.tsx
@@ -21,6 +21,7 @@ import React, { useState, useRef, useEffect } from 'react';
import TextField, { TextFieldProps } from '@mui/material/TextField';
import Menu from '@mui/material/Menu';
import MenuItem from '@mui/material/MenuItem';
+import FormHelperText from '@mui/material/FormHelperText';
import MenuList from '@mui/material/MenuList';
import ListItemText from '@mui/material/ListItemText';
import MenuKeyBinding from '-/components/menus/MenuKeyBinding';
@@ -33,7 +34,7 @@ type TSTextFieldProps = TextFieldProps & {
};
function TsTextField(props: TSTextFieldProps) {
- const { updateValue, retrieveValue, children } = props;
+ const { updateValue, retrieveValue, children, label } = props;
const { t } = useTranslation();
// const desktopMode = useSelector(isDesktopMode);
const textFieldRef = useRef(null);
@@ -95,15 +96,19 @@ function TsTextField(props: TSTextFieldProps) {
return (
<>
+ <FormHelperText style={{ marginLeft: 0, marginTop: 0 }}>
+ {label}
+ </FormHelperText>
<TextField
onContextMenu={handleContextMenu}
- style={{ cursor: 'context-menu' }}
+ style={{ cursor: 'context-menu', marginTop: 0 }}
margin="dense"
- // size={desktopMode ? 'small' : 'medium'}
- variant="filled"
+ size="small" //{desktopMode ? 'small' : 'medium'}
+ variant="outlined"
fullWidth={true}
ref={textFieldRef}
{...props}
+ label={undefined}
>
{children}
</TextField>
diff --git a/src/renderer/components/dialogs/CreateEditLocationDialog.tsx b/src/renderer/components/dialogs/CreateEditLocationDialog.tsx
index ef2a3f075..561c6e783 100644
--- a/src/renderer/components/dialogs/CreateEditLocationDialog.tsx
+++ b/src/renderer/components/dialogs/CreateEditLocationDialog.tsx
@@ -36,7 +36,6 @@ import ListItem from '@mui/material/ListItem';
import ListItemIcon from '@mui/material/ListItemIcon';
import ListItemText from '@mui/material/ListItemText';
import TsTextField from '-/components/TsTextField';
-import Input from '@mui/material/Input';
import ToggleButtonGroup from '@mui/material/ToggleButtonGroup';
import ToggleButton from '@mui/material/ToggleButton';
import CheckIcon from '@mui/icons-material/Check';
@@ -50,7 +49,6 @@ import {
Accordion,
AccordionDetails,
AccordionSummary,
- InputLabel,
MenuItem,
FormLabel,
Select,
@@ -91,8 +89,7 @@ const classes = {
const StyledDialog = styled(Dialog)(({ theme }) => ({
[`& .${classes.formControl}`]: {
- marginLeft: theme.spacing(0),
- width: '100%',
+ marginLeft: 0,
},
}));
@@ -652,17 +649,17 @@ function CreateEditLocationDialog(props: Props) {
{!selectedLocation && (
<FormControl disabled={disableLocationTypeSwitch} fullWidth>
{/* <InputLabel id="locationLabelID">
- {t('core:locationType')}
- </InputLabel> */}
+ {t('core:locationType')}
+ </InputLabel> */}
<Select
labelId="locationLabelID"
data-tid="locationTypeTID"
value={type}
- label={t('core:locationType')}
+ // label={t('core:locationType')}
onChange={(event: ChangeEvent<HTMLInputElement>) =>
setType(event.target.value)
}
- variant="filled"
+ variant="outlined"
>
{!AppConfig.isWeb && (
<MenuItem
@@ -859,12 +856,10 @@ function CreateEditLocationDialog(props: Props) {
labelPlacement="start"
style={{ justifyContent: 'space-between' }}
control={
- <Input
+ <TsTextField
name="maxIndexAge"
style={{
- maxWidth: 70,
- marginLeft: 15,
- marginBottom: 15,
+ width: 100,
}}
type="number"
data-tid="maxIndexAgeTID"
diff --git a/src/renderer/components/dialogs/EditTagDialog.tsx b/src/renderer/components/dialogs/EditTagDialog.tsx
index 5368b30cb..03af78cd1 100644
--- a/src/renderer/components/dialogs/EditTagDialog.tsx
+++ b/src/renderer/components/dialogs/EditTagDialog.tsx
@@ -24,6 +24,8 @@ import DialogContent from '@mui/material/DialogContent';
import DialogTitle from '@mui/material/DialogTitle';
import FormControl from '@mui/material/FormControl';
import FormHelperText from '@mui/material/FormHelperText';
+import ListItem from '@mui/material/ListItem';
+import ListItemText from '@mui/material/ListItemText/ListItemText';
import Dialog from '@mui/material/Dialog';
import ColorPickerDialog from './ColorPickerDialog';
import Tag from '-/components/Tag';
@@ -108,32 +110,6 @@ function EditTagDialog(props: Props) {
};
const { open, onClose } = props;
- const styles = {
- color: {
- width: '100%',
- height: 30,
- borderRadius: 2,
- borderWidth: 1,
- borderStyle: 'solid',
- borderColor: 'gray',
- padding: '5px',
- background: color,
- },
- textcolor: {
- width: '100%',
- height: 30,
- borderRadius: 2,
- borderWidth: 1,
- borderStyle: 'solid',
- borderColor: 'gray',
- padding: '5px',
- background: textcolor,
- },
- helpText: {
- marginBottom: '5px',
- fontSize: '1rem',
- },
- };
// const theme = useTheme();
// const fullScreen = useMediaQuery(theme.breakpoints.down('md'));
@@ -205,12 +181,10 @@ function EditTagDialog(props: Props) {
data-tid="editTagInput"
/>
{inputError && (
- <FormHelperText style={styles.helpText}>
- {t('core:tagTitleHelper')}
- </FormHelperText>
+ <FormHelperText>{t('core:tagTitleHelper')}</FormHelperText>
)}
</FormControl>
- <FormControl fullWidth={true} style={{ overflow: 'visible' }}>
+ <FormControl fullWidth={true}>
<TsTextField
name="description"
label={t('core:editDescription')}
@@ -219,15 +193,21 @@ function EditTagDialog(props: Props) {
data-tid="editTagDescription"
/>
</FormControl>
- <FormControl fullWidth={true}>
- <FormHelperText style={styles.helpText}>
- {t('core:tagBackgroundColor')}
- </FormHelperText>
+ <ListItem style={{ paddingLeft: 0, paddingRight: 0 }}>
+ <ListItemText primary={t('core:tagBackgroundColor')} />
<TransparentBackground>
<Button
onClick={() => setDisplayColorPicker(!displayColorPicker)}
data-tid="tagBackgroundColorEditTagDialog"
- style={styles.color}
+ style={{
+ height: 30,
+ borderRadius: 2,
+ borderWidth: 1,
+ borderStyle: 'solid',
+ borderColor: 'gray',
+ padding: '5px',
+ background: color,
+ }}
role="presentation"
>
&nbsp;
@@ -241,16 +221,22 @@ function EditTagDialog(props: Props) {
color={color}
/>
)}
- </FormControl>
- <FormControl fullWidth={true}>
- <FormHelperText style={styles.helpText}>
- {t('core:tagForegroundColor')}
- </FormHelperText>
+ </ListItem>
+ <ListItem style={{ paddingLeft: 0, paddingRight: 0 }}>
+ <ListItemText primary={t('core:tagForegroundColor')} />
<TransparentBackground>
<Button
onClick={() => setDisplayTextColorPicker(!displayTextColorPicker)}
data-tid="tagForegroundColorEditTagDialog"
- style={styles.textcolor}
+ style={{
+ height: 30,
+ borderRadius: 2,
+ borderWidth: 1,
+ borderStyle: 'solid',
+ borderColor: 'gray',
+ padding: '5px',
+ background: textcolor,
+ }}
role="presentation"
>
&nbsp;
@@ -264,7 +250,7 @@ function EditTagDialog(props: Props) {
color={textcolor}
/>
)}
- </FormControl>
+ </ListItem>
</DialogContent>
<DialogActions>
<Button onClick={props.onClose} data-tid="closeEditTagDialog">
diff --git a/src/renderer/components/dialogs/EditTagGroupDialog.tsx b/src/renderer/components/dialogs/EditTagGroupDialog.tsx
index 2a82de802..48d6157df 100644
--- a/src/renderer/components/dialogs/EditTagGroupDialog.tsx
+++ b/src/renderer/components/dialogs/EditTagGroupDialog.tsx
@@ -23,9 +23,10 @@ import DialogContent from '@mui/material/DialogContent';
import DialogTitle from '@mui/material/DialogTitle';
import FormControl from '@mui/material/FormControl';
import FormHelperText from '@mui/material/FormHelperText';
+import ListItem from '@mui/material/ListItem';
+import ListItemText from '@mui/material/ListItemText/ListItemText';
import Switch from '@mui/material/Switch';
import Dialog from '@mui/material/Dialog';
-import Select from '@mui/material/Select';
import MenuItem from '@mui/material/MenuItem';
import { useSelector } from 'react-redux';
import ColorPickerDialog from './ColorPickerDialog';
@@ -34,6 +35,7 @@ import { TS } from '-/tagspaces.namespace';
import { Pro } from '-/pro';
import DialogCloseButton from '-/components/dialogs/DialogCloseButton';
import TsTextField from '-/components/TsTextField';
+import Tag from '-/components/Tag';
import { getSaveTagInLocation } from '-/reducers/settings';
import { useTranslation } from 'react-i18next';
import { useTaggingActionsContext } from '-/hooks/useTaggingActionsContext';
@@ -131,40 +133,16 @@ function EditTagGroupDialog(props: Props) {
const renderTitle = () => (
<DialogTitle style={{ overflow: 'visible' }}>
- {t('core:editTagGroupTitle')}
+ {t('core:editTagGroupTitle')}{' '}
+ <Tag backgroundColor={color} textColor={textcolor} isDragging={false}>
+ tag-preview
+ <span style={{ margin: 3 }} />
+ </Tag>
<DialogCloseButton testId="closeEditTagGroupTID" onClose={onClose} />
</DialogTitle>
);
const renderContent = () => {
- const styles = {
- color: {
- width: '100%',
- height: 30,
- borderRadius: 2,
- borderWidth: 1,
- borderStyle: 'solid',
- borderColor: 'gray',
- padding: '5px',
- background: color,
- },
- textcolor: {
- width: '100%',
- height: 30,
- borderRadius: 2,
- borderWidth: 1,
- borderStyle: 'solid',
- borderColor: 'gray',
- padding: '5px',
- background: textcolor,
- },
- helpText: {
- marginTop: '15px',
- marginBottom: '5px',
- fontSize: '1rem',
- },
- };
-
return (
<DialogContent style={{ overflow: 'visible' }}>
<FormControl
@@ -172,12 +150,11 @@ function EditTagGroupDialog(props: Props) {
error={inputError}
style={{ overflow: 'visible' }}
>
- <FormHelperText>{t('core:editTagGroupNewName')}</FormHelperText>
<TsTextField
error={inputError}
name="title"
autoFocus
- // label={t('core:editTagGroupNewName')}
+ label={t('core:editTagGroupNewName')}
onChange={handleTagGroupTitleChange}
value={title}
data-tid="editTagGroupInput"
@@ -188,10 +165,13 @@ function EditTagGroupDialog(props: Props) {
</FormControl>
{saveTagInLocation && (
<FormControl fullWidth={true} error={inputError}>
- <FormHelperText style={styles.helpText}>
+ <FormHelperText style={{ marginLeft: 0, marginTop: 0 }}>
{t('core:tagGroupLocation')}
</FormHelperText>
- <Select
+ <TsTextField
+ variant="outlined"
+ select
+ fullWidth={false}
defaultValue={locationId}
onChange={(event: ChangeEvent<HTMLInputElement>) => {
setLocationId(event.target.value);
@@ -208,18 +188,24 @@ function EditTagGroupDialog(props: Props) {
{t('core:location') + ': ' + location.name}
</MenuItem>
))}
- </Select>
+ </TsTextField>
</FormControl>
)}
- <FormControl fullWidth={true}>
- <FormHelperText style={styles.helpText}>
- {t('core:tagBackgroundColor')}
- </FormHelperText>
+ <ListItem style={{ paddingLeft: 0, paddingRight: 0 }}>
+ <ListItemText primary={t('tagBackgroundColor')} />
<TransparentBackground>
<Button
onClick={() => setDisplayColorPicker(!displayColorPicker)}
data-tid="editTagGroupBackgroundColor"
- style={styles.color}
+ style={{
+ height: 30,
+ borderRadius: 2,
+ borderWidth: 1,
+ borderStyle: 'solid',
+ borderColor: 'gray',
+ padding: '5px',
+ background: color,
+ }}
>
&nbsp;
</Button>
@@ -232,16 +218,22 @@ function EditTagGroupDialog(props: Props) {
color={color}
/>
)}
- </FormControl>
- <FormControl fullWidth={true}>
- <FormHelperText style={styles.helpText}>
- {t('core:tagForegroundColor')}
- </FormHelperText>
+ </ListItem>
+ <ListItem style={{ paddingLeft: 0, paddingRight: 0 }}>
+ <ListItemText primary={t('core:tagForegroundColor')} />
<TransparentBackground>
<Button
onClick={() => setDisplayTextColorPicker(!displayTextColorPicker)}
data-tid="editTagGroupForegroundColor"
- style={styles.textcolor}
+ style={{
+ height: 30,
+ borderRadius: 2,
+ borderWidth: 1,
+ borderStyle: 'solid',
+ borderColor: 'gray',
+ padding: '5px',
+ background: textcolor,
+ }}
role="presentation"
>
&nbsp;
@@ -255,17 +247,15 @@ function EditTagGroupDialog(props: Props) {
color={textcolor}
/>
)}
- </FormControl>
- <FormControl>
- <FormHelperText style={styles.helpText}>
- {t('core:colorChangesToAllTags')}
- </FormHelperText>
+ </ListItem>
+ <ListItem style={{ paddingLeft: 0, paddingRight: 0 }}>
+ <ListItemText primary={t('core:colorChangesToAllTags')} />
<Switch
data-tid="editTagGroupSwitch"
onClick={() => setApplyChanges(!applyChanges)}
checked={applyChanges}
/>
- </FormControl>
+ </ListItem>
</DialogContent>
);
};
diff --git a/src/renderer/components/dialogs/NewFileDialog.tsx b/src/renderer/components/dialogs/NewFileDialog.tsx
index 62d175ebb..f99f1f908 100644
--- a/src/renderer/components/dialogs/NewFileDialog.tsx
+++ b/src/renderer/components/dialogs/NewFileDialog.tsx
@@ -135,9 +135,9 @@ function NewFileDialog(props: Props) {
</DialogTitle>
<DialogContent
style={{
+ paddingTop: 10,
minWidth: 200,
- minHeight: 200,
- marginBottom: 20,
+ // minHeight: 200,
overflow: 'overlay',
}}
data-tid="newFileDialog"
diff --git a/src/renderer/components/dialogs/settings/MapTileServerDialog.tsx b/src/renderer/components/dialogs/settings/MapTileServerDialog.tsx
index 3f8728cd9..65a73f9e3 100644
--- a/src/renderer/components/dialogs/settings/MapTileServerDialog.tsx
+++ b/src/renderer/components/dialogs/settings/MapTileServerDialog.tsx
@@ -33,6 +33,8 @@ import { actions as SettingsActions } from '-/reducers/settings';
import DialogCloseButton from '-/components/dialogs/DialogCloseButton';
import { AppDispatch } from '-/reducers/app';
import { useTranslation } from 'react-i18next';
+import ListItemText from '@mui/material/ListItemText';
+import ListItem from '@mui/material/ListItem/ListItem';
interface Props {
open: boolean;
@@ -137,7 +139,11 @@ function MapTileServerDialog(props: Props) {
defaultValue={serverURL.current}
data-tid="tileServerUrlTID"
/>
- <FormHelperText>{t('core:tileServerUrlHelp')}</FormHelperText>
+ <FormHelperText
+ style={{ marginLeft: 0, marginTop: 0, marginBottom: 10 }}
+ >
+ {t('core:tileServerUrlHelp')}
+ </FormHelperText>
</FormControl>
<FormControl fullWidth={true}>
<TsTextField
@@ -147,15 +153,13 @@ function MapTileServerDialog(props: Props) {
const { target } = event;
serverInfo.current = target.value;
}}
- // updateValue={(value) => {
- // serverInfo.current = value;
- // }}
retrieveValue={() => serverInfo.current}
defaultValue={serverInfo.current}
data-tid="tileserverInfoTID"
/>
</FormControl>
- <FormControl fullWidth={true}>
+ <ListItem style={{ paddingLeft: 0, paddingRight: 0 }}>
+ <ListItemText primary={t('core:serverIsDefaultHelp')} />
<Switch
data-tid="serverIsDefaultTID"
onClick={() => {
@@ -163,8 +167,7 @@ function MapTileServerDialog(props: Props) {
}}
defaultChecked={isDefault.current}
/>
- <FormHelperText>{t('core:serverIsDefaultHelp')}</FormHelperText>
- </FormControl>
+ </ListItem>
</DialogContent>
);
diff --git a/src/renderer/components/dialogs/settings/SettingsAdvanced.tsx b/src/renderer/components/dialogs/settings/SettingsAdvanced.tsx
index 6da91027c..c8f81975e 100644
--- a/src/renderer/components/dialogs/settings/SettingsAdvanced.tsx
+++ b/src/renderer/components/dialogs/settings/SettingsAdvanced.tsx
@@ -40,6 +40,7 @@ import {
} from '-/reducers/settings';
import { TS } from '-/tagspaces.namespace';
import MapTileServerDialog from '-/components/dialogs/settings/MapTileServerDialog';
+import TsTextField from '-/components/TsTextField';
import { Pro } from '-/pro';
import { ProLabel } from '-/components/HelperComponents';
import InfoIcon from '-/components/InfoIcon';
@@ -172,7 +173,7 @@ function SettingsAdvanced(props: Props) {
</ListItem>
<ListItem>
<ListItemText primary={t('core:prefixTagContainer')} />
- <Input
+ <TsTextField
style={{ maxWidth: '100px' }}
data-tid="prefixTagContainerTID"
value={settings.prefixTagContainer}
@@ -195,20 +196,22 @@ function SettingsAdvanced(props: Props) {
</IconButton>
</Tooltip>
</ListItemIcon>
- <Select
+ <TsTextField
data-tid="fileOpenTID"
+ variant="outlined"
+ select
+ fullWidth={false}
title={t('core:fileOpenHistoryTitle')}
value={settings[historyKeys.fileOpenKey]}
onChange={(event) =>
setHistory(historyKeys.fileOpenKey, event.target.value)
}
- input={<Input id="fileOpenSelector" />}
>
<MenuItem value={0}>{t('core:disabled')}</MenuItem>
<MenuItem value={10}>10</MenuItem>
<MenuItem value={50}>50</MenuItem>
<MenuItem value={100}>100</MenuItem>
- </Select>
+ </TsTextField>
</ListItem>
<ListItem>
<ListItemText primary={t('core:folderOpenHistory')} />
@@ -224,20 +227,22 @@ function SettingsAdvanced(props: Props) {
</IconButton>
</Tooltip>
</ListItemIcon>
- <Select
+ <TsTextField
data-tid="folderOpenTID"
+ variant="outlined"
+ select
+ fullWidth={false}
title={t('core:folderOpenHistoryTitle')}
value={settings[historyKeys.folderOpenKey]}
onChange={(event: any) =>
setHistory(historyKeys.folderOpenKey, event.target.value)
}
- input={<Input id="folderOpenSelector" />}
>
<MenuItem value={0}>{t('core:disabled')}</MenuItem>
<MenuItem value={10}>10</MenuItem>
<MenuItem value={50}>50</MenuItem>
<MenuItem value={100}>100</MenuItem>
- </Select>
+ </TsTextField>
</ListItem>
<ListItem>
<ListItemText primary={t('core:fileEditHistory')} />
@@ -253,20 +258,22 @@ function SettingsAdvanced(props: Props) {
</IconButton>
</Tooltip>
</ListItemIcon>
- <Select
+ <TsTextField
data-tid="fileEditTID"
+ variant="outlined"
+ select
+ fullWidth={false}
title={t('core:fileEditHistoryTitle')}
value={settings[historyKeys.fileEditKey]}
onChange={(event: any) =>
setHistory(historyKeys.fileEditKey, event.target.value)
}
- input={<Input id="fileEditSelector" />}
>
<MenuItem value={0}>{t('core:disabled')}</MenuItem>
<MenuItem value={10}>10</MenuItem>
<MenuItem value={50}>50</MenuItem>
<MenuItem value={100}>100</MenuItem>
- </Select>
+ </TsTextField>
</ListItem>
<ListItem>
<ListItemText primary={t('core:searchHistory')} />
@@ -284,20 +291,22 @@ function SettingsAdvanced(props: Props) {
</IconButton>
</Tooltip>
</ListItemIcon>
- <Select
+ <TsTextField
data-tid="searchHistoryTID"
+ variant="outlined"
+ select
+ fullWidth={false}
title={t('core:searchHistoryTitle')}
value={settings[historyKeys.searchHistoryKey]}
onChange={(event: any) =>
setHistory(historyKeys.searchHistoryKey, event.target.value)
}
- input={<Input id="searchHistorySelector" />}
>
<MenuItem value={0}>{t('core:disabled')}</MenuItem>
<MenuItem value={10}>10</MenuItem>
<MenuItem value={50}>50</MenuItem>
<MenuItem value={100}>100</MenuItem>
- </Select>
+ </TsTextField>
</ListItem>
<ConfirmDialog
open={confirmDialogKey !== null}
@@ -355,8 +364,11 @@ function SettingsAdvanced(props: Props) {
</ListItem>
<ListItem>
<ListItemText primary={t('core:geoTaggingFormat')} />
- <Select
+ <TsTextField
disabled={geoTaggingFormatDisabled}
+ variant="outlined"
+ select
+ fullWidth={false}
data-tid="geoTaggingFormatTID"
title={
geoTaggingFormatDisabled
@@ -369,14 +381,13 @@ function SettingsAdvanced(props: Props) {
: settings.geoTaggingFormat
}
onChange={(event: any) => setGeoTaggingFormat(event.target.value)}
- input={<Input id="geoTaggingFormatSelector" />}
>
{settings.supportedGeoTagging.map((geoTagging) => (
<MenuItem key={geoTagging} value={geoTagging}>
{geoTagging.toUpperCase()}
</MenuItem>
))}
- </Select>
+ </TsTextField>
</ListItem>
<ListItem>
<ListItemText primary={t('core:tileServerTitle')} />
diff --git a/src/renderer/components/dialogs/settings/SettingsFileTypes.tsx b/src/renderer/components/dialogs/settings/SettingsFileTypes.tsx
index bc8747a45..496c7e89f 100644
--- a/src/renderer/components/dialogs/settings/SettingsFileTypes.tsx
+++ b/src/renderer/components/dialogs/settings/SettingsFileTypes.tsx
@@ -479,6 +479,7 @@ function SettingsFileTypes() {
width: '100%',
minWidth: 550,
overflow: 'hidden',
+ background: 'transparent',
}}
>
<Button
@@ -528,6 +529,7 @@ function SettingsFileTypes() {
overflowX: 'hidden',
height: 'calc(100% - 30px)',
overflowY: 'auto',
+ background: 'transparent',
}}
data={items.current}
components={VirtuosoTableComponents}
diff --git a/src/renderer/components/dialogs/settings/SettingsGeneral.tsx b/src/renderer/components/dialogs/settings/SettingsGeneral.tsx
index 7eff3a723..43a07cd24 100644
--- a/src/renderer/components/dialogs/settings/SettingsGeneral.tsx
+++ b/src/renderer/components/dialogs/settings/SettingsGeneral.tsx
@@ -25,8 +25,6 @@ import Typography from '@mui/material/Typography';
import MenuItem from '@mui/material/MenuItem';
import Switch from '@mui/material/Switch';
import Tooltip from '-/components/Tooltip';
-import Input from '@mui/material/Input';
-import Select from '@mui/material/Select';
import Button from '@mui/material/Button';
import InfoMuiIcon from '@mui/icons-material/InfoOutlined';
import InfoIcon from '-/components/InfoIcon';
@@ -38,16 +36,15 @@ import {
actions as SettingsActions,
getFileNameTagPlace,
getPersistTagsInSidecarFile,
- //getCurrentLanguage,
getSettings,
} from '-/reducers/settings';
import ColorPickerDialog from '-/components/dialogs/ColorPickerDialog';
import PerspectiveSelector from '-/components/PerspectiveSelector';
import TransparentBackground from '-/components/TransparentBackground';
+import TsTextField from '-/components/TsTextField';
import { BetaLabel } from '-/components/HelperComponents';
import { PerspectiveIDs } from '-/perspectives';
import { AppDispatch } from '-/reducers/app';
-import { styled } from '@mui/material/styles';
import { useTranslation } from 'react-i18next';
import { useDirectoryContentContext } from '-/hooks/useDirectoryContentContext';
import { setLanguage } from '-/services/utils-io';
@@ -89,8 +86,11 @@ function SettingsGeneral() {
<List style={{ overflowX: 'hidden', overflowY: 'auto', height: '100%' }}>
<ListItem>
<ListItemText primary={t('core:interfaceLanguage')} />
- <Select
+ <TsTextField
data-tid="settingsSetLanguage"
+ variant="outlined"
+ select
+ fullWidth={false}
value={settings.interfaceLanguage}
onChange={(event: any) => {
return i18n.changeLanguage(event.target.value).then(() => {
@@ -99,24 +99,25 @@ function SettingsGeneral() {
return true;
});
}}
- input={<Input id="languageSelector" />}
>
{settings.supportedLanguages.map((language) => (
<MenuItem key={language.iso} value={language.iso}>
{language.title}
</MenuItem>
))}
- </Select>
+ </TsTextField>
</ListItem>
<ListItem>
<ListItemText primary={t('core:themeSelector')} />
- <Select
+ <TsTextField
data-tid="settingsSetCurrentTheme"
+ variant="outlined"
+ select
+ fullWidth={false}
value={settings.currentTheme}
onChange={(event: any) =>
dispatch(SettingsActions.setCurrentTheme(event.target.value))
}
- input={<Input id="themeSelector" />}
>
{settings.supportedThemes.map((theme) => (
<MenuItem key={theme} value={theme}>
@@ -125,41 +126,45 @@ function SettingsGeneral() {
{theme === 'system' && t('core:systemScheme')}
</MenuItem>
))}
- </Select>
+ </TsTextField>
</ListItem>
<ListItem>
<ListItemText primary={t('core:themeRegularSelector')} />
- <Select
+ <TsTextField
data-tid="settingsCurrentRegularThemeTID"
+ variant="outlined"
+ select
+ fullWidth={false}
value={settings.currentRegularTheme}
onChange={(event: any) =>
dispatch(SettingsActions.setCurrentRegularTheme(event.target.value))
}
- input={<Input id="themeRegularSelector" />}
>
{settings.supportedRegularThemes.map((theme) => (
<MenuItem key={theme} value={theme}>
{theme.charAt(0).toUpperCase() + theme.slice(1)}
</MenuItem>
))}
- </Select>
+ </TsTextField>
</ListItem>
<ListItem>
<ListItemText primary={t('core:themeDarkSelector')} />
- <Select
+ <TsTextField
data-tid="settingsCurrentDarkThemeTID"
+ variant="outlined"
+ select
+ fullWidth={false}
value={settings.currentDarkTheme}
onChange={(event: any) =>
dispatch(SettingsActions.setCurrentDarkTheme(event.target.value))
}
- input={<Input id="themeDarkSelector" />}
>
{settings.supportedDarkThemes.map((theme) => (
<MenuItem key={theme} value={theme}>
{theme.charAt(0).toUpperCase() + theme.slice(1)}
</MenuItem>
))}
- </Select>
+ </TsTextField>
</ListItem>
<ListItem>
<ListItemText primary={t('createLocationDefaultPerspective')} />
@@ -449,7 +454,7 @@ function SettingsGeneral() {
</ListItem> */}
<ListItem>
<ListItemText primary={t('core:maxSearchResultChoose')} />
- <Input
+ <TsTextField
style={{ maxWidth: '100px' }}
type="number"
data-tid="settingsMaxSearchResult"