mirror of
https://github.com/voideditor/void
synced 2026-05-24 09:58:23 +00:00
fix: add more changes for platform
This commit is contained in:
parent
b638e890d5
commit
efc3022b26
7 changed files with 33 additions and 20 deletions
|
|
@ -166,8 +166,8 @@ export class ActionList<T> extends Disposable {
|
|||
|
||||
private readonly _list: List<IActionListItem<T>>;
|
||||
|
||||
private readonly _actionLineHeight = 28;
|
||||
private readonly _headerLineHeight = 28;
|
||||
private readonly _actionLineHeight = 24;
|
||||
private readonly _headerLineHeight = 26;
|
||||
|
||||
private readonly _allMenuItems: readonly IActionListItem<T>[];
|
||||
|
||||
|
|
|
|||
|
|
@ -132,8 +132,9 @@
|
|||
/* Action bar */
|
||||
|
||||
.action-widget .action-widget-action-bar {
|
||||
background-color: var(--vscode-editorHoverWidget-statusBarBackground);
|
||||
background-color: var(--vscode-editorActionList-background);
|
||||
border-top: 1px solid var(--vscode-editorHoverWidget-border);
|
||||
margin-top: 2px;
|
||||
}
|
||||
|
||||
.action-widget .action-widget-action-bar::before {
|
||||
|
|
@ -143,7 +144,7 @@
|
|||
}
|
||||
|
||||
.action-widget .action-widget-action-bar .actions-container {
|
||||
padding: 0 8px;
|
||||
padding: 3px 8px 0;
|
||||
}
|
||||
|
||||
.action-widget-action-bar .action-label {
|
||||
|
|
|
|||
|
|
@ -16,15 +16,15 @@ export class GlobalExtensionEnablementService extends Disposable implements IGlo
|
|||
|
||||
private _onDidChangeEnablement = new Emitter<{ readonly extensions: IExtensionIdentifier[]; readonly source?: string }>();
|
||||
readonly onDidChangeEnablement: Event<{ readonly extensions: IExtensionIdentifier[]; readonly source?: string }> = this._onDidChangeEnablement.event;
|
||||
private readonly storageManger: StorageManager;
|
||||
private readonly storageManager: StorageManager;
|
||||
|
||||
constructor(
|
||||
@IStorageService storageService: IStorageService,
|
||||
@IExtensionManagementService extensionManagementService: IExtensionManagementService,
|
||||
) {
|
||||
super();
|
||||
this.storageManger = this._register(new StorageManager(storageService));
|
||||
this._register(this.storageManger.onDidChange(extensions => this._onDidChangeEnablement.fire({ extensions, source: 'storage' })));
|
||||
this.storageManager = this._register(new StorageManager(storageService));
|
||||
this._register(this.storageManager.onDidChange(extensions => this._onDidChangeEnablement.fire({ extensions, source: 'storage' })));
|
||||
this._register(extensionManagementService.onDidInstallExtensions(e => e.forEach(({ local, operation }) => {
|
||||
if (local && operation === InstallOperation.Migrate) {
|
||||
this._removeFromDisabledExtensions(local.identifier); /* Reset migrated extensions */
|
||||
|
|
@ -84,11 +84,11 @@ export class GlobalExtensionEnablementService extends Disposable implements IGlo
|
|||
}
|
||||
|
||||
private _getExtensions(storageId: string): IExtensionIdentifier[] {
|
||||
return this.storageManger.get(storageId, StorageScope.PROFILE);
|
||||
return this.storageManager.get(storageId, StorageScope.PROFILE);
|
||||
}
|
||||
|
||||
private _setExtensions(storageId: string, extensions: IExtensionIdentifier[]): void {
|
||||
this.storageManger.set(storageId, extensions, StorageScope.PROFILE);
|
||||
this.storageManager.set(storageId, extensions, StorageScope.PROFILE);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
import { VSBuffer } from 'vs/base/common/buffer';
|
||||
import { Event } from 'vs/base/common/event';
|
||||
import { URI } from 'vs/base/common/uri';
|
||||
import { MessageBoxOptions, MessageBoxReturnValue, OpenDevToolsOptions, OpenDialogOptions, OpenDialogReturnValue, SaveDialogOptions, SaveDialogReturnValue } from 'vs/base/parts/sandbox/common/electronTypes';
|
||||
import { MessageBoxOptions, MessageBoxReturnValue, OpenDialogOptions, OpenDialogReturnValue, SaveDialogOptions, SaveDialogReturnValue } from 'vs/base/parts/sandbox/common/electronTypes';
|
||||
import { ISerializableCommandAction } from 'vs/platform/action/common/action';
|
||||
import { INativeOpenDialogOptions } from 'vs/platform/dialogs/common/dialogs';
|
||||
import { createDecorator } from 'vs/platform/instantiation/common/instantiation';
|
||||
|
|
@ -178,7 +178,7 @@ export interface ICommonNativeHostService {
|
|||
exit(code: number): Promise<void>;
|
||||
|
||||
// Development
|
||||
openDevTools(options?: Partial<OpenDevToolsOptions> & INativeHostOptions): Promise<void>;
|
||||
openDevTools(options?: INativeHostOptions): Promise<void>;
|
||||
toggleDevTools(options?: INativeHostOptions): Promise<void>;
|
||||
|
||||
// Perf Introspection
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
import * as fs from 'fs';
|
||||
import { exec } from 'child_process';
|
||||
import { app, BrowserWindow, clipboard, Display, Menu, MessageBoxOptions, MessageBoxReturnValue, OpenDevToolsOptions, OpenDialogOptions, OpenDialogReturnValue, powerMonitor, SaveDialogOptions, SaveDialogReturnValue, screen, shell, webContents } from 'electron';
|
||||
import { app, BrowserWindow, clipboard, Display, Menu, MessageBoxOptions, MessageBoxReturnValue, OpenDialogOptions, OpenDialogReturnValue, powerMonitor, SaveDialogOptions, SaveDialogReturnValue, screen, shell, webContents } from 'electron';
|
||||
import { arch, cpus, freemem, loadavg, platform, release, totalmem, type } from 'os';
|
||||
import { promisify } from 'util';
|
||||
import { memoize } from 'vs/base/common/decorators';
|
||||
|
|
@ -33,7 +33,7 @@ import { IProductService } from 'vs/platform/product/common/productService';
|
|||
import { IPartsSplash } from 'vs/platform/theme/common/themeService';
|
||||
import { IThemeMainService } from 'vs/platform/theme/electron-main/themeMainService';
|
||||
import { ICodeWindow } from 'vs/platform/window/electron-main/window';
|
||||
import { IColorScheme, IOpenedAuxiliaryWindow, IOpenedMainWindow, IOpenEmptyWindowOptions, IOpenWindowOptions, IPoint, IRectangle, IWindowOpenable } from 'vs/platform/window/common/window';
|
||||
import { IColorScheme, IOpenedAuxiliaryWindow, IOpenedMainWindow, IOpenEmptyWindowOptions, IOpenWindowOptions, IPoint, IRectangle, IWindowOpenable, useWindowControlsOverlay } from 'vs/platform/window/common/window';
|
||||
import { IWindowsMainService, OpenContext } from 'vs/platform/windows/electron-main/windows';
|
||||
import { isWorkspaceIdentifier, toWorkspaceIdentifier } from 'vs/platform/workspace/common/workspace';
|
||||
import { IWorkspacesManagementMainService } from 'vs/platform/workspaces/electron-main/workspacesManagementMainService';
|
||||
|
|
@ -855,14 +855,28 @@ export class NativeHostMainService extends Disposable implements INativeHostMain
|
|||
|
||||
//#region Development
|
||||
|
||||
async openDevTools(windowId: number | undefined, options?: Partial<OpenDevToolsOptions> & INativeHostOptions): Promise<void> {
|
||||
async openDevTools(windowId: number | undefined, options?: INativeHostOptions): Promise<void> {
|
||||
const window = this.windowById(options?.targetWindowId, windowId);
|
||||
window?.win?.webContents.openDevTools(options?.mode ? { mode: options.mode, activate: options.activate } : undefined);
|
||||
|
||||
let mode: 'bottom' | undefined = undefined;
|
||||
if (isLinux && useWindowControlsOverlay(this.configurationService)) {
|
||||
mode = 'bottom'; // TODO@bpasero WCO and devtools collide with default option 'right'
|
||||
}
|
||||
window?.win?.webContents.openDevTools(mode ? { mode } : undefined);
|
||||
}
|
||||
|
||||
async toggleDevTools(windowId: number | undefined, options?: INativeHostOptions): Promise<void> {
|
||||
const window = this.windowById(options?.targetWindowId, windowId);
|
||||
window?.win?.webContents.toggleDevTools();
|
||||
const webContents = window?.win?.webContents;
|
||||
if (!webContents) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (isLinux && useWindowControlsOverlay(this.configurationService) && !webContents.isDevToolsOpened()) {
|
||||
webContents.openDevTools({ mode: 'bottom' }); // TODO@bpasero WCO and devtools collide with default option 'right'
|
||||
} else {
|
||||
webContents.toggleDevTools();
|
||||
}
|
||||
}
|
||||
|
||||
//#endregion
|
||||
|
|
|
|||
|
|
@ -159,7 +159,7 @@ class ColorRegistry implements IColorRegistry {
|
|||
public registerColor(id: string, defaults: ColorDefaults | ColorValue | null, description: string, needsTransparency = false, deprecationMessage?: string): ColorIdentifier {
|
||||
const colorContribution: ColorContribution = { id, description, defaults, needsTransparency, deprecationMessage };
|
||||
this.colorsById[id] = colorContribution;
|
||||
const propertySchema: IJSONSchemaWithSnippets = { type: 'string', description, format: 'color-hex', defaultSnippets: [{ body: '${1:#ff0000}' }] };
|
||||
const propertySchema: IJSONSchemaWithSnippets = { type: 'string', format: 'color-hex', defaultSnippets: [{ body: '${1:#ff0000}' }] };
|
||||
if (deprecationMessage) {
|
||||
propertySchema.deprecationMessage = deprecationMessage;
|
||||
}
|
||||
|
|
@ -168,6 +168,7 @@ class ColorRegistry implements IColorRegistry {
|
|||
propertySchema.patternErrorMessage = nls.localize('transparecyRequired', 'This color must be transparent or it will obscure content');
|
||||
}
|
||||
this.colorSchema.properties[id] = {
|
||||
description,
|
||||
oneOf: [
|
||||
propertySchema,
|
||||
{ type: 'string', const: DEFAULT_COLOR_CONFIG_VALUE, description: nls.localize('useDefault', 'Use the default color.') }
|
||||
|
|
|
|||
|
|
@ -14,7 +14,6 @@ import { NativeParsedArgs } from 'vs/platform/environment/common/argv';
|
|||
import { FileType } from 'vs/platform/files/common/files';
|
||||
import { ILoggerResource, LogLevel } from 'vs/platform/log/common/log';
|
||||
import { PolicyDefinition, PolicyValue } from 'vs/platform/policy/common/policy';
|
||||
import product from 'vs/platform/product/common/product';
|
||||
import { IPartsSplash } from 'vs/platform/theme/common/themeService';
|
||||
import { IUserDataProfile } from 'vs/platform/userDataProfile/common/userDataProfile';
|
||||
import { IAnyWorkspaceIdentifier, ISingleFolderWorkspaceIdentifier, IWorkspaceIdentifier } from 'vs/platform/workspace/common/workspace';
|
||||
|
|
@ -240,8 +239,6 @@ export function useWindowControlsOverlay(configurationService: IConfigurationSer
|
|||
if (typeof setting === 'boolean') {
|
||||
return setting;
|
||||
}
|
||||
|
||||
return product.quality !== 'stable'; // disable by default in stable for now (TODO@bpasero TODO@benibenj flip when custom title is default)
|
||||
}
|
||||
|
||||
// Default to true.
|
||||
|
|
|
|||
Loading…
Reference in a new issue