Skip to content

Commit 0f7f6e3

Browse files
author
Jackson Kearl
committed
1 parent bc566d4 commit 0f7f6e3

File tree

2 files changed

+32
-11
lines changed

2 files changed

+32
-11
lines changed

src/vs/workbench/contrib/welcome/gettingStarted/browser/gettingStarted.css

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -717,10 +717,19 @@
717717
text-align: center;
718718
}
719719

720-
.monaco-workbench .part.editor>.content .gettingStartedContainer .gettingStartedSlide .showOnStartup checkbox {
721-
position: relative;
722-
top: -2px;
723-
left: 5px;
720+
.monaco-workbench .part.editor>.content .gettingStartedContainer .gettingStartedSlide .getting-started-checkbox {
721+
color: inherit !important;
722+
height: 18px;
723+
width: 18px;
724+
border: 1px solid transparent;
725+
border-radius: 3px;
726+
padding: 0;
727+
margin-right: 9px;
728+
}
729+
730+
731+
.monaco-workbench .part.editor>.content .gettingStartedContainer .gettingStartedSlide .getting-started-checkbox.codicon:not(.checked)::before {
732+
opacity: 0;
724733
}
725734

726735
.monaco-workbench .part.editor>.content .gettingStartedContainer .gettingStartedSlideCategories>.gettingStartedCategoriesContainer>.footer p {

src/vs/workbench/contrib/welcome/gettingStarted/browser/gettingStarted.ts

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,8 @@ import { getTelemetryLevel } from 'vs/platform/telemetry/common/telemetryUtils';
7070
import { WorkbenchStateContext } from 'vs/workbench/browser/contextkeys';
7171
import { IsIOSContext } from 'vs/platform/contextkey/common/contextkeys';
7272
import { AddRootFolderAction } from 'vs/workbench/browser/actions/workspaceActions';
73+
import { Checkbox } from 'vs/base/browser/ui/checkbox/checkbox';
74+
import { Codicon } from 'vs/base/common/codicons';
7375

7476
const SLIDE_TRANSITION_TIME_MS = 250;
7577
const configurationKey = 'workbench.startupEditor';
@@ -150,6 +152,7 @@ export class GettingStartedPage extends EditorPane {
150152
private layoutMarkdown: (() => void) | undefined;
151153

152154
private webviewID = generateUuid();
155+
private categoriesSlideDisposables: DisposableStore;
153156

154157
constructor(
155158
@ICommandService private readonly commandService: ICommandService,
@@ -187,6 +190,8 @@ export class GettingStartedPage extends EditorPane {
187190
this.stepMediaComponent = $('.getting-started-media');
188191
this.stepMediaComponent.id = generateUuid();
189192

193+
this.categoriesSlideDisposables = this._register(new DisposableStore());
194+
190195
this.contextService = this._register(contextService.createScoped(this.container));
191196
inWelcomeContext.bindTo(this.contextService).set(true);
192197
embedderIdentifierContext.bindTo(this.contextService).set(productService.embedderIdentifier);
@@ -861,10 +866,17 @@ export class GettingStartedPage extends EditorPane {
861866
}
862867

863868
private async buildCategoriesSlide() {
864-
const showOnStartupCheckbox = $('input.checkbox', { id: 'showOnStartup', type: 'checkbox' }) as HTMLInputElement;
869+
this.categoriesSlideDisposables.clear();
870+
const showOnStartupCheckbox = new Checkbox({
871+
icon: Codicon.check,
872+
actionClassName: 'getting-started-checkbox',
873+
isChecked: this.configurationService.getValue(configurationKey) === 'welcomePage',
874+
title: localize('checkboxTitle', "When checked, this page will be shown on startup."),
875+
});
876+
showOnStartupCheckbox.domNode.id = 'showOnStartup';
865877

866-
showOnStartupCheckbox.checked = this.configurationService.getValue(configurationKey) === 'welcomePage';
867-
this._register(addDisposableListener(showOnStartupCheckbox, 'click', () => {
878+
this.categoriesSlideDisposables.add(showOnStartupCheckbox);
879+
this.categoriesSlideDisposables.add(showOnStartupCheckbox.onChange(() => {
868880
if (showOnStartupCheckbox.checked) {
869881
this.telemetryService.publicLog2<GettingStartedActionEvent, GettingStartedActionClassification>('gettingStarted.ActionExecuted', { command: 'showOnStartupChecked', argument: undefined });
870882
this.configurationService.updateValue(configurationKey, 'welcomePage');
@@ -889,7 +901,7 @@ export class GettingStartedPage extends EditorPane {
889901

890902
const footer = $('.footer', {},
891903
$('p.showOnStartup', {},
892-
showOnStartupCheckbox,
904+
showOnStartupCheckbox.domNode,
893905
$('label.caption', { for: 'showOnStartup' }, localize('welcomePage.showOnStartup', "Show welcome page on startup"))
894906
));
895907

@@ -1638,16 +1650,16 @@ registerThemingParticipant((theme, collector) => {
16381650

16391651
const checkboxBackground = theme.getColor(simpleCheckboxBackground);
16401652
if (checkboxBackground) {
1641-
collector.addRule(`.monaco-workbench .part.editor>.content .gettingStartedContainer .showOnStartup .checkbox { background-color: ${checkboxBackground}; }`);
1653+
collector.addRule(`.monaco-workbench .part.editor>.content .gettingStartedContainer .gettingStartedSlide .getting-started-checkbox { background-color: ${checkboxBackground} !important; }`);
16421654
}
16431655

16441656
const checkboxForeground = theme.getColor(simpleCheckboxForeground);
16451657
if (checkboxForeground) {
1646-
collector.addRule(`.monaco-workbench .part.editor>.content .gettingStartedContainer .showOnStartup .checkbox { color: ${checkboxForeground}; }`);
1658+
collector.addRule(`.monaco-workbench .part.editor>.content .gettingStartedContainer .gettingStartedSlide .getting-started-checkbox { color: ${checkboxForeground} !important; }`);
16471659
}
16481660

16491661
const checkboxBorder = theme.getColor(simpleCheckboxBorder);
16501662
if (checkboxBorder) {
1651-
collector.addRule(`.monaco-workbench .part.editor>.content .gettingStartedContainer .showOnStartup .checkbox { border-color: ${checkboxBorder}; }`);
1663+
collector.addRule(`.monaco-workbench .part.editor>.content .gettingStartedContainer .gettingStartedSlide .getting-started-checkbox { border-color: ${checkboxBorder} !important; }`);
16521664
}
16531665
});

0 commit comments

Comments
 (0)