Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace chevron icon with codicon #9770

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions packages/core/src/browser/style/tree.css
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,6 @@
padding-right: calc(var(--theia-ui-padding)/2);
min-width: var(--theia-icon-size);
min-height: var(--theia-icon-size);
background-size: var(--theia-icon-size);
background: var(--theia-icon-chevron-right) center center no-repeat;
}

.theia-ExpansionToggle.theia-mod-busy {
Expand All @@ -83,8 +81,8 @@
cursor: pointer;
}

.theia-ExpansionToggle:not(.theia-mod-busy):not(.theia-mod-collapsed) {
transform: rotate(90deg);
.theia-ExpansionToggle.theia-mod-collapsed:not(.theia-mod-busy) {
transform: rotate(-90deg);
}

.theia-Tree:focus .theia-TreeNode.theia-mod-selected,
Expand Down
4 changes: 3 additions & 1 deletion packages/core/src/browser/tree/tree-widget.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import { Disposable, MenuPath, SelectionService } from '../../common';
import { Key, KeyCode, KeyModifier } from '../keyboard/keys';
import { ContextMenuRenderer } from '../context-menu-renderer';
import { StatefulWidget } from '../shell';
import { EXPANSION_TOGGLE_CLASS, SELECTED_CLASS, COLLAPSED_CLASS, FOCUS_CLASS, Widget, BUSY_CLASS } from '../widgets';
import { EXPANSION_TOGGLE_CLASS, SELECTED_CLASS, COLLAPSED_CLASS, FOCUS_CLASS, BUSY_CLASS, CODICON_TREE_ITEM_CLASSES, Widget } from '../widgets';
import { TreeNode, CompositeTreeNode } from './tree';
import { TreeModel } from './tree-model';
import { ExpandableTreeNode } from './tree-expansion';
Expand Down Expand Up @@ -565,6 +565,8 @@ export class TreeWidget extends ReactWidget implements StatefulWidget {
}
if (node.busy) {
classes.push(BUSY_CLASS);
} else {
classes.push(...CODICON_TREE_ITEM_CLASSES);
}
const className = classes.join(' ');
return <div
Expand Down
6 changes: 3 additions & 3 deletions packages/core/src/browser/view-container.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
import { interfaces, injectable, inject, postConstruct } from 'inversify';
import { IIterator, toArray, find, some, every, map } from '@phosphor/algorithm';
import {
Widget, EXPANSION_TOGGLE_CLASS, COLLAPSED_CLASS, MessageLoop, Message, SplitPanel, BaseWidget,
addEventListener, SplitLayout, LayoutItem, PanelLayout, addKeyListener, waitForRevealed
Widget, EXPANSION_TOGGLE_CLASS, COLLAPSED_CLASS, CODICON_TREE_ITEM_CLASSES, MessageLoop, Message, SplitPanel,
BaseWidget, addEventListener, SplitLayout, LayoutItem, PanelLayout, addKeyListener, waitForRevealed
} from './widgets';
import { Event, Emitter } from '../common/event';
import { Disposable, DisposableCollection } from '../common/disposable';
Expand Down Expand Up @@ -845,7 +845,7 @@ export class ViewContainerPart extends BaseWidget {
disposable.push(addKeyListener(header, Key.ENTER, () => this.collapsed = !this.collapsed));

const toggleIcon = document.createElement('span');
toggleIcon.classList.add(EXPANSION_TOGGLE_CLASS);
toggleIcon.classList.add(EXPANSION_TOGGLE_CLASS, ...CODICON_TREE_ITEM_CLASSES);
if (this.collapsed) {
toggleIcon.classList.add(COLLAPSED_CLASS);
}
Expand Down
1 change: 1 addition & 0 deletions packages/core/src/browser/widgets/widget.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export * from '@phosphor/messaging';

export const DISABLED_CLASS = 'theia-mod-disabled';
export const EXPANSION_TOGGLE_CLASS = 'theia-ExpansionToggle';
export const CODICON_TREE_ITEM_CLASSES = ['codicon', 'codicon-tree-item-expanded'];
export const COLLAPSED_CLASS = 'theia-mod-collapsed';
export const BUSY_CLASS = 'theia-mod-busy';
export const SELECTED_CLASS = 'theia-mod-selected';
Expand Down