Skip to content

Commit ffc49d5

Browse files
committed
Added same border color as panel border , added image preview border color in theme
1 parent a08e8e0 commit ffc49d5

3 files changed

Lines changed: 13 additions & 1 deletion

File tree

src/vs/workbench/browser/parts/editor/media/resourceviewer.css

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
padding: 0;
2323
background-position: 0 0, 8px 8px;
2424
background-size: 16px 16px;
25-
border: 1px solid;
2625
}
2726

2827
.vs .monaco-resource-viewer.image img {

src/vs/workbench/browser/parts/editor/resourceViewer.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ import { IFileService } from 'vs/platform/files/common/files';
2121
import { IStatusbarEntry, IStatusbarEntryAccessor, IStatusbarService, StatusbarAlignment } from 'vs/platform/statusbar/common/statusbar';
2222
import { IEditorService } from 'vs/workbench/services/editor/common/editorService';
2323
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
24+
import { ITheme, registerThemingParticipant, ICssStyleCollector } from 'vs/platform/theme/common/themeService';
25+
import { IMAGE_PREVIEW_BORDER } from 'vs/workbench/common/theme';
2426

2527
export interface IResourceDescriptor {
2628
readonly resource: URI;
@@ -67,6 +69,11 @@ interface ResourceViewerDelegate {
6769
metadataClb(meta: string): void;
6870
}
6971

72+
registerThemingParticipant((theme: ITheme, collector: ICssStyleCollector) => {
73+
const borderColor = theme.getColor(IMAGE_PREVIEW_BORDER);
74+
collector.addRule(`.monaco-resource-viewer.image img { border : 1px solid ${borderColor ? borderColor.toString() : ''}; }`);
75+
});
76+
7077
/**
7178
* Helper to actually render the given resource into the provided container. Will adjust scrollbar (if provided) automatically based on loading
7279
* progress of the binary resource.

src/vs/workbench/common/theme.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,13 @@ export const EDITOR_DRAG_AND_DROP_BACKGROUND = registerColor('editorGroup.dropBa
200200
hc: null
201201
}, nls.localize('editorDragAndDropBackground', "Background color when dragging editors around. The color should have transparency so that the editor contents can still shine through."));
202202

203+
// < --- Resource Viewer --- >
203204

205+
export const IMAGE_PREVIEW_BORDER = registerColor('imagePreview.border', {
206+
dark: Color.fromHex('#808080').transparent(0.35),
207+
light: Color.fromHex('#808080').transparent(0.35),
208+
hc: contrastBorder
209+
}, nls.localize('imagePreviewBorder', "Border color for image in image preview."));
204210

205211
// < --- Panels --- >
206212

0 commit comments

Comments
 (0)