Skip to content

Commit

Permalink
SCM UX exploration #101103
Browse files Browse the repository at this point in the history
  • Loading branch information
joaomoreno committed Jul 2, 2020
1 parent 8d699df commit cf6efa6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 14 deletions.
7 changes: 4 additions & 3 deletions src/vs/workbench/contrib/scm/browser/media/scm.css
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@

.scm-view .count {
display: flex;
}

.scm-view .count {
margin-left: 6px;
}

Expand All @@ -39,6 +36,10 @@
overflow: hidden;
}

.scm-view .scm-provider > .label > .name {
font-weight: bold;
}

.scm-view .scm-provider > .label > .description {
opacity: 0.7;
margin-left: 0.5em;
Expand Down
14 changes: 3 additions & 11 deletions src/vs/workbench/contrib/scm/browser/scmViewPane.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import 'vs/css!./media/scm';
import { Event, Emitter } from 'vs/base/common/event';
import { basename, dirname, isEqual } from 'vs/base/common/resources';
import { IDisposable, Disposable, DisposableStore, combinedDisposable, toDisposable } from 'vs/base/common/lifecycle';
import { IDisposable, Disposable, DisposableStore, combinedDisposable } from 'vs/base/common/lifecycle';
import { ViewPane, IViewPaneOptions } from 'vs/workbench/browser/parts/views/viewPaneContainer';
import { append, $, addClass, toggleClass, removeClass, Dimension } from 'vs/base/browser/dom';
import { IListVirtualDelegate, IIdentityProvider } from 'vs/base/browser/ui/list/list';
Expand Down Expand Up @@ -176,10 +176,7 @@ class RepositoryRenderer implements ICompressibleTreeRenderer<ISCMRepository, Fu

renderTemplate(container: HTMLElement): RepositoryTemplate {
// hack
const row = container.parentElement!.parentElement!;
addClass(row.querySelector('.monaco-tl-twistie')! as HTMLElement, 'force-twistie');
addClass(row, 'scm-provider-row');
const rowDisposable = toDisposable(() => removeClass(row, 'scm-provider-row'));
addClass(container.parentElement!.parentElement!.querySelector('.monaco-tl-twistie')! as HTMLElement, 'force-twistie');

const provider = append(container, $('.scm-provider'));
const label = append(provider, $('.label'));
Expand All @@ -193,7 +190,7 @@ class RepositoryRenderer implements ICompressibleTreeRenderer<ISCMRepository, Fu
const visibilityDisposable = toolBar.onDidChangeDropdownVisibility(e => toggleClass(provider, 'active', e));

const disposable = Disposable.None;
const templateDisposable = combinedDisposable(rowDisposable, visibilityDisposable, toolBar, badgeStyler);
const templateDisposable = combinedDisposable(visibilityDisposable, toolBar, badgeStyler);

return { name, description, countContainer, count, toolBar, disposable, templateDisposable };
}
Expand Down Expand Up @@ -1885,9 +1882,4 @@ registerThemingParticipant((theme, collector) => {
if (repositoryStatusActionsBorderColor) {
collector.addRule(`.scm-view .scm-provider > .status > .monaco-action-bar > .actions-container { border-color: ${repositoryStatusActionsBorderColor}; }`);
}

const providerSeparatorBorderColor = theme.getColor(scmProviderSeparatorBorderColor);
if (providerSeparatorBorderColor) {
collector.addRule(`.scm-view .scm-provider-row:not([data-index="0"]) { border-top: 1px dashed ${providerSeparatorBorderColor}; }`);
}
});

0 comments on commit cf6efa6

Please sign in to comment.