Skip to content

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

chore: ui improvements

Ilian Sapundshievc622badd3aea
diff --git a/app/components/EntryContainer.tsx b/app/components/EntryContainer.tsx
index 5e4a69995..a4442d4d3 100644
--- a/app/components/EntryContainer.tsx
+++ b/app/components/EntryContainer.tsx
@@ -89,52 +89,22 @@ const bufferedSplitResize = buffer({
});
const styles: any = (theme: any) => ({
- panel: {
- width: '100%',
- flexDirection: 'column',
- flex: '1 1 100%',
- display: 'flex',
- backgroundColor: theme.palette.background.default
- },
- entryProperties: {
- display: 'inline',
- flex: '1 1 100%',
- backgroundColor: theme.palette.background.default,
- // zIndex: 1,
- padding: '0',
- height: '100%'
- },
- fileOpener: {
- width: '100%',
- // zIndex: 3,
- border: 0
- },
- toolbar: {
- paddingLeft: 5,
- paddingRight: 5,
- paddingTop: 0,
- minHeight: 50,
- display: 'flex',
- flexDirection: 'row',
- justifyContent: 'flex-start'
- },
toolbar2: {
width: '100%',
paddingLeft: 5,
paddingRight: 5,
- paddingTop: 5,
+ paddingTop: 0,
display: 'flex',
flexDirection: 'row',
justifyContent: 'flex-start',
zIndex: 2,
- borderBottom: '1px solid ' + theme.palette.divider,
- overflowX: AppConfig.isFirefox ? 'auto' : 'overlay'
+ borderBottom: '1px solid ' + theme.palette.divider
},
flexLeft: {
flexDirection: 'row',
flex: '1 1',
display: 'flex',
- overflowX: 'auto'
+ overflowX: AppConfig.isFirefox ? 'auto' : 'overlay'
// marginRight: 100
},
fileBadge: {
@@ -160,17 +130,10 @@ const styles: any = (theme: any) => ({
},
entryCloseSection: {
position: 'absolute',
- top: 0,
- right: 0,
- backgroundColor: theme.palette.background.default,
- boxShadow: '-15px 0px 24px 3px ' + theme.palette.background.default
- },
- entryNavigationSection: {
- position: 'absolute',
- top: 55,
+ top: -2,
right: 0,
backgroundColor: theme.palette.background.default,
- boxShadow: '-15px -5px 20px 3px ' + theme.palette.background.default
+ boxShadow: '-15px -2px 24px 3px ' + theme.palette.background.default
}
});
@@ -327,7 +290,6 @@ const EntryContainer = (props: Props) => {
props.openNextFile(openedFile.path);
break;
case 'openLinkExternally':
- // console.log('Open link externally: ' + data.link);
props.openLink(data.link);
break;
case 'loadDefaultTextContent':
@@ -653,12 +615,6 @@ const EntryContainer = (props: Props) => {
const openNatively = () => {
if (openedFile.path) {
if (openedFile.isFile) {
- // window.open(
- // fileOpenerURL,
- // 'TagSpaces - ' + openedFile.path,
- // 'resizable=yes,height=768,width=1024',
- // false
- // );
props.openFileNatively(openedFile.path);
} else {
props.openDirectory(openedFile.path);
@@ -835,7 +791,15 @@ const EntryContainer = (props: Props) => {
</Tooltip>
)}
</div>
- <div className={classes.entryNavigationSection}>
+ <div
+ style={{
+ position: 'absolute',
+ top: 43,
+ right: 0,
+ backgroundColor: theme.palette.background.default,
+ boxShadow: '-15px -5px 20px 3px ' + theme.palette.background.default
+ }}
+ >
<Tooltip title={i18n.t('core:openPrevFileTooltip')}>
<IconButton
aria-label={i18n.t('core:openPrevFileTooltip')}
@@ -893,7 +857,7 @@ const EntryContainer = (props: Props) => {
</div>
);
- const { classes, keyBindings } = props;
+ const { classes, keyBindings, theme } = props;
const fileTitle: string = openedFile.path
? extractTitle(
openedFile.path,
@@ -912,12 +876,26 @@ const EntryContainer = (props: Props) => {
return (
<Box
key="toolbarButtonsID"
- className={classes.panel}
style={{
+ width: '100%',
+ flexDirection: 'column',
+ flex: '1 1 100%',
+ display: 'flex',
+ backgroundColor: theme.palette.background.default,
height: filePropsHeight || 'initial'
}}
>
- <Box className={classes.toolbar}>
+ <Box
+ style={{
+ paddingLeft: 5,
+ paddingRight: 50,
+ paddingTop: 0,
+ minHeight: 40,
+ display: 'flex',
+ flexDirection: 'row',
+ justifyContent: 'flex-start'
+ }}
+ >
<Box className={classes.flexLeft}>
{openedFile.isFile ? (
<Button
@@ -1049,7 +1027,15 @@ const EntryContainer = (props: Props) => {
};
const entryProperties = (
- <div className={classes.entryProperties}>
+ <div
+ style={{
+ display: 'inline',
+ flex: '1 1 100%',
+ backgroundColor: theme.palette.background.default,
+ padding: '0',
+ height: '100%'
+ }}
+ >
{openedFile.isFile ? renderFileToolbar(classes) : renderFolderToolbar()}
<EntryProperties
key={openedFile.path}
@@ -1080,7 +1066,7 @@ const EntryContainer = (props: Props) => {
return (
<Split
horizontal
- minPrimarySize="103px"
+ minPrimarySize="90px"
initialPrimarySize={initSize}
percent={percent.current}
setPercent={setPercent}
diff --git a/app/components/FolderContainer.tsx b/app/components/FolderContainer.tsx
index 06062bab1..fd262771b 100644
--- a/app/components/FolderContainer.tsx
+++ b/app/components/FolderContainer.tsx
@@ -41,7 +41,6 @@ import MapiquePerspectiveIcon from '@material-ui/icons/Map';
import LocationMenu from './menus/LocationMenu';
import i18n from '../services/i18n';
import { getMaxSearchResults, getDesktopMode } from '-/reducers/settings';
-// import { getLocations } from '-/reducers/locations';
import {
actions as AppActions,
getDirectoryContent,
@@ -151,56 +150,6 @@ const CounterBadge: any = withStyles(theme => ({
}
}))(Badge);
-const styles: any = (theme: any) => ({
- mainPanel: {
- flex: '1 1 100%',
- width: '100%',
- height: '100%',
- maxHeight: '100%',
- overflow: 'hidden',
- backgroundColor: theme.palette.background.default,
- display: 'flex',
- flexDirection: 'column'
- },
- topPanel: {
- // height: 50,
- width: '100%',
- backgroundColor: theme.palette.background.default
- },
- centerPanel: {
- flex: '1 1 auto',
- width: '100%',
- backgroundColor: theme.palette.background.default
- },
- flexMiddle: {
- flex: '1 1 10%',
- display: 'flex',
- flexDirection: 'column'
- },
- folderButton: {
- minWidth: 30,
- paddingLeft: 3,
- paddingRight: 3,
- lineHeight: '17px',
- margin: '0 auto',
- backgroundColor: theme.palette.background.default
- },
- locationSelectorButton: {
- whiteSpace: 'nowrap',
- paddingLeft: 10,
- paddingRight: 10,
- alignItems: 'center'
- },
- perspecitveSwitch: {
- bottom: 65,
- right: 15,
- zIndex: 1000,
- opacity: 0.9,
- position: 'absolute',
- backgroundColor: theme.palette.background.default
- }
-});
-
interface Props {
classes: any;
settings: any;
@@ -225,14 +174,12 @@ interface Props {
isReadOnlyMode: boolean;
isDesktopMode: boolean;
showNotification: (content: string) => void;
- // openSearchPanel: () => void;
toggleDrawer?: () => void;
drawerOpened: boolean;
setCurrentDirectoryPerspective: (perspective: string) => void;
maxSearchResults: number;
currentDirectoryPerspective: string;
currentLocationPath: string;
- // locations: Array<Location>;
openedFiles: Array<OpenedEntry>;
updateCurrentDirEntry: (path: string, entry: Object) => void;
setCurrentDirectoryColor: (color: string) => void;
@@ -259,7 +206,6 @@ const FolderContainer = (props: Props) => {
props.setCurrentDirectoryPerspective(openedFile.perspective);
}
} else {
- // if (openedFile.editMode) {// changed) {
const currentEntry = enhanceOpenedEntry(
openedFile,
props.settings.tagDelimiter
@@ -393,7 +339,6 @@ const FolderContainer = (props: Props) => {
openDirectory,
reflectCreateEntry,
openFsEntry
- // rightPanelWidth
} = props;
/* let searchResultCounterText = searchResultCount + ' ' + i18n.t('entries');
@@ -449,19 +394,29 @@ const FolderContainer = (props: Props) => {
return (
<div data-tid="folderContainerTID" style={{ position: 'relative' }}>
- <div className={classes.mainPanel}>
- <div className={classes.topPanel}>
- <div style={{ paddingLeft: 5, display: 'flex' }}>
- <IconButton
- id="mobileMenuButton"
- style={{
- transform: drawerOpened ? 'rotate(0deg)' : 'rotate(180deg)'
- }}
- onClick={toggleDrawer}
- >
- <MenuIcon />
- </IconButton>
- {/* <CounterBadge
+ <div
+ style={{
+ flex: '1 1 100%',
+ width: '100%',
+ height: '100%',
+ maxHeight: '100%',
+ overflow: 'hidden',
+ backgroundColor: theme.palette.background.default,
+ display: 'flex',
+ flexDirection: 'column'
+ }}
+ >
+ <div style={{ paddingLeft: 5, display: 'flex' }}>
+ <IconButton
+ id="mobileMenuButton"
+ style={{
+ transform: drawerOpened ? 'rotate(0deg)' : 'rotate(180deg)'
+ }}
+ onClick={toggleDrawer}
+ >
+ <MenuIcon />
+ </IconButton>
+ {/* <CounterBadge
showZero={true}
title={searchResultCounterText}
badgeContent={searchResultCount}
@@ -471,92 +426,99 @@ const FolderContainer = (props: Props) => {
openSearchPanel();
}}
/> */}
- <IconButton
- data-tid="toggleSearch"
- onClick={() => {
- if (isSearchVisible) {
- props.setSearchQuery({});
- props.openCurrentDirectory();
- } else {
- setSearchVisible(!isSearchVisible);
+ <IconButton
+ data-tid="toggleSearch"
+ onClick={() => {
+ if (isSearchVisible) {
+ props.setSearchQuery({});
+ props.openCurrentDirectory();
+ } else {
+ setSearchVisible(!isSearchVisible);
+ }
+ return true;
+ }}
+ >
+ <SearchIcon />
+ </IconButton>
+ {isSearchVisible ? (
+ <>
+ <SearchInline />
+ <IconButton
+ id="advancedButton"
+ title={i18n.t('core:advancedSearch')}
+ data-tid="advancedSearch"
+ onClick={(event: React.MouseEvent<HTMLButtonElement>) =>
+ setAnchorSearch(event.currentTarget)
}
- return true;
- }}
- >
- <SearchIcon />
- </IconButton>
- {isSearchVisible ? (
- <>
- <SearchInline />
+ >
+ <AdvancedSearchIcon />
+ </IconButton>
+ <Popover
+ open={Boolean(anchorSearch)}
+ anchorEl={anchorSearch}
+ onClose={() => setAnchorSearch(null)}
+ anchorOrigin={{
+ vertical: 'top',
+ horizontal: 'right'
+ }}
+ style={{
+ marginLeft: -8
+ }}
+ transformOrigin={{
+ vertical: 'top',
+ horizontal: 'right'
+ }}
+ >
+ <SearchPopover onClose={() => setAnchorSearch(null)} />
+ </Popover>
+ </>
+ ) : (
+ <>
+ <div
+ style={{
+ flex: '1 1 10%',
+ display: 'flex',
+ flexDirection: 'column'
+ }}
+ />
+ {props.progress && props.progress.length > 0 && (
<IconButton
- id="advancedButton"
- title={i18n.t('core:advancedSearch')}
- data-tid="advancedSearch"
- onClick={(event: React.MouseEvent<HTMLButtonElement>) =>
- setAnchorSearch(event.currentTarget)
- }
+ id="progressButton"
+ title={i18n.t('core:progress')}
+ data-tid="uploadProgress"
+ onClick={() => props.toggleUploadDialog()}
+ // @ts-ignore
+ className={[classes.button, classes.upgradeButton].join(' ')}
>
- <AdvancedSearchIcon />
+ <CircularProgressWithLabel value={getProgressValue()} />
</IconButton>
- <Popover
- open={Boolean(anchorSearch)}
- anchorEl={anchorSearch}
- onClose={() => setAnchorSearch(null)}
- anchorOrigin={{
- vertical: 'top',
- horizontal: 'right'
- }}
- style={{
- marginLeft: -8
- }}
- transformOrigin={{
- vertical: 'top',
- horizontal: 'right'
- }}
- >
- <SearchPopover onClose={() => setAnchorSearch(null)} />
- </Popover>
- </>
- ) : (
- <>
- <div className={classes.flexMiddle} />
- {props.progress && props.progress.length > 0 && (
- <IconButton
- id="progressButton"
- title={i18n.t('core:progress')}
- data-tid="uploadProgress"
- onClick={() => props.toggleUploadDialog()}
- // @ts-ignore
- className={[classes.button, classes.upgradeButton].join(
- ' '
- )}
- >
- <CircularProgressWithLabel value={getProgressValue()} />
- </IconButton>
- )}
- <LocationMenu />
- <PathBreadcrumbs
- currentDirectoryPath={currentDirectoryPath}
- currentLocationPath={currentLocationPath}
- loadDirectoryContent={loadDirectoryContent}
- switchPerspective={switchPerspective}
- setSelectedEntries={setSelectedEntries}
- openDirectory={openDirectory}
- reflectCreateEntry={reflectCreateEntry}
- openFsEntry={openFsEntry}
- isReadOnlyMode={props.isReadOnlyMode}
- isDesktopMode={isDesktopMode}
- openRenameDirectoryDialog={() =>
- setIsRenameEntryDialogOpened(true)
- }
- />
- </>
- )}
- </div>
+ )}
+ <LocationMenu />
+ <PathBreadcrumbs
+ currentDirectoryPath={currentDirectoryPath}
+ currentLocationPath={currentLocationPath}
+ loadDirectoryContent={loadDirectoryContent}
+ switchPerspective={switchPerspective}
+ setSelectedEntries={setSelectedEntries}
+ openDirectory={openDirectory}
+ reflectCreateEntry={reflectCreateEntry}
+ openFsEntry={openFsEntry}
+ isReadOnlyMode={props.isReadOnlyMode}
+ isDesktopMode={isDesktopMode}
+ openRenameDirectoryDialog={() =>
+ setIsRenameEntryDialogOpened(true)
+ }
+ />
+ </>
+ )}
</div>
<div
- className={classes.centerPanel}
- style={{ height: props.windowHeight }}
+ style={{
+ height: props.windowHeight,
+ marginTop: -5,
+ flex: '1 1 auto',
+ width: '100%'
+ }}
>
{renderPerspective()}
{isRenameEntryDialogOpened && (
@@ -574,10 +536,14 @@ const FolderContainer = (props: Props) => {
size="small"
aria-label="change perspective"
exclusive
- className={classes.perspecitveSwitch}
- /* style={{
- right: rightPanelWidth + 30
- }} */
+ style={{
+ bottom: 65,
+ right: 15,
+ zIndex: 1000,
+ opacity: 0.9,
+ position: 'absolute',
+ backgroundColor: theme.palette.background.default
+ }}
>
<ToggleButton
value={perspectives.DEFAULT}
@@ -587,7 +553,6 @@ const FolderContainer = (props: Props) => {
<Tooltip arrow title="Switch to default perspective">
<div style={{ display: 'flex' }}>
<DefaultPerspectiveIcon />
- {/* {perspectives.DEFAULT} */}
</div>
</Tooltip>
</ToggleButton>
@@ -599,7 +564,6 @@ const FolderContainer = (props: Props) => {
<Tooltip arrow title="Switch to Gallery perspective">
<div style={{ display: 'flex' }}>
<GalleryPerspectiveIcon />
- {/* {perspectives.GALLERY} */}
</div>
</Tooltip>
</ToggleButton>
@@ -611,7 +575,6 @@ const FolderContainer = (props: Props) => {
<Tooltip arrow title="Switch to Mapique perspective">
<div style={{ display: 'flex' }}>
<MapiquePerspectiveIcon />
- {/* {perspectives.MAPIQUE} */}
</div>
</Tooltip>
</ToggleButton>
@@ -629,7 +592,6 @@ function mapStateToProps(state) {
currentDirectoryPerspective: getCurrentDirectoryPerspective(state),
searchResultCount: getSearchResultCount(state),
currentLocationPath: getCurrentLocationPath(state),
- // locations: getLocations(state),
maxSearchResults: getMaxSearchResults(state),
isDesktopMode: getDesktopMode(state),
isReadOnlyMode: isReadOnlyMode(state),
@@ -655,7 +617,6 @@ function mapActionCreatorsToProps(dispatch) {
loadParentDirectoryContent: AppActions.loadParentDirectoryContent,
setSelectedEntries: AppActions.setSelectedEntries,
showNotification: AppActions.showNotification,
- // openSearchPanel: AppActions.openSearchPanel,
setCurrentDirectoryPerspective: AppActions.setCurrentDirectoryPerspective,
updateCurrentDirEntry: AppActions.updateCurrentDirEntry,
setCurrentDirectoryColor: AppActions.setCurrentDirectoryColor,
@@ -688,5 +649,8 @@ export default connect(
mapActionCreatorsToProps
)(
// @ts-ignore
- React.memo(withStyles(styles, { withTheme: true })(FolderContainer), areEqual)
+ React.memo(
+ withStyles(undefined, { withTheme: true })(FolderContainer),
+ areEqual
+ )
);
diff --git a/app/services/electron-io.ts b/app/services/electron-io.ts
index 44055c41b..661cb1395 100644
--- a/app/services/electron-io.ts
+++ b/app/services/electron-io.ts
@@ -886,13 +886,13 @@ export default class ElectronIO {
};
openDirectory = (dirPath: string): void => {
- if (AppConfig.isWin) {
- this.electron.shell.showItemInFolder(dirPath);
- } else {
- this.electron.shell.showItemInFolder(
- dirPath + AppConfig.dirSeparator + '.'
- );
- }
+ // if (AppConfig.isWin) {
+ this.electron.shell.showItemInFolder(dirPath);
+ // } else {
+ // this.electron.shell.showItemInFolder(
+ // dirPath + AppConfig.dirSeparator + '.'
+ // );
+ // }
};
showInFileManager = (filePath: string): void => {