@@ -12,36 +12,24 @@ namespace Terminal.Gui;
12
12
/// <para>
13
13
/// The <see cref="View.Title"/> of <see cref="Adornment.Parent"/> will be drawn based on the value of
14
14
/// <see cref="Thickness.Top"/>:
15
+ /// <example>
16
+ /// // If Thickness.Top is 1:
17
+ /// ┌┤1234├──┐
18
+ /// │ │
19
+ /// └────────┘
20
+ /// // If Thickness.Top is 2:
21
+ /// ┌────┐
22
+ /// ┌┤1234├──┐
23
+ /// │ │
24
+ /// └────────┘
25
+ /// If Thickness.Top is 3:
26
+ /// ┌────┐
27
+ /// ┌┤1234├──┐
28
+ /// │└────┘ │
29
+ /// │ │
30
+ /// └────────┘
31
+ /// </example>
15
32
/// </para>
16
- /// <para>
17
- /// If <c>1</c>:
18
- /// <code>
19
- /// ┌┤1234├──┐
20
- /// │ │
21
- /// └────────┘
22
- /// </code>
23
- /// </para>
24
- /// <para>
25
- /// If <c>2</c>:
26
- /// <code>
27
- /// ┌────┐
28
- /// ┌┤1234├──┐
29
- /// │ │
30
- /// └────────┘
31
- /// </code>
32
- /// </para>
33
- /// <para>
34
- /// If <c>3</c>:
35
- /// <code>
36
- /// ┌────┐
37
- /// ┌┤1234├──┐
38
- /// │└────┘ │
39
- /// │ │
40
- /// └────────┘
41
- /// </code>
42
- /// </para>
43
- /// <para/>
44
- /// <para>See the <see cref="Adornment"/> class.</para>
45
33
/// </remarks>
46
34
public class Border : Adornment
47
35
{
@@ -77,13 +65,14 @@ private void OnThicknessChanged (object? sender, EventArgs e)
77
65
ShowHideDrawIndicator ( ) ;
78
66
}
79
67
}
68
+
80
69
private void ShowHideDrawIndicator ( )
81
70
{
82
71
if ( View . Diagnostics . HasFlag ( ViewDiagnosticFlags . DrawIndicator ) && Thickness != Thickness . Empty )
83
72
{
84
73
if ( DrawIndicator is null )
85
74
{
86
- DrawIndicator = new SpinnerView ( )
75
+ DrawIndicator = new ( )
87
76
{
88
77
Id = "DrawIndicator" ,
89
78
X = 1 ,
@@ -282,7 +271,6 @@ private void Border_Highlight (object? sender, CancelEventArgs<HighlightStyle> e
282
271
ColorScheme = cs ;
283
272
}
284
273
285
-
286
274
if ( e . NewValue == HighlightStyle . None && _savedForeColor . HasValue )
287
275
{
288
276
var cs = new ColorScheme ( ColorScheme )
@@ -304,9 +292,10 @@ protected override bool OnMouseEvent (MouseEventArgs mouseEvent)
304
292
{
305
293
// BUGBUG: See https://github.com/gui-cs/Terminal.Gui/issues/3312
306
294
if ( ! _dragPosition . HasValue && mouseEvent . Flags . HasFlag ( MouseFlags . Button1Pressed )
307
- // HACK: Prevents Window from being draggable if it's Top
308
- //&& Parent is Toplevel { Modal: true }
309
- )
295
+
296
+ // HACK: Prevents Window from being draggable if it's Top
297
+ //&& Parent is Toplevel { Modal: true }
298
+ )
310
299
{
311
300
Parent ! . SetFocus ( ) ;
312
301
@@ -501,8 +490,9 @@ protected override bool OnMouseEvent (MouseEventArgs mouseEvent)
501
490
parentLoc . Y - _startGrabPoint . Y ,
502
491
out int nx ,
503
492
out int ny
504
- //,
505
- // out _
493
+
494
+ //,
495
+ // out _
506
496
) ;
507
497
508
498
Parent . X = parentLoc . X - _startGrabPoint . X ;
@@ -712,7 +702,12 @@ protected override bool OnDrawingContent ()
712
702
}
713
703
}
714
704
715
- if ( Parent is { } && canDrawBorder && Thickness . Top > 0 && maxTitleWidth > 0 && Settings . FastHasFlags ( BorderSettings . Title ) && ! string . IsNullOrEmpty ( Parent ? . Title ) )
705
+ if ( Parent is { }
706
+ && canDrawBorder
707
+ && Thickness . Top > 0
708
+ && maxTitleWidth > 0
709
+ && Settings . FastHasFlags ( BorderSettings . Title )
710
+ && ! string . IsNullOrEmpty ( Parent ? . Title ) )
716
711
{
717
712
Attribute focus = Parent . GetNormalColor ( ) ;
718
713
@@ -723,11 +718,12 @@ protected override bool OnDrawingContent ()
723
718
}
724
719
725
720
Rectangle titleRect = new ( borderBounds . X + 2 , titleY , maxTitleWidth , 1 ) ;
726
- Parent . TitleTextFormatter . Draw ( titleRect
727
- ,
721
+
722
+ Parent . TitleTextFormatter . Draw (
723
+ titleRect ,
728
724
Parent . HasFocus ? focus : GetNormalColor ( ) ,
729
725
Parent . HasFocus ? focus : GetHotNormalColor ( ) ) ;
730
- Parent ? . LineCanvas . Exclude ( new ( titleRect ) ) ;
726
+ Parent ? . LineCanvas . Exclude ( new ( titleRect ) ) ;
731
727
}
732
728
733
729
if ( canDrawBorder && LineStyle != LineStyle . None )
@@ -944,13 +940,15 @@ protected override bool OnDrawingContent ()
944
940
}
945
941
}
946
942
947
- return true ; ;
943
+ return true ;
944
+
945
+ ;
948
946
}
949
947
950
948
/// <summary>
951
949
/// Gets the subview used to render <see cref="ViewDiagnosticFlags.DrawIndicator"/>.
952
950
/// </summary>
953
- public SpinnerView ? DrawIndicator { get ; private set ; } = null ;
951
+ public SpinnerView ? DrawIndicator { get ; private set ; }
954
952
955
953
private void SetupGradientLineCanvas ( LineCanvas lc , Rectangle rect )
956
954
{
@@ -1392,13 +1390,13 @@ private void AddArrangeModeKeyBindings ()
1392
1390
1393
1391
HotKeyBindings . Add ( Key . Esc , Command . Quit ) ;
1394
1392
HotKeyBindings . Add ( Application . ArrangeKey , Command . Quit ) ;
1395
- HotKeyBindings . Add ( Key . CursorUp , Command . Up ) ;
1393
+ HotKeyBindings . Add ( Key . CursorUp , Command . Up ) ;
1396
1394
HotKeyBindings . Add ( Key . CursorDown , Command . Down ) ;
1397
1395
HotKeyBindings . Add ( Key . CursorLeft , Command . Left ) ;
1398
1396
HotKeyBindings . Add ( Key . CursorRight , Command . Right ) ;
1399
1397
1400
1398
HotKeyBindings . Add ( Key . Tab , Command . Tab ) ;
1401
- HotKeyBindings . Add ( Key . Tab . WithShift , Command . BackTab ) ;
1399
+ HotKeyBindings . Add ( Key . Tab . WithShift , Command . BackTab ) ;
1402
1400
}
1403
1401
1404
1402
private void ApplicationOnMouseEvent ( object ? sender , MouseEventArgs e )
0 commit comments