@@ -12,6 +12,7 @@ import { Button, Input, InputNumber, Popover, Tooltip } from "antd";
12
12
import { List } from "immutable" ;
13
13
import { useMemo , useRef } from "react" ;
14
14
import { useIntl } from "react-intl" ;
15
+
15
16
import { ButtonGroup } from "@cocalc/frontend/antd-bootstrap" ;
16
17
import {
17
18
CSS ,
@@ -110,6 +111,7 @@ const title_bar_style: CSS = {
110
111
display : "flex" ,
111
112
} as const ;
112
113
114
+ // This is characters
113
115
const MAX_TITLE_WIDTH = 20 ;
114
116
const MAX_TITLE_WIDTH_INACTIVE = 40 ;
115
117
@@ -118,7 +120,7 @@ const TITLE_STYLE: CSS = {
118
120
fontSize : "11pt" ,
119
121
whiteSpace : "nowrap" ,
120
122
display : "inline-block" ,
121
- maxWidth : ` ${ MAX_TITLE_WIDTH + 2 } ex` ,
123
+ maxWidth : "100%" ,
122
124
overflow : "hidden" ,
123
125
fontWeight : 500 ,
124
126
} as const ;
@@ -706,8 +708,8 @@ export function FrameTitleBar(props: FrameTitleBarProps) {
706
708
label === APPLICATION_MENU
707
709
? manageCommands . applicationMenuTitle ( )
708
710
: isIntlMessage ( label )
709
- ? intl . formatMessage ( label )
710
- : label
711
+ ? intl . formatMessage ( label )
712
+ : label
711
713
}
712
714
items = { v }
713
715
/>
@@ -968,13 +970,10 @@ export function FrameTitleBar(props: FrameTitleBarProps) {
968
970
}
969
971
}
970
972
}
971
- const label = (
972
- < span >
973
- { trunc_middle (
974
- title ,
975
- is_active ? MAX_TITLE_WIDTH : MAX_TITLE_WIDTH_INACTIVE ,
976
- ) }
977
- </ span >
973
+
974
+ const label = trunc_middle (
975
+ title ,
976
+ is_active ? MAX_TITLE_WIDTH : MAX_TITLE_WIDTH_INACTIVE ,
978
977
) ;
979
978
980
979
if ( props . title == null && is_active ) {
@@ -993,6 +992,7 @@ export function FrameTitleBar(props: FrameTitleBarProps) {
993
992
{ label }
994
993
</ div >
995
994
) ;
995
+
996
996
if ( title . length >= MAX_TITLE_WIDTH ) {
997
997
return (
998
998
< Tooltip title = { title } key = "title" >
0 commit comments