Skip to content

Commit

Permalink
Clean up border rendering on Keyboard104 and spacing on the color and…
Browse files Browse the repository at this point in the history
… hamburger menu in the overview on the editor page
  • Loading branch information
obra committed Feb 8, 2024
1 parent 70630d8 commit c5a17d8
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 18 deletions.
13 changes: 2 additions & 11 deletions src/renderer/screens/Editor/Keyboard104.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,16 +75,7 @@ const KeySelector = (props) => {
return (
<Tooltip title={tooltipText} placement="top">
<g onClick={onClick} className="key" data-key-code={key.code}>
<rect
x={x}
y={y}
rx={2}
width={width}
height={height}
stroke={stroke}
strokeWidth={1.55}
fill={buttonColor}
/>
<rect x={x} y={y} rx={2} width={width} height={height} stroke={stroke} strokeWidth={2} fill={buttonColor} />

<text
x={x + width / 2}
Expand All @@ -103,7 +94,7 @@ const KeySelector = (props) => {

return (
<svg
viewBox={"0 0 " + Math.round(23 * keycapunit).toString() + " " + Math.round(6.5 * keycapunit).toString()}
viewBox={"0 0 " + Math.round(23 * keycapunit + 1).toString() + " " + Math.round(6.5 * keycapunit + 1).toString()}
xmlns="http://www.w3.org/2000/svg"
preserveAspectRatio="xMidYMin meet"
className={props.className}
Expand Down
22 changes: 15 additions & 7 deletions src/renderer/screens/Editor/Sidebar/Overview.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ const Overview = (props) => {
const color = colormap.palette[colorIndex];

colorWidget = (
<TableCell size="small" padding="none">
<TableCell size="small" padding="none" sx={{ width: (theme) => theme.spacing(3) }}>
<Avatar
sx={{ width: (theme) => theme.spacing(3), height: (theme) => theme.spacing(3) }}
variant="square"
Expand Down Expand Up @@ -165,7 +165,7 @@ const Overview = (props) => {
</Typography>
</TableCell>
{showColors && colorWidget}
<TableCell size="small" sx={{ pr: "0.5rem", py: 0 }}>
<TableCell size="small" sx={{ pl: 0, pr: "0.5rem", py: 0 }}>
{HamburgerMenu(index)}
</TableCell>
</TableRow>
Expand Down Expand Up @@ -194,12 +194,20 @@ const Overview = (props) => {
<Tooltip title={t("editor.overview.help")}>
<TableHead>
<TableRow>
<TableCell sx={{ pl: "1rem", py: 0 }} size="small" width="3">
{t("components.layerRaw")}
<TableCell sx={{ pl: "1rem", py: 0 }} size="small" width="3" align="left">
<Typography sx={{ fontSize: "0.8rem" }}>{t("components.layerRaw")}</Typography>
</TableCell>
<TableCell size="small" align="left">
<Typography sx={{ fontSize: "0.8rem" }}>
{t("editor.overview.key", { index: selectedKey })}
</Typography>
</TableCell>
<TableCell size="small">{t("editor.overview.key", { index: selectedKey })} </TableCell>
{showColors && <TableCell>{t("editor.overview.color")}</TableCell>}
<TableCell size="small" sx={{ pr: "1rem", py: 0 }} />
{showColors && (
<TableCell size="small" padding="none" sx={{ width: (theme) => theme.spacing(3) }}>
<Typography sx={{ fontSize: "0.8rem" }}>{t("editor.overview.color")}</Typography>
</TableCell>
)}
<TableCell size="small" sx={{ pl: 0, pr: "1rem", py: 0 }} />
</TableRow>
</TableHead>
</Tooltip>
Expand Down

0 comments on commit c5a17d8

Please sign in to comment.