Skip to content

Commit 2136415

Browse files
committed
refactor(WebServer): reuse editor-toolbar style for text file save/download buttons
Replace custom textfile-toolbar with .editor-toolbar layout matching the hot-patch toolbar: secondary button for Download, primary button for Save, separated by a vertical divider.
1 parent 402d2d7 commit 2136415

2 files changed

Lines changed: 11 additions & 42 deletions

File tree

Tools/WebServer/static/css/workbench.css

Lines changed: 2 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -831,45 +831,14 @@ body.resizing-panel .sash {
831831
content: "\ea76";
832832
}
833833

834-
/* Text file editor toolbar */
835-
.textfile-toolbar {
836-
display: flex;
837-
align-items: center;
838-
justify-content: space-between;
839-
padding: 4px 12px;
840-
background: var(--vscode-titlebar-bg);
841-
border-bottom: 1px solid var(--vscode-panel-border);
842-
font-size: 11px;
843-
flex-shrink: 0;
844-
}
845-
834+
/* Text file editor path display */
846835
.textfile-path {
847836
opacity: 0.7;
848837
overflow: hidden;
849838
text-overflow: ellipsis;
850839
white-space: nowrap;
851840
font-family: "Consolas", "Courier New", monospace;
852-
}
853-
854-
.textfile-actions {
855-
display: flex;
856-
gap: 4px;
857-
flex-shrink: 0;
858-
}
859-
860-
.textfile-actions button {
861-
background: none;
862-
border: none;
863-
color: var(--vscode-foreground);
864-
cursor: pointer;
865-
padding: 2px 6px;
866-
border-radius: 3px;
867-
opacity: 0.7;
868-
}
869-
870-
.textfile-actions button:hover {
871-
opacity: 1;
872-
background: var(--vscode-list-hover);
841+
font-size: 11px;
873842
}
874843

875844
.editor-toolbar {

Tools/WebServer/static/js/features/transfer.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1048,16 +1048,16 @@ async function openDeviceTextFile(remotePath, fileName, forceText = false) {
10481048
contentDiv.className = 'tab-content';
10491049
contentDiv.id = `tabContent_${tabId}`;
10501050
contentDiv.innerHTML = `
1051-
<div class="textfile-toolbar">
1051+
<div class="editor-toolbar" style="display: flex;">
10521052
<span class="textfile-path" title="${escapeHtml(remotePath)}">${escapeHtml(remotePath)}</span>
1053-
<div class="textfile-actions">
1054-
<button onclick="saveDeviceTextFile('${tabId}')" title="${escapeHtml(t('transfer.save_to_device', 'Save to device (Ctrl+S)'))}">
1055-
<i class="codicon codicon-save"></i>
1056-
</button>
1057-
<button onclick="downloadTextFileLocal('${tabId}')" title="${escapeHtml(t('transfer.download_to_pc', 'Download to PC'))}">
1058-
<i class="codicon codicon-desktop-download"></i>
1059-
</button>
1060-
</div>
1053+
<div class="spacer"></div>
1054+
<button class="vscode-btn secondary" onclick="downloadTextFileLocal('${tabId}')" title="${escapeHtml(t('transfer.download_to_pc', 'Download to PC'))}">
1055+
<i class="codicon codicon-desktop-download" style="margin-right: 4px"></i> ${escapeHtml(t('transfer.download', 'Download'))}
1056+
</button>
1057+
<div style="width: 1px; height: 16px; background: var(--vscode-panel-border); margin: 0 4px"></div>
1058+
<button class="vscode-btn" onclick="saveDeviceTextFile('${tabId}')" title="${escapeHtml(t('transfer.save_to_device', 'Save to device (Ctrl+S)'))}">
1059+
<i class="codicon codicon-save" style="margin-right: 4px"></i> ${escapeHtml(t('buttons.save', 'Save'))}
1060+
</button>
10611061
</div>
10621062
<div class="editor-main">
10631063
<div id="editor_${tabId}" class="ace-editor-container"></div>

0 commit comments

Comments
 (0)