mirror of
https://github.com/l0ng-ai/openidea.git
synced 2026-11-24 16:04:21 +00:00
feat(project-view): option to turn off horizontal scrolling (#4478)
The Project view's options menu gets Horizontal Scrolling under Appearance (on by default, as before). Turned off, long rows are clipped with an ellipsis instead of the whole tree scrolling sideways and cutting names on the left.
This commit is contained in:
@@ -44,6 +44,7 @@ export const OPTION_LABELS: Array<[ToggleOption, string]> = [
|
||||
["showExcluded", "Show Excluded Files"],
|
||||
["showMembers", "Show Members"],
|
||||
["showRootPaths", "Show Root Paths"],
|
||||
["horizontalScroll", "Horizontal Scrolling"],
|
||||
["compact", "Compact Middle Packages"],
|
||||
["foldersFirst", "Sort Folders First"],
|
||||
["autoscrollFromSource", "Always Select Opened File"],
|
||||
@@ -54,7 +55,7 @@ export const OPTION_LABELS: Array<[ToggleOption, string]> = [
|
||||
];
|
||||
|
||||
/** The first entries of OPTION_LABELS are Appearance options, the rest Behavior. */
|
||||
const APPEARANCE_OPTIONS = 6;
|
||||
const APPEARANCE_OPTIONS = 7;
|
||||
|
||||
/** Header controls of the Project tool window (IDEA: Locate, Expand/Collapse All). */
|
||||
export function ProjectHeaderActions() {
|
||||
|
||||
@@ -907,7 +907,7 @@ export function ProjectView() {
|
||||
</div>
|
||||
)}
|
||||
<Tree<ProjectNode>
|
||||
horizontalScroll
|
||||
horizontalScroll={options.horizontalScroll}
|
||||
aria-label="Project"
|
||||
focusContext="projectViewFocus"
|
||||
handleRef={setTreeHandle}
|
||||
|
||||
@@ -63,6 +63,8 @@ export interface ViewOptions extends TreeOptions {
|
||||
showMembers: boolean;
|
||||
/** Show the location of each project root beside its name. */
|
||||
showRootPaths: boolean;
|
||||
/** Rows wider than the pane scroll sideways; off clips long names (VS Code's horizontal scrolling). */
|
||||
horizontalScroll: boolean;
|
||||
}
|
||||
|
||||
export const DEFAULT_VIEW_OPTIONS: ViewOptions = {
|
||||
@@ -75,6 +77,7 @@ export const DEFAULT_VIEW_OPTIONS: ViewOptions = {
|
||||
previewTab: false,
|
||||
showMembers: false,
|
||||
showRootPaths: true,
|
||||
horizontalScroll: true,
|
||||
};
|
||||
|
||||
function storedOptions(): ViewOptions {
|
||||
|
||||
@@ -2634,5 +2634,6 @@
|
||||
"No branches were updated": "No branches were updated",
|
||||
"Selected branches are up-to-date": "Selected branches are up-to-date",
|
||||
"Use application title as tab name": "Use application title as tab name",
|
||||
"When command is running": "When command is running"
|
||||
"When command is running": "When command is running",
|
||||
"Horizontal Scrolling": "Horizontal Scrolling"
|
||||
}
|
||||
|
||||
@@ -9013,5 +9013,6 @@
|
||||
"No branches were updated": "没有分支被更新",
|
||||
"Selected branches are up-to-date": "所选分支都是最新的",
|
||||
"Use application title as tab name": "使用应用标题作为标签页名称",
|
||||
"When command is running": "命令运行时"
|
||||
"When command is running": "命令运行时",
|
||||
"Horizontal Scrolling": "横向滚动"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user