File tree Expand file tree Collapse file tree
frontend/src/components/window/workspace Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3636
3737 export let tabMinWidths = false ;
3838 export let tabCloseButtons = false ;
39- export let tabLabels: { name: string ; tooltip? : string }[];
39+ export let tabLabels: { name: string ; unsaved ? : boolean ; tooltip? : string }[];
4040 export let tabActiveIndex: number ;
4141 export let panelType: PanelType | undefined = undefined ;
4242 export let clickAction: ((index : number ) => void ) | undefined = undefined ;
130130 }}
131131 bind:this ={tabElements [tabIndex ]}
132132 >
133- <TextLabel >{tabLabel .name }</TextLabel >
133+ <LayoutRow class =" name" >
134+ <TextLabel class ="text" >{tabLabel .name }</TextLabel >
135+ {#if tabLabel .unsaved }
136+ <TextLabel >*</TextLabel >
137+ {/if }
138+ </LayoutRow >
134139 {#if tabCloseButtons }
135140 <IconButton
136141 action ={(e ) => {
260265 }
261266 }
262267
263- .text-label {
268+ .name {
264269 flex : 1 1 100% ;
265- overflow-x : hidden ;
266- white-space : nowrap ;
267- text-overflow : ellipsis ;
268- // Height and line-height required because https://stackoverflow.com/a/21611191/775283
269- height : 28px ;
270- line-height : 28px ;
270+
271+ .text-label {
272+ // Height and line-height required because https://stackoverflow.com/a/21611191/775283
273+ height : 28px ;
274+ line-height : 28px ;
275+ flex : 0 0 auto ;
276+
277+ & .text {
278+ overflow-x : hidden ;
279+ white-space : nowrap ;
280+ text-overflow : ellipsis ;
281+ flex-shrink : 1 ;
282+ }
283+ }
271284 }
272285
273286 .icon-button {
Original file line number Diff line number Diff line change 3030 $ : documentPanel ?.scrollTabIntoView ($portfolio .activeDocumentIndex );
3131
3232 $ : documentTabLabels = $portfolio .documents .map ((doc : OpenDocument ) => {
33- const name = doc .displayName ;
34-
35- if (! editor .handle .inDevelopmentMode ()) return { name };
33+ const name = doc .details . name ;
34+ const unsaved = ! doc . details . isSaved ;
35+ if (! editor .handle .inDevelopmentMode ()) return { name , unsaved };
3636
3737 const tooltip = ` Document ID: ${doc .id } ` ;
38- return { name , tooltip };
38+ return { name , unsaved , tooltip };
3939 });
4040
4141 const editor = getContext <Editor >(" editor" );
You can’t perform that action at this time.
0 commit comments