[英]VSCode: Is there a way to hide top action menu bar?
它被稱為編輯器操作,在標准/本機 VSCode 設置中,您無法隱藏它。
自 2018 年 3 月以來,隱藏此煩人欄的設置是 VScode 的 GitHub 的一個未解決問題。
我感覺到你的痛苦。 這對我有用:
cmd + shift + P
/ ctrl + shift + P
"customizeUI.stylesheet": {
".editor-actions": "display: none !important;",
},
它不見了!
最左邊的圖標是數字1
。
普通 CSS 示例:
.menu-item-action-item-icon-1,
.menu-item-action-item-icon-3 {
display: none !important;
}
使用自定義 UI 擴展的示例:
"customizeUI.stylesheet": {
".menu-item-action-item-icon-1": "display: none !important;",
".menu-item-action-item-icon-3": "display: none !important;",
},
Gitlens 圖標可以隱藏在 Gitlens 的設置中:
"gitlens.menus": {
"editorGroup": {
"blame": false,
"compare": false
},
},
我想出了一個稍微不同的方法:不是隱藏按鈕,而是將它們下移一層到面包屑欄:
這是使用具有以下配置的自定義 UI擴展來完成的:
"customizeUI.stylesheet": {
".tabs-and-actions-container": {
"background-color": "inherit",
},
".tabs-and-actions-container .editor-actions": {
"position": "absolute",
"top": "100%",
"right": "0px",
"height": "22px !important",
"z-index": "1",
"background-color": "inherit",
},
".tabs-and-actions-container .editor-actions .action-item": {
"margin-right": "3px !important",
},
".tabs-and-actions-container .editor-actions .action-item a": {
"font-size": "13px",
},
".tabs-and-actions-container .editor-actions .action-item .codicon": {
"width": "13px",
"height": "13px",
},
".tabs-and-actions-container .tab:last-child": {
"margin-right": "0 !important",
},
".title.tabs.show-file-icons": {
"overflow": "unset !important",
},
}
此解決方案與主題無關,因此它應該適用於所有顏色組合。 按鈕的背景顏色始終與選項卡欄的背景顏色相同。 如果您只使用一個 static 主題,您可以將.tabs-and-actions-container.editor-actions
選擇器的background-color
硬編碼為面包屑欄的確切顏色,以獲得更無縫的設計。 但是,這在切換主題時不起作用。
這個解決方案的唯一缺點是按鈕會溢出最右邊的面包屑信息,但我對此很好。 至少標簽欄不再調整大小,而我仍然有這些按鈕。
嗨,我刪除了 GitLens 插件,它消失了
對於使用自定義 UI 並且在定位".editor-actions"
后沒有讓圖標消失的任何人,我可以通過選擇".monaco-toolbar"
讓操作圖標消失:
"customizeUI.stylesheet": {
".monaco-toolbar": "display: none !important"
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.