mirror of
https://github.com/l0ng-ai/openidea.git
synced 2026-11-23 16:03:06 +00:00
fix(window): lay out project window tabs evenly with centred titles (#3285)
Project tabs of a merged window group now share the row equally with the project name centred; the close button sits on the left and shows on hover or keyboard focus, and the selected tab is marked by its background instead of an accent underline. The folder icon is gone. Reordering, the context menu and keyboard navigation are unchanged. Closes #3266
This commit is contained in:
@@ -13,14 +13,25 @@
|
||||
overflow-x: auto;
|
||||
min-width: 0;
|
||||
}
|
||||
/* Tabs share the row equally with the title centred, the close button on the left on hover. */
|
||||
.item {
|
||||
position: relative;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex: 0 1 220px;
|
||||
min-width: 100px;
|
||||
flex: 1 1 0;
|
||||
min-width: 120px;
|
||||
border-radius: var(--radius-small);
|
||||
color: var(--fg-muted);
|
||||
}
|
||||
.close {
|
||||
position: absolute;
|
||||
left: 4px;
|
||||
opacity: 0;
|
||||
}
|
||||
.item:hover .close,
|
||||
.item:focus-within .close {
|
||||
opacity: 1;
|
||||
}
|
||||
.item:hover {
|
||||
background: var(--bg-hover);
|
||||
}
|
||||
@@ -31,19 +42,19 @@
|
||||
.dragging {
|
||||
opacity: 0.55;
|
||||
}
|
||||
.selected {
|
||||
.selected,
|
||||
.selected:hover {
|
||||
background: var(--bg-island);
|
||||
color: var(--fg);
|
||||
box-shadow: inset 0 -2px var(--accent);
|
||||
}
|
||||
.tab {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
justify-content: center;
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
height: 30px;
|
||||
padding: 0 10px;
|
||||
padding: 0 28px;
|
||||
border: 0;
|
||||
color: inherit;
|
||||
background: transparent;
|
||||
|
||||
@@ -2,7 +2,7 @@ import { useRef, useState } from "react";
|
||||
import { executeAction } from "@/platform/actions";
|
||||
import { useTx } from "@/platform/i18n";
|
||||
import { reorderedTabs, useWindowGroup } from "@/platform/windowGroups";
|
||||
import { Icon, IconButton, showContextMenu } from "@/ui";
|
||||
import { IconButton, showContextMenu } from "@/ui";
|
||||
import { notifications } from "./contributions";
|
||||
import styles from "./WindowGroupTabs.module.css";
|
||||
|
||||
@@ -105,10 +105,10 @@ export function WindowGroupTabs() {
|
||||
run(executeAction("window.selectTab", tabs[next]!.label));
|
||||
}}
|
||||
>
|
||||
<Icon name="folder" size={14} />
|
||||
<span>{tab.name}</span>
|
||||
</button>
|
||||
<IconButton
|
||||
className={styles.close}
|
||||
icon="close"
|
||||
size="small"
|
||||
title={tx`Close ${tab.name}`}
|
||||
|
||||
Reference in New Issue
Block a user