Skip to content

Commit fdddaf7

Browse files
authored
Dropdown buttons have two different visuals (#7381)
Fixes #6716
1 parent 078592a commit fdddaf7

File tree

4 files changed

+29
-38
lines changed

4 files changed

+29
-38
lines changed

webviews/activityBarView/index.css

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,6 @@ form button {
104104
.select-control button,
105105
.branch-status-container button,
106106
input[type='submit'] {
107-
min-height: 31px;
108107
white-space: normal;
109108
}
110109

@@ -191,31 +190,3 @@ button.split-left {
191190
white-space: nowrap;
192191
text-overflow: ellipsis;
193192
}
194-
195-
196-
.split {
197-
width: 1px; height: 100%;
198-
background-color: var(--vscode-button-background);
199-
opacity: 0.5;
200-
}
201-
202-
button.split-right {
203-
border-radius: 0 2px 2px 0;
204-
cursor: pointer;
205-
width: 24px; height: 28px;
206-
position: relative;
207-
}
208-
209-
button.split-right:disabled {
210-
cursor: default;
211-
}
212-
213-
button.split-right .icon {
214-
pointer-events: none;
215-
position: absolute;
216-
top: 6px; right: 4px;
217-
}
218-
219-
button.split-right .icon svg path {
220-
fill: unset;
221-
}

webviews/common/common.css

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,14 @@ input.select-left {
4545

4646
button.select-right {
4747
border-radius: 0 2px 2px 0;
48+
width: 24px;
49+
position: relative;
50+
}
51+
52+
button.select-right span {
53+
position: absolute;
54+
top: 2px;
55+
right: 4px;
4856
}
4957

5058
button:focus,
@@ -354,17 +362,26 @@ button.split-left {
354362
}
355363

356364
.split {
357-
width: 1px;
358-
height: 100%;
359365
background-color: var(--vscode-button-background);
360-
opacity: 0.5;
366+
border-top: 1px solid var(--vscode-button-border);
367+
border-bottom: 1px solid var(--vscode-button-border);
368+
padding: 4px 0;
361369
}
362370

363-
.split.secondary {
364-
width: 1px;
371+
.split .separator {
365372
height: 100%;
373+
width: 1px;
374+
background-color: var(--vscode-button-separator);
375+
}
376+
377+
.split.disabled {
378+
opacity: 0.4;
379+
}
380+
381+
.split.secondary {
366382
background-color: var(--vscode-button-secondaryBackground);
367-
opacity: 0.5;
383+
border-top: 1px solid var(--vscode-button-secondaryBorder);
384+
border-bottom: 1px solid var(--vscode-button-secondaryBorder);
368385
}
369386

370387
button.split-right {
@@ -381,7 +398,7 @@ button.split-right:disabled {
381398
button.split-right .icon {
382399
pointer-events: none;
383400
position: absolute;
384-
top: 6px;
401+
top: 4px;
385402
right: 4px;
386403
}
387404

@@ -449,6 +466,7 @@ button.inlined-dropdown {
449466
0% {
450467
transform: rotate(0deg);
451468
}
469+
452470
100% {
453471
transform: rotate(360deg);
454472
}

webviews/components/contextDropdown.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,9 @@ export const ContextDropdown = ({ optionsContext, defaultOptionLabel, defaultOpt
6464
title={defaultOptionLabel()}>
6565
{defaultOptionLabel()}
6666
</button>
67-
<div className={`split${isSecondary ? ' secondary' : ''}`}></div>
67+
{hasSingleAction ? null :
68+
<div className={`split${isSecondary ? ' secondary' : ''}${disabled ? ' disabled' : ''}`}><div className={`separator${disabled ? ' disabled' : ''}`}></div></div>
69+
}
6870
{hasSingleAction ? null :
6971
<button className={`split-right${isSecondary ? ' secondary' : ''}`} title={optionsTitle} disabled={disabled} aria-expanded={expanded} onClick={(e) => {
7072
e.preventDefault();

webviews/components/dropdown.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ export const Dropdown = ({ options, defaultOption, disabled, submitAction, chang
9696
submitAction={submitAction}
9797
disabled={!!disabled}
9898
/>
99-
<div className='split'></div>
99+
<div className={`split${disabled ? ' disabled' : ''}`}><div className={`separator${disabled ? ' disabled' : ''}`}></div></div>
100100
<button id={EXPAND_OPTIONS_BUTTON} className={'select-right ' + expandButtonClass} aria-label='Expand button options' onClick={onClick}>
101101
{chevronIcon}
102102
</button>

0 commit comments

Comments
 (0)