@@ -12,7 +12,6 @@ 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
-
16
15
import { ButtonGroup } from "@cocalc/frontend/antd-bootstrap" ;
17
16
import {
18
17
CSS ,
@@ -325,19 +324,18 @@ export function FrameTitleBar(props: FrameTitleBarProps) {
325
324
326
325
function render_x ( ) : Rendered {
327
326
return (
328
- < Button
327
+ < Tooltip
329
328
title = { intl . formatMessage ( {
330
329
id : "frame_editors.frame_tree.title_bar.close" ,
331
- defaultMessage : "Close this frame" ,
330
+ defaultMessage :
331
+ "Close this frame. To restore the default layout, close all frames." ,
332
332
description : "Click this X button to close the frame" ,
333
333
} ) }
334
- key = { "close" }
335
- size = "small"
336
- type = "text"
337
- onClick = { click_close }
338
334
>
339
- < Icon name = { "times" } />
340
- </ Button >
335
+ < Button key = { "close" } size = "small" type = "text" onClick = { click_close } >
336
+ < Icon name = { "times" } />
337
+ </ Button >
338
+ </ Tooltip >
341
339
) ;
342
340
}
343
341
@@ -374,94 +372,104 @@ export function FrameTitleBar(props: FrameTitleBarProps) {
374
372
function render_full ( ) : Rendered {
375
373
if ( props . is_full ) {
376
374
return (
377
- < Button
378
- disabled = { props . is_only }
375
+ < Tooltip
379
376
title = { intl . formatMessage ( {
380
377
id : "frame_editors.frame_tree.title_bar.minimize" ,
381
378
defaultMessage : "Show all frames" ,
382
379
description : "Minimize this frame to show all frames" ,
383
380
} ) }
384
- key = { "full-screen-button" }
385
- size = "small"
386
- type = "text"
387
- onClick = { ( ) => {
388
- track ( "unset-full" ) ;
389
- props . actions . unset_frame_full ( ) ;
390
- } }
391
- style = { {
392
- color : darkMode ? "orange" : undefined ,
393
- background : ! darkMode ? "orange" : undefined ,
394
- } }
395
381
>
396
- < Icon name = { "compress" } />
397
- </ Button >
382
+ < Button
383
+ disabled = { props . is_only }
384
+ key = { "full-screen-button" }
385
+ size = "small"
386
+ type = "text"
387
+ onClick = { ( ) => {
388
+ track ( "unset-full" ) ;
389
+ props . actions . unset_frame_full ( ) ;
390
+ } }
391
+ style = { {
392
+ color : darkMode ? "orange" : undefined ,
393
+ background : ! darkMode ? "orange" : undefined ,
394
+ } }
395
+ >
396
+ < Icon name = { "compress" } />
397
+ </ Button >
398
+ </ Tooltip >
398
399
) ;
399
400
} else {
400
401
return (
401
- < Button
402
- disabled = { props . is_only }
403
- key = { "full-screen-button" }
402
+ < Tooltip
404
403
title = { intl . formatMessage ( {
405
404
id : "frame_editors.frame_tree.title_bar.maximize" ,
406
405
defaultMessage : "Show only this frame" ,
407
406
description : "Maximize this frame to show only this one" ,
408
407
} ) }
409
- size = "small"
410
- type = "text"
411
- onClick = { ( ) => {
412
- track ( "set-full" ) ;
413
- props . actions . set_frame_full ( props . id ) ;
414
- } }
415
408
>
416
- < Icon name = { "expand" } />
417
- </ Button >
409
+ < Button
410
+ disabled = { props . is_only }
411
+ key = { "full-screen-button" }
412
+ size = "small"
413
+ type = "text"
414
+ onClick = { ( ) => {
415
+ track ( "set-full" ) ;
416
+ props . actions . set_frame_full ( props . id ) ;
417
+ } }
418
+ >
419
+ < Icon name = { "expand" } />
420
+ </ Button >
421
+ </ Tooltip >
418
422
) ;
419
423
}
420
424
}
421
425
422
426
function render_split_row ( ) : Rendered {
423
427
return (
424
- < Button
425
- key = { "split-row-button" }
428
+ < Tooltip
426
429
title = { intl . formatMessage ( labels . split_frame_horizontally_title ) }
427
- size = "small"
428
- type = "text"
429
- onClick = { ( e ) => {
430
- e . stopPropagation ( ) ;
431
- if ( props . is_full ) {
432
- track ( "unset-full" ) ;
433
- return props . actions . unset_frame_full ( ) ;
434
- } else {
435
- track ( "split-row" ) ;
436
- return props . actions . split_frame ( "row" , props . id ) ;
437
- }
438
- } }
439
430
>
440
- < Icon name = "horizontal-split" />
441
- </ Button >
431
+ < Button
432
+ key = { "split-row-button" }
433
+ size = "small"
434
+ type = "text"
435
+ onClick = { ( e ) => {
436
+ e . stopPropagation ( ) ;
437
+ if ( props . is_full ) {
438
+ track ( "unset-full" ) ;
439
+ return props . actions . unset_frame_full ( ) ;
440
+ } else {
441
+ track ( "split-row" ) ;
442
+ return props . actions . split_frame ( "row" , props . id ) ;
443
+ }
444
+ } }
445
+ >
446
+ < Icon name = "horizontal-split" />
447
+ </ Button >
448
+ </ Tooltip >
442
449
) ;
443
450
}
444
451
445
452
function render_split_col ( ) : Rendered {
446
453
return (
447
- < Button
448
- key = { "split-col-button" }
449
- title = { intl . formatMessage ( labels . split_frame_vertically_title ) }
450
- size = "small"
451
- type = "text"
452
- onClick = { ( e ) => {
453
- e . stopPropagation ( ) ;
454
- if ( props . is_full ) {
455
- track ( "unset-full" ) ;
456
- return props . actions . unset_frame_full ( ) ;
457
- } else {
458
- track ( "split-col" ) ;
459
- return props . actions . split_frame ( "col" , props . id ) ;
460
- }
461
- } }
462
- >
463
- < Icon name = "vertical-split" />
464
- </ Button >
454
+ < Tooltip title = { intl . formatMessage ( labels . split_frame_vertically_title ) } >
455
+ < Button
456
+ key = { "split-col-button" }
457
+ size = "small"
458
+ type = "text"
459
+ onClick = { ( e ) => {
460
+ e . stopPropagation ( ) ;
461
+ if ( props . is_full ) {
462
+ track ( "unset-full" ) ;
463
+ return props . actions . unset_frame_full ( ) ;
464
+ } else {
465
+ track ( "split-col" ) ;
466
+ return props . actions . split_frame ( "col" , props . id ) ;
467
+ }
468
+ } }
469
+ >
470
+ < Icon name = "vertical-split" />
471
+ </ Button >
472
+ </ Tooltip >
465
473
) ;
466
474
}
467
475
@@ -698,8 +706,8 @@ export function FrameTitleBar(props: FrameTitleBarProps) {
698
706
label === APPLICATION_MENU
699
707
? manageCommands . applicationMenuTitle ( )
700
708
: isIntlMessage ( label )
701
- ? intl . formatMessage ( label )
702
- : label
709
+ ? intl . formatMessage ( label )
710
+ : label
703
711
}
704
712
items = { v }
705
713
/>
0 commit comments