mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-03-30 16:50:30 -04:00
Merge from vscode e0762af258c0b20320ed03f3871a41967acc4421 (#7404)
* Merge from vscode e0762af258c0b20320ed03f3871a41967acc4421 * readd svgs
This commit is contained in:
@@ -11,7 +11,7 @@ import { VIEWLET_ID, ISCMService, ISCMRepository } from 'vs/workbench/contrib/sc
|
||||
import { IActivityService, NumberBadge } from 'vs/workbench/services/activity/common/activity';
|
||||
import { IWorkbenchContribution } from 'vs/workbench/common/contributions';
|
||||
import { IContextKeyService, IContextKey } from 'vs/platform/contextkey/common/contextkey';
|
||||
import { IStatusbarService, StatusbarAlignment as MainThreadStatusBarAlignment } from 'vs/platform/statusbar/common/statusbar';
|
||||
import { IStatusbarService, StatusbarAlignment as MainThreadStatusBarAlignment } from 'vs/workbench/services/statusbar/common/statusbar';
|
||||
import { IEditorService } from 'vs/workbench/services/editor/common/editorService';
|
||||
import { commonPrefixLength } from 'vs/base/common/strings';
|
||||
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
|
||||
|
||||
@@ -96,10 +96,6 @@
|
||||
text-decoration: line-through;
|
||||
}
|
||||
|
||||
.scm-viewlet .monaco-list-row .resource > .name > .monaco-icon-label::after {
|
||||
padding: 0 8px;
|
||||
}
|
||||
|
||||
.scm-viewlet .monaco-list-row .resource-group > .count {
|
||||
padding: 0 8px;
|
||||
display: flex;
|
||||
|
||||
@@ -372,7 +372,7 @@ function groupItemAsTreeElement(item: IGroupItem, mode: ViewModelMode): ICompres
|
||||
? Iterator.map(Iterator.fromArray(item.resources), element => ({ element, incompressible: true }))
|
||||
: Iterator.map(item.tree.root.children, node => asTreeElement(node, true));
|
||||
|
||||
return { element: item.group, children, incompressible: true };
|
||||
return { element: item.group, children, incompressible: true, collapsible: true };
|
||||
}
|
||||
|
||||
function asTreeElement(node: INode<ISCMResource, ISCMResourceGroup>, incompressible: boolean): ICompressedTreeElement<TreeElement> {
|
||||
@@ -389,13 +389,12 @@ function asTreeElement(node: INode<ISCMResource, ISCMResourceGroup>, incompressi
|
||||
}
|
||||
|
||||
const enum ViewModelMode {
|
||||
List = 'codicon-filter',
|
||||
Tree = 'codicon-selection'
|
||||
List,
|
||||
Tree
|
||||
}
|
||||
|
||||
class ViewModel {
|
||||
|
||||
private _mode = ViewModelMode.Tree;
|
||||
private readonly _onDidChangeMode = new Emitter<ViewModelMode>();
|
||||
readonly onDidChangeMode = this._onDidChangeMode.event;
|
||||
|
||||
@@ -413,7 +412,8 @@ class ViewModel {
|
||||
|
||||
constructor(
|
||||
private groups: ISequence<ISCMResourceGroup>,
|
||||
private tree: ObjectTree<TreeElement, FuzzyScore>
|
||||
private tree: ObjectTree<TreeElement, FuzzyScore>,
|
||||
private _mode: ViewModelMode
|
||||
) { }
|
||||
|
||||
private onDidSpliceGroups({ start, deleteCount, toInsert }: ISplice<ISCMResourceGroup>): void {
|
||||
@@ -507,7 +507,8 @@ export class ToggleViewModeAction extends Action {
|
||||
}
|
||||
|
||||
private onDidChangeMode(mode: ViewModelMode): void {
|
||||
this.class = `scm-action toggle-view-mode ${mode}`;
|
||||
const iconClass = mode === ViewModelMode.List ? 'codicon-filter' : 'codicon-selection';
|
||||
this.class = `scm-action toggle-view-mode ${iconClass}`;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -693,7 +694,8 @@ export class RepositoryPanel extends ViewletPanel {
|
||||
this._register(this.tree.onContextMenu(this.onListContextMenu, this));
|
||||
this._register(this.tree);
|
||||
|
||||
this.viewModel = new ViewModel(this.repository.provider.groups, this.tree);
|
||||
const mode = this.configurationService.getValue<'tree' | 'list'>('scm.defaultViewMode') === 'list' ? ViewModelMode.List : ViewModelMode.Tree;
|
||||
this.viewModel = new ViewModel(this.repository.provider.groups, this.tree, mode);
|
||||
this._register(this.viewModel);
|
||||
|
||||
addClass(this.listContainer, 'file-icon-themable-tree');
|
||||
|
||||
@@ -106,6 +106,16 @@ Registry.as<IConfigurationRegistry>(ConfigurationExtensions.Configuration).regis
|
||||
],
|
||||
description: localize('scm.countBadge', "Controls the Source Control count badge."),
|
||||
default: 'all'
|
||||
},
|
||||
'scm.defaultViewMode': {
|
||||
type: 'string',
|
||||
enum: ['tree', 'list'],
|
||||
enumDescriptions: [
|
||||
localize('scm.defaultViewMode.tree', "Show the repository changes as a tree."),
|
||||
localize('scm.defaultViewMode.list', "Show the repository changes as a list.")
|
||||
],
|
||||
description: localize('scm.defaultViewMode', "Controls the default Source Control repository view mode."),
|
||||
default: 'tree'
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user