Skip to content

Commit

Permalink
Fix some icon clipping and alignment
Browse files Browse the repository at this point in the history
Issue #172
  • Loading branch information
qu1ck committed Apr 7, 2024
1 parent 05303b6 commit b1188cd
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/components/filters.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ const FilterRow = React.memo(function FilterRow(props: FilterRowProps) {
filter: { id: props.id, filter: props.filter.filter },
});
}}>
<div style={{ flexShrink: 0 }}><props.filter.icon /></div>
<div className="icon-container"><props.filter.icon /></div>
<div style={{ flexShrink: 1, overflow: "hidden", textOverflow: "ellipsis" }}>{props.filter.name}</div>
<div style={{ flexShrink: 0 }}>{`(${props.count})`}</div>
</Flex>;
Expand Down Expand Up @@ -201,7 +201,7 @@ function DirFilterRow(props: DirFilterRowProps) {
filter: { id: props.id, filter },
});
}}>
<div style={{ flexShrink: 0 }}>
<div className="icon-container">
{expandable
? props.dir.expanded
? <Icon.DashSquare size="1.1rem" onClick={onCollapse} style={{ cursor: "pointer" }} />
Expand Down
3 changes: 3 additions & 0 deletions src/components/mantinetheme.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,9 @@ function GlobalStyles() {
? theme.fn.rgba(theme.colors.gray[7], 0.5)
: theme.fn.rgba(theme.colors.gray[5], 0.5),
},
"svg:not(:root)": {
overflow: "visible",
},
})} />
);
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/tables/filetreetable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ function NameField(props: TableFieldProps) {
onDoubleClick={(e) => { e.stopPropagation(); }} />
}
</Box>
<Box ml="xs" sx={{ flexShrink: 0, height: "100%" }}>
<Box ml="xs" className="icon-container">
{isDir
? props.row.getIsExpanded()
? <Icon.DashSquare size="1.1rem" onClick={onToggleExpand} style={{ cursor: "pointer" }} />
Expand Down
2 changes: 1 addition & 1 deletion src/components/tables/torrenttable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ function NameField(props: TableFieldProps) {

return (
<EditableNameField currentName={currentName} onUpdate={rpcVersion >= 15 ? updateTorrentName : undefined}>
<Box pb="xs" sx={{ flexShrink: 0 }}>
<Box pb="xs" className="icon-container">
<StatusIcon />
</Box>
</EditableNameField>
Expand Down
9 changes: 9 additions & 0 deletions src/css/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,15 @@ img {
vertical-align: middle;
}

svg:not(:root) {
overflow: visible;
}

.icon-container {
flex-shrink: 0;
display: contents;
}

.split-horizontal {
display: flex;
flex-direction: row;
Expand Down

0 comments on commit b1188cd

Please sign in to comment.