Skip to content

Commit 25c97b3

Browse files
committed
fix zoom button group
Signed-off-by: Adam Setch <[email protected]>
1 parent f5af6fd commit 25c97b3

File tree

2 files changed

+77
-125
lines changed

2 files changed

+77
-125
lines changed

src/renderer/components/settings/AppearanceSettings.tsx

Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import {
1313
TagIcon,
1414
XCircleIcon,
1515
} from '@primer/octicons-react';
16-
import { Button, ButtonGroup, Tooltip, useTheme } from '@primer/react';
16+
import { Button, ButtonGroup, IconButton, useTheme } from '@primer/react';
1717
import type { ColorModeWithAuto } from '@primer/react/lib/ThemeProvider';
1818

1919
import { AppContext } from '../../context/App';
@@ -98,46 +98,43 @@ export const AppearanceSettings: FC = () => {
9898
</label>
9999

100100
<ButtonGroup>
101-
<Button
101+
<IconButton
102+
aria-label="Zoom out"
102103
size="small"
104+
icon={DashIcon}
105+
unsafeDisableTooltip={true}
103106
onClick={() =>
104107
zoomPercentage > 0 &&
105108
webFrame.setZoomLevel(zoomPercentageToLevel(zoomPercentage - 10))
106109
}
107110
data-testid="settings-zoom-out"
108-
>
109-
<Tooltip text="Zoom out">
110-
<DashIcon size={Size.SMALL} />
111-
</Tooltip>
112-
</Button>
111+
/>
113112

114113
<Button aria-label="Zoom percentage" size="small" disabled>
115114
{zoomPercentage.toFixed(0)}%
116115
</Button>
117116

118-
<Button
117+
<IconButton
118+
aria-label="Zoom in"
119119
size="small"
120+
icon={PlusIcon}
121+
unsafeDisableTooltip={true}
120122
onClick={() =>
121123
zoomPercentage < 120 &&
122124
webFrame.setZoomLevel(zoomPercentageToLevel(zoomPercentage + 10))
123125
}
124126
data-testid="settings-zoom-in"
125-
>
126-
<Tooltip text="Zoom in">
127-
<PlusIcon size={Size.SMALL} />
128-
</Tooltip>
129-
</Button>
127+
/>
130128

131-
<Button
129+
<IconButton
130+
aria-label="Reset zoom"
132131
size="small"
133132
variant="danger"
133+
icon={XCircleIcon}
134+
unsafeDisableTooltip={true}
134135
onClick={() => webFrame.setZoomLevel(0)}
135136
data-testid="settings-zoom-reset"
136-
>
137-
<Tooltip text="Reset zoom">
138-
<XCircleIcon size={Size.SMALL} />
139-
</Tooltip>
140-
</Button>
137+
/>
141138
</ButtonGroup>
142139
</div>
143140

src/renderer/routes/__snapshots__/Settings.test.tsx.snap

Lines changed: 61 additions & 106 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)