Skip to content

Commit 5bf2ca5

Browse files
committed
Fix styles for icon buttons
1 parent bebde7c commit 5bf2ca5

File tree

3 files changed

+17
-20
lines changed

3 files changed

+17
-20
lines changed

extensions/ql-vscode/src/view/method-modeling/MultipleModeledMethodsPanel.tsx

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import { createEmptyModeledMethod } from "../../model-editor/modeled-method-empt
1515
import { sendTelemetry } from "../common/telemetry";
1616
import type { ModelConfig } from "../../model-editor/languages";
1717
import { VscodeButton } from "@vscode-elements/react-elements";
18+
import { ActionButton } from "../common/ActionButton/ActionButton";
1819

1920
export type MultipleModeledMethodsPanelProps = {
2021
language: QueryLanguage;
@@ -168,21 +169,19 @@ export const MultipleModeledMethodsPanel = ({
168169
)}
169170
<Footer>
170171
<PaginationActions>
171-
<VscodeButton
172-
appearance="icon"
172+
<ActionButton
173173
aria-label="Previous modeling"
174174
onClick={handlePreviousClick}
175175
disabled={modeledMethods.length < 2 || selectedIndex === 0}
176176
>
177177
<Codicon name="chevron-left" />
178-
</VscodeButton>
178+
</ActionButton>
179179
{modeledMethods.length > 1 && (
180180
<div>
181181
{selectedIndex + 1}/{modeledMethods.length}
182182
</div>
183183
)}
184-
<VscodeButton
185-
appearance="icon"
184+
<ActionButton
186185
aria-label="Next modeling"
187186
onClick={handleNextClick}
188187
disabled={
@@ -191,25 +190,23 @@ export const MultipleModeledMethodsPanel = ({
191190
}
192191
>
193192
<Codicon name="chevron-right" />
194-
</VscodeButton>
193+
</ActionButton>
195194
</PaginationActions>
196195
<ModificationActions>
197-
<VscodeButton
198-
appearance="icon"
196+
<ActionButton
199197
aria-label="Delete modeling"
200198
onClick={handleRemoveClick}
201199
disabled={!canRemoveModeledMethod(modeledMethods)}
202200
>
203201
<Codicon name="trash" />
204-
</VscodeButton>
205-
<VscodeButton
206-
appearance="icon"
202+
</ActionButton>
203+
<ActionButton
207204
aria-label="Add modeling"
208205
onClick={handleAddClick}
209206
disabled={!canAddNewModeledMethod(modeledMethods)}
210207
>
211208
<Codicon name="add" />
212-
</VscodeButton>
209+
</ActionButton>
213210
</ModificationActions>
214211
</Footer>
215212
</Container>

extensions/ql-vscode/src/view/model-editor/LibraryRow.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import type { ModelEditorViewState } from "../../model-editor/shared/view-state"
1212
import type { AccessPathSuggestionOptions } from "../../model-editor/suggestions";
1313
import type { ModelEvaluationRunState } from "../../model-editor/shared/model-evaluation-run-state";
1414
import { Tag } from "../common/Tag";
15+
import { ActionButton } from "../common/ActionButton/ActionButton";
1516

1617
const LibraryContainer = styled.div`
1718
background-color: var(--vscode-peekViewResult-background);
@@ -170,16 +171,16 @@ export const LibraryRow = ({
170171
</NameContainer>
171172
{viewState.showGenerateButton &&
172173
viewState.mode === Mode.Application && (
173-
<VscodeButton appearance="icon" onClick={handleModelFromSource}>
174+
<ActionButton onClick={handleModelFromSource}>
174175
<Codicon name="code" label="Model from source" />
175176
&nbsp;Model from source
176-
</VscodeButton>
177+
</ActionButton>
177178
)}
178179
{viewState.mode === Mode.Application && (
179-
<VscodeButton appearance="icon" onClick={handleModelDependency}>
180+
<ActionButton onClick={handleModelDependency}>
180181
<Codicon name="references" label="Model dependency" />
181182
&nbsp;Model dependency
182-
</VscodeButton>
183+
</ActionButton>
183184
)}
184185
</TitleContainer>
185186
{isExpanded && (

extensions/ql-vscode/src/view/model-editor/MethodRow.tsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { VscodeButton } from "@vscode-elements/react-elements";
21
import {
32
forwardRef,
43
useCallback,
@@ -10,6 +9,8 @@ import {
109
import { styled } from "styled-components";
1110
import { vscode } from "../vscode-api";
1211
import { Link } from "../common/Link";
12+
import { ActionButton } from "../common/ActionButton/ActionButton";
13+
import "../common/ActionButton/ActionButton.css";
1314

1415
import type { Method } from "../../model-editor/method";
1516
import type { ModeledMethod } from "../../model-editor/modeled-method";
@@ -61,7 +62,7 @@ const ViewLink = styled(Link)`
6162
white-space: nowrap;
6263
`;
6364

64-
const CodiconRow = styled(VscodeButton)`
65+
const CodiconRow = styled(ActionButton)`
6566
min-height: calc(var(--input-height) * 1px);
6667
align-items: center;
6768
`;
@@ -319,7 +320,6 @@ const ModelableMethodRow = forwardRef<HTMLElement | undefined, MethodRowProps>(
319320
></ModelAlertsIndicator>
320321
{index === 0 ? (
321322
<CodiconRow
322-
appearance="icon"
323323
aria-label="Add new model"
324324
onClick={(event: React.MouseEvent) => {
325325
event.stopPropagation();
@@ -331,7 +331,6 @@ const ModelableMethodRow = forwardRef<HTMLElement | undefined, MethodRowProps>(
331331
</CodiconRow>
332332
) : (
333333
<CodiconRow
334-
appearance="icon"
335334
aria-label="Remove model"
336335
onClick={(event: React.MouseEvent) => {
337336
event.stopPropagation();

0 commit comments

Comments
 (0)