Skip to content

Commit c1d367f

Browse files
Fix the git-diff widget header details alignment
Fixes #5996 - fixes the `git-diff` widget header details but updating the css specifically for the `git-diff` widget header. Originally the `path` and `revision` details were not aligned properly and it has been resolved so that they are displayed inline with their values. Signed-off-by: Vincent Fugnitto <vincent.fugnitto@ericsson.com>
1 parent 2c4c9b0 commit c1d367f

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

packages/git/src/browser/diff/git-diff-widget.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@ export class GitDiffWidget extends GitNavigableListWidget<GitFileChangeNode> imp
153153

154154
protected renderPathHeader(): React.ReactNode {
155155
return this.renderHeaderRow({
156+
classNames: ['diff-header'],
156157
name: 'path',
157158
value: this.renderPath()
158159
});
@@ -171,6 +172,7 @@ export class GitDiffWidget extends GitNavigableListWidget<GitFileChangeNode> imp
171172

172173
protected renderRevisionHeader(): React.ReactNode {
173174
return this.renderHeaderRow({
175+
classNames: ['diff-header'],
174176
name: 'revision: ',
175177
value: this.renderRevision()
176178
});
@@ -193,7 +195,7 @@ export class GitDiffWidget extends GitNavigableListWidget<GitFileChangeNode> imp
193195
}
194196
protected doRenderToolbar(...children: React.ReactNode[]): React.ReactNode {
195197
return this.renderHeaderRow({
196-
classNames: ['space-between'],
198+
classNames: ['diff-nav', 'space-between'],
197199
name: 'Files changed',
198200
value: <div className='lrBtns'>{...children}</div>
199201
});

packages/git/src/browser/style/diff.css

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,28 @@
4444
flex-direction: row;
4545
}
4646

47+
.theia-git .header-row.diff-header,
48+
.theia-git .header-row.diff-nav {
49+
margin-bottom: 10px;
50+
}
51+
4752
.theia-git .header-value {
4853
margin: 9px 0px 5px 5px;
4954
overflow: hidden;
5055
text-overflow: ellipsis;
5156
white-space: nowrap;
5257
}
5358

59+
.theia-git .diff-header .header-value {
60+
align-self: center;
61+
margin: 0px;
62+
}
63+
64+
.theia-git .diff-header .theia-header {
65+
align-self: center;
66+
padding-right: 5px;
67+
}
68+
5469
.theia-git .gitItem.diff-file {
5570
margin: 1px 0 !important;
5671
padding: 0 !important;

0 commit comments

Comments
 (0)