Skip to content

Commit

Permalink
Fix icon after toggle
Browse files Browse the repository at this point in the history
Signed-off-by: Igor Vinokur <ivinokur@redhat.com>
  • Loading branch information
vinokurig committed May 27, 2019
1 parent 55f7acb commit ddcb93d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
6 changes: 2 additions & 4 deletions packages/git/src/browser/git-contribution.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,7 @@ export namespace GIT_COMMANDS {
id: 'git-commit-add-sign-off',
label: 'Add Signed-off-by',
iconClass: 'fa fa-pencil-square-o',
category: 'navigation',
props: { ['group']: 'navigation' }
category: 'navigation'
};
export const COMMIT_AMEND = {
id: 'git.commit.amend'
Expand Down Expand Up @@ -224,8 +223,7 @@ export namespace GIT_COMMANDS {
id: 'git-refresh',
label: 'Refresh',
iconClass: 'fa fa-refresh',
category: 'navigation',
props: { ['group']: 'navigation' }
category: 'navigation'
};
}

Expand Down
14 changes: 10 additions & 4 deletions packages/scm/src/browser/scm-widget.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,6 @@ export class ScmWidget extends ScmNavigableListWidget<ScmResource> implements St
constructor() {
super();
this.id = 'theia-scmContainer';
this.title.label = ScmWidget.LABEL;
this.title.caption = ScmWidget.LABEL;
this.title.closable = true;
this.title.iconClass = 'scm-tab-icon';
this.addClass('theia-scm');
this.scrollContainer = ScmWidget.Styles.GROUPS_CONTAINER;

Expand Down Expand Up @@ -122,11 +118,21 @@ export class ScmWidget extends ScmNavigableListWidget<ScmResource> implements St
this.shell.leftPanelHandler.refresh();
this.update();
} else {
this.title.label = ScmWidget.LABEL;
this.selectedRepoUri = undefined;
}
});
}

protected onBeforeAttach(msg: Message): void {
const repository = this.scmService.selectedRepository;
this.title.iconClass = 'scm-tab-icon';
this.title.label = ScmWidget.LABEL + (repository ? ': ' + repository.provider.contextValue : '');
this.title.caption = ScmWidget.LABEL;
this.title.closable = true;
super.onBeforeAttach(msg);
}

get onUpdate(): CoreEvent<void> {
return this.onUpdateEmitter.event;
}
Expand Down

0 comments on commit ddcb93d

Please sign in to comment.