mirror of
https://github.com/godotengine/godot-vscode-plugin.git
synced 2025-12-31 13:48:24 +03:00
Add setting to enable/disable documentation minimap (#786)
This commit is contained in:
@@ -1,7 +1,3 @@
|
||||
body {
|
||||
margin-right: 200px;
|
||||
}
|
||||
|
||||
a {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
@@ -258,6 +258,11 @@
|
||||
"maximum": 200,
|
||||
"description": "Scale factor (%) to apply to the Godot documentation viewer."
|
||||
},
|
||||
"godotTools.documentation.displayMinimap":{
|
||||
"type": "boolean",
|
||||
"default": true,
|
||||
"description": "Whether to display the minimap for the Godot documentation viewer."
|
||||
},
|
||||
"godotTools.editorPath.godot3": {
|
||||
"type": "string",
|
||||
"default": "godot3",
|
||||
|
||||
@@ -114,8 +114,17 @@ export class GDDocumentationProvider implements CustomReadonlyEditorProvider {
|
||||
}
|
||||
|
||||
const scaleFactor = get_configuration("documentation.pageScale");
|
||||
|
||||
panel.webview.html = this.htmlDb.get(className).replaceAll("scaleFactor", scaleFactor);
|
||||
|
||||
const displayMinimap = get_configuration("documentation.displayMinimap");
|
||||
if (displayMinimap) {
|
||||
panel.webview.html = this.htmlDb.get(className).replace("displayMinimap", "initial;");
|
||||
panel.webview.html = this.htmlDb.get(className).replace("bodyMargin", "200px;");
|
||||
} else {
|
||||
panel.webview.html = this.htmlDb.get(className).replace("bodyMargin", "0px;");
|
||||
panel.webview.html = this.htmlDb.get(className).replace("displayMinimap", "none;");
|
||||
}
|
||||
|
||||
panel.iconPath = get_extension_uri("resources/godot_icon.svg");
|
||||
panel.webview.onDidReceiveMessage((msg) => {
|
||||
if (msg.type === "INSPECT_NATIVE_SYMBOL") {
|
||||
|
||||
@@ -78,12 +78,12 @@ export function make_html_content(webview: vscode.Webview, symbol: GodotNativeSy
|
||||
|
||||
<title>${symbol.name}</title>
|
||||
</head>
|
||||
<body style="line-height: scaleFactor%; font-size: scaleFactor%;">
|
||||
<body style="line-height: scaleFactor%; font-size: scaleFactor%; margin-right: bodyMargin">
|
||||
<main>
|
||||
${make_symbol_document(symbol)}
|
||||
</main>
|
||||
|
||||
<canvas id='minimap'></canvas>
|
||||
<canvas id='minimap' style="display: displayMinimap"></canvas>
|
||||
|
||||
<script src="${pagemapJsUri}"></script>
|
||||
<script>
|
||||
|
||||
Reference in New Issue
Block a user