Skip to content

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

setting mx width to location and tag group names

Ilian Sapundshiev767dc2387d50
diff --git a/app/components/LocationManager.js b/app/components/LocationManager.js
index a5822871b..75ee7bb48 100644
--- a/app/components/LocationManager.js
+++ b/app/components/LocationManager.js
@@ -28,6 +28,7 @@ import List from '@material-ui/core/List';
import ListItem from '@material-ui/core/ListItem';
import ListItemIcon from '@material-ui/core/ListItemIcon';
import ListItemText from '@material-ui/core/ListItemText';
+import ListItemSecondaryAction from '@material-ui/core/ListItemSecondaryAction';
import MoreVertIcon from '@material-ui/icons/MoreVert';
import Menu from '@material-ui/core/Menu';
import MenuItem from '@material-ui/core/MenuItem';
@@ -597,22 +598,29 @@ class LocationManager extends React.Component<Props, State> {
(<LocationIcon className={this.props.classes.icon} />)
}
</ListItemIcon>
- <ListItemText
- style={{ paddingLeft: 5, paddingRight: 5 }}
- data-tid="locationTitleElement"
- primary={location.name}
- />
- {location.isDefault && (
- <DefaultLocationIcon data-tid="startupIndication" />
- )}
- <IconButton
- aria-label={i18n.t('core:options')}
- aria-haspopup="true"
- data-tid={'locationMoreButton_' + location.name}
- onClick={event => this.handleLocationContextMenuClick(event, location)}
- >
- <MoreVertIcon />
- </IconButton>
+ <div style={{ maxWidth: 250 }}>
+ <Typography
+ variant="inherit"
+ style={{ paddingLeft: 5, paddingRight: 5 }}
+ data-tid="locationTitleElement"
+ noWrap
+ >
+ {location.name}
+ </Typography>
+ </div>
+ <ListItemSecondaryAction>
+ <IconButton
+ aria-label={i18n.t('core:options')}
+ aria-haspopup="true"
+ data-tid={'locationMoreButton_' + location.name}
+ onClick={event => this.handleLocationContextMenuClick(event, location)}
+ >
+ {location.isDefault && (
+ <DefaultLocationIcon data-tid="startupIndication" />
+ )}
+ <MoreVertIcon />
+ </IconButton>
+ </ListItemSecondaryAction>
</ListItem>
{table}
</div>
diff --git a/app/components/TagLibrary.js b/app/components/TagLibrary.js
index 91e4e3937..f786b71c5 100644
--- a/app/components/TagLibrary.js
+++ b/app/components/TagLibrary.js
@@ -233,13 +233,21 @@ class TagLibrary extends React.Component<Props, State> {
<ListItem
data-tid="tagLibraryTagGroupTitleClick"
button
+ style={{ maxWidth: 250 }}
className={this.props.classes.listItem}
onClick={event => this.handleTagGroupTitleClick(event, tagGroup)}
>
<ListItemIcon style={{ marginRight: 0 }}>
{tagGroup.expanded ? <ArrowDownIcon /> : <ArrowRightIcon />}
</ListItemIcon>
- <ListItemText style={{ paddingLeft: 0 }} inset primary={tagGroup.title} />
+ <Typography
+ variant="inherit"
+ style={{ paddingLeft: 0 }}
+ data-tid="locationTitleElement"
+ noWrap
+ >
+ {tagGroup.title}
+ </Typography>
<ListItemSecondaryAction>
<IconButton
aria-label={i18n.t('core:options')}
@@ -252,7 +260,7 @@ class TagLibrary extends React.Component<Props, State> {
</IconButton>
</ListItemSecondaryAction>
</ListItem>
- <Collapse in={tagGroup.expanded} unmountOnExit>
+ <Collapse in={tagGroup.expanded} unmountOnExit style={{ maxWidth: 250 }}>
<TagGroupContainer taggroup={tagGroup} data-tid={'tagGroupContainer_' + tagGroup.title}>
{tagGroup.children && tagGroup.children.map((tag: Tag) => (
<TagContainerDnd