Merge pull request #76387 from skprabhanjan/fix-76141
Fix-76141 Add border around image in image preview
This commit is contained in:
commit
bc7f5a7206
|
@ -21,6 +21,8 @@ import { IFileService } from 'vs/platform/files/common/files';
|
|||
import { IStatusbarEntry, IStatusbarEntryAccessor, IStatusbarService, StatusbarAlignment } from 'vs/platform/statusbar/common/statusbar';
|
||||
import { IEditorService } from 'vs/workbench/services/editor/common/editorService';
|
||||
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { ITheme, registerThemingParticipant, ICssStyleCollector } from 'vs/platform/theme/common/themeService';
|
||||
import { IMAGE_PREVIEW_BORDER } from 'vs/workbench/common/theme';
|
||||
|
||||
export interface IResourceDescriptor {
|
||||
readonly resource: URI;
|
||||
|
@ -67,6 +69,11 @@ interface ResourceViewerDelegate {
|
|||
metadataClb(meta: string): void;
|
||||
}
|
||||
|
||||
registerThemingParticipant((theme: ITheme, collector: ICssStyleCollector) => {
|
||||
const borderColor = theme.getColor(IMAGE_PREVIEW_BORDER);
|
||||
collector.addRule(`.monaco-resource-viewer.image img { border : 1px solid ${borderColor ? borderColor.toString() : ''}; }`);
|
||||
});
|
||||
|
||||
/**
|
||||
* Helper to actually render the given resource into the provided container. Will adjust scrollbar (if provided) automatically based on loading
|
||||
* progress of the binary resource.
|
||||
|
|
|
@ -200,7 +200,13 @@ export const EDITOR_DRAG_AND_DROP_BACKGROUND = registerColor('editorGroup.dropBa
|
|||
hc: null
|
||||
}, nls.localize('editorDragAndDropBackground', "Background color when dragging editors around. The color should have transparency so that the editor contents can still shine through."));
|
||||
|
||||
// < --- Resource Viewer --- >
|
||||
|
||||
export const IMAGE_PREVIEW_BORDER = registerColor('imagePreview.border', {
|
||||
dark: Color.fromHex('#808080').transparent(0.35),
|
||||
light: Color.fromHex('#808080').transparent(0.35),
|
||||
hc: contrastBorder
|
||||
}, nls.localize('imagePreviewBorder', "Border color for image in image preview."));
|
||||
|
||||
// < --- Panels --- >
|
||||
|
||||
|
|
Loading…
Reference in a new issue