Skip to content

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

chore: ui optimization in search and entry container

Ilian Sapundshiev55cfa3c277f2
diff --git a/app/components/EntryContainer.tsx b/app/components/EntryContainer.tsx
index a4442d4d3..c1c85fa44 100644
--- a/app/components/EntryContainer.tsx
+++ b/app/components/EntryContainer.tsx
@@ -91,21 +91,21 @@ const bufferedSplitResize = buffer({
const styles: any = (theme: any) => ({
toolbar2: {
width: '100%',
- paddingLeft: 5,
+ paddingLeft: 0,
paddingRight: 5,
paddingTop: 0,
display: 'flex',
flexDirection: 'row',
justifyContent: 'flex-start',
- zIndex: 2,
- borderBottom: '1px solid ' + theme.palette.divider
+ zIndex: 2
+ // borderBottom: '1px solid ' + theme.palette.divider
},
flexLeft: {
flexDirection: 'row',
flex: '1 1',
display: 'flex',
- overflowX: AppConfig.isFirefox ? 'auto' : 'overlay'
- // marginRight: 100
+ overflowX: AppConfig.isFirefox ? 'auto' : 'overlay',
+ paddingRight: 100
},
fileBadge: {
color: 'white',
@@ -130,7 +130,6 @@ const styles: any = (theme: any) => ({
},
entryCloseSection: {
position: 'absolute',
- top: -2,
right: 0,
backgroundColor: theme.palette.background.default,
boxShadow: '-15px -2px 24px 3px ' + theme.palette.background.default
@@ -794,10 +793,10 @@ const EntryContainer = (props: Props) => {
<div
style={{
position: 'absolute',
- top: 43,
+ top: 50,
right: 0,
backgroundColor: theme.palette.background.default,
- boxShadow: '-15px -5px 20px 3px ' + theme.palette.background.default
+ boxShadow: '-11px -2px 20px 3px ' + theme.palette.background.default
}}
>
<Tooltip title={i18n.t('core:openPrevFileTooltip')}>
@@ -887,16 +886,16 @@ const EntryContainer = (props: Props) => {
>
<Box
style={{
- paddingLeft: 5,
+ paddingLeft: 0,
paddingRight: 50,
paddingTop: 0,
- minHeight: 40,
+ minHeight: 50,
display: 'flex',
flexDirection: 'row',
justifyContent: 'flex-start'
}}
>
- <Box className={classes.flexLeft}>
+ <Box className={classes.flexLeft} style={{ paddingRight: 20 }}>
{openedFile.isFile ? (
<Button
disabled
@@ -1066,7 +1065,7 @@ const EntryContainer = (props: Props) => {
return (
<Split
horizontal
- minPrimarySize="90px"
+ minPrimarySize="100px"
initialPrimarySize={initSize}
percent={percent.current}
setPercent={setPercent}
diff --git a/app/components/FileView.tsx b/app/components/FileView.tsx
index 45a836ba6..a7d209d86 100644
--- a/app/components/FileView.tsx
+++ b/app/components/FileView.tsx
@@ -99,6 +99,7 @@ const FileView = (props: Props) => {
>
{isFullscreen && (
<Fab
+ size="small"
data-tid="fullscreenTID"
color="primary"
style={{
diff --git a/app/components/FolderContainer.tsx b/app/components/FolderContainer.tsx
index fd262771b..f55e6d604 100644
--- a/app/components/FolderContainer.tsx
+++ b/app/components/FolderContainer.tsx
@@ -19,19 +19,16 @@
import React, { useEffect, useState } from 'react';
import { connect } from 'react-redux';
import { bindActionCreators } from 'redux';
-import Button from '@material-ui/core/Button';
+import IconButton from '@material-ui/core/IconButton';
+import Box from '@material-ui/core/Box';
+import CircularProgress from '@material-ui/core/CircularProgress';
+import Popover from '@material-ui/core/Popover';
+import Tooltip from '@material-ui/core/Tooltip';
+import Typography from '@material-ui/core/Typography';
import SearchIcon from '@material-ui/icons/Search';
import AdvancedSearchIcon from '@material-ui/icons/Tune';
import MenuIcon from '@material-ui/icons/MenuOpen';
import Badge from '@material-ui/core/Badge';
-import {
- Box,
- CircularProgress,
- IconButton,
- Popover,
- Tooltip,
- Typography
-} from '@material-ui/core';
import { withStyles } from '@material-ui/core/styles';
import ToggleButton from '@material-ui/lab/ToggleButton';
import ToggleButtonGroup from '@material-ui/lab/ToggleButtonGroup';
@@ -150,6 +147,14 @@ const CounterBadge: any = withStyles(theme => ({
}
}))(Badge);
+const CustomButton: any = withStyles(theme => ({
+ root: {
+ // borderRadius: 15,
+ // minWidth: 45,
+ // height: 40
+ }
+}))(IconButton);
+
interface Props {
classes: any;
settings: any;
@@ -406,8 +411,16 @@ const FolderContainer = (props: Props) => {
flexDirection: 'column'
}}
>
- <div style={{ paddingLeft: 5, display: 'flex' }}>
- <IconButton
+ <div
+ style={{
+ paddingLeft: 5,
+ display: 'flex',
+ overflowY: 'hidden',
+ // @ts-ignore
+ overflowX: AppConfig.isFirefox ? 'auto' : 'overlay'
+ }}
+ >
+ <CustomButton
id="mobileMenuButton"
style={{
transform: drawerOpened ? 'rotate(0deg)' : 'rotate(180deg)'
@@ -415,7 +428,7 @@ const FolderContainer = (props: Props) => {
onClick={toggleDrawer}
>
<MenuIcon />
- </IconButton>
+ </CustomButton>
{/* <CounterBadge
showZero={true}
title={searchResultCounterText}
@@ -426,7 +439,7 @@ const FolderContainer = (props: Props) => {
openSearchPanel();
}}
/> */}
- <IconButton
+ <CustomButton
data-tid="toggleSearch"
onClick={() => {
if (isSearchVisible) {
@@ -439,11 +452,11 @@ const FolderContainer = (props: Props) => {
}}
>
<SearchIcon />
- </IconButton>
+ </CustomButton>
{isSearchVisible ? (
<>
<SearchInline />
- <IconButton
+ <CustomButton
id="advancedButton"
title={i18n.t('core:advancedSearch')}
data-tid="advancedSearch"
@@ -452,7 +465,7 @@ const FolderContainer = (props: Props) => {
}
>
<AdvancedSearchIcon />
- </IconButton>
+ </CustomButton>
<Popover
open={Boolean(anchorSearch)}
anchorEl={anchorSearch}
@@ -482,7 +495,7 @@ const FolderContainer = (props: Props) => {
}}
/>
{props.progress && props.progress.length > 0 && (
- <IconButton
+ <CustomButton
id="progressButton"
title={i18n.t('core:progress')}
data-tid="uploadProgress"
@@ -491,7 +504,7 @@ const FolderContainer = (props: Props) => {
className={[classes.button, classes.upgradeButton].join(' ')}
>
<CircularProgressWithLabel value={getProgressValue()} />
- </IconButton>
+ </CustomButton>
)}
<LocationMenu />
<PathBreadcrumbs
@@ -515,7 +528,6 @@ const FolderContainer = (props: Props) => {
<div
style={{
height: props.windowHeight,
- marginTop: -5,
flex: '1 1 auto',
width: '100%'
}}
diff --git a/app/components/PathBreadcrumbs.tsx b/app/components/PathBreadcrumbs.tsx
index 81551209e..9f1b02280 100644
--- a/app/components/PathBreadcrumbs.tsx
+++ b/app/components/PathBreadcrumbs.tsx
@@ -22,7 +22,6 @@ import Breadcrumbs from '@material-ui/core/Breadcrumbs';
import Chip from '@material-ui/core/Chip';
import ExpandMoreIcon from '@material-ui/icons/MoreVert';
import PlatformIO from '../services/platform-io';
-import LocationMenu from './menus/LocationMenu';
import { normalizePath, extractShortDirectoryName } from '-/utils/paths';
import i18n from '../services/i18n';
import DirectoryMenu from './menus/DirectoryMenu';
diff --git a/app/components/SearchInline.tsx b/app/components/SearchInline.tsx
index d7b410141..6a40aa2ac 100644
--- a/app/components/SearchInline.tsx
+++ b/app/components/SearchInline.tsx
@@ -63,13 +63,32 @@ interface Props {
const MainSearchField = withStyles((theme: Theme) =>
createStyles({
root: {
+ overflow: 'hidden',
'& input': {
padding: 6
},
'& .MuiInputBase-root': {
- borderRadius: 7
+ borderRadius: 7,
+ paddingRight: 5
},
- overflow: 'hidden',
+ '& .Mui-focused': {
+ color:
+ theme.palette.type === 'light'
+ ? theme.palette.grey[900]
+ : theme.palette.grey[200],
+ backgroundColor:
+ theme.palette.type === 'light'
+ ? theme.palette.grey[200]
+ : theme.palette.grey[900]
+ // backgroundColor: 'gray',
+ // outline: '2px solid red',
+ // border: 'none',
+ // boxShadow: 'none'
+ },
+ // '&$focused': {
+ // outline: 'none',
+ // boxShadow: '0 0 0 4px rgba(21, 156, 228, 0.4)'
+ // },
'&:hover': {
backgroundColor: theme.palette.background.paper
// boxShadow: `${alpha(theme.palette.primary.main, 0.25)} 0 0 0 0.2rem`
diff --git a/app/components/menus/LocationMenu.tsx b/app/components/menus/LocationMenu.tsx
index 9c674e94f..8eb444027 100644
--- a/app/components/menus/LocationMenu.tsx
+++ b/app/components/menus/LocationMenu.tsx
@@ -80,7 +80,13 @@ const LocationMenu = (props: Props) => {
id="locationMenuButton"
onClick={event => setLocationChooserMenuAnchorEl(event.currentTarget)}
title={currentLocation && currentLocation.name}
- style={{ marginTop: 5, paddingRight: 5, paddingLeft: 5 }}
+ style={{
+ marginTop: 5,
+ paddingRight: 0,
+ paddingLeft: 0,
+ marginRight: 5,
+ borderRadius: 15
+ }}
>
{currentLocation
? locationIcon // this.state.currentLocation.name