Fixes merge errors.

This commit is contained in:
BDisp
2023-03-03 18:28:38 +00:00
parent de5b2f5594
commit 29af067e01
4 changed files with 14 additions and 15 deletions

View File

@@ -331,6 +331,7 @@ namespace Terminal.Gui {
private Point effect3DOffset = new Point (1, 1);
private Attribute? effect3DBrush;
private ustring title = ustring.Empty;
private View child;
/// <summary>
/// Specifies the <see cref="Gui.BorderStyle"/> for a view.
@@ -650,7 +651,7 @@ namespace Terminal.Gui {
Child.Clear (borderRect);
}
driver.SetAttribute (savedAttribute);
driver.SetAttribute (new Attribute (BorderBrush, Background));
// Draw margin frame
if (DrawMarginFrame) {
@@ -674,6 +675,7 @@ namespace Terminal.Gui {
driver.DrawWindowFrame (borderRect, 1, 1, 1, 1, BorderStyle != BorderStyle.None, fill: true, this);
}
}
driver.SetAttribute (savedAttribute);
}
private void DrawChildBorder (Rect frame, bool fill = true)
@@ -786,7 +788,7 @@ namespace Terminal.Gui {
}
}
driver.SetAttribute (savedAttribute);
driver.SetAttribute (new Attribute (BorderBrush, Background));
// Draw the MarginFrame
if (DrawMarginFrame) {
@@ -983,7 +985,7 @@ namespace Terminal.Gui {
}
}
driver.SetAttribute (savedAttribute);
driver.SetAttribute (new Attribute (BorderBrush, Background));
// Draw the MarginFrame
if (DrawMarginFrame) {
@@ -1077,7 +1079,7 @@ namespace Terminal.Gui {
driver.DrawWindowTitle (scrRect, Title, 0, 0, 0, 0);
} else {
scrRect = view.ViewToScreen (new Rect (0, 0, view.Frame.Width, view.Frame.Height));
driver.DrawWindowTitle (scrRect, Title,
driver.DrawWindowTitle (scrRect, Parent.Border.Title,
padding.Left, padding.Top, padding.Right, padding.Bottom);
}
}
@@ -1093,9 +1095,9 @@ namespace Terminal.Gui {
{
var driver = Application.Driver;
if (DrawMarginFrame) {
driver.SetAttribute (view.GetNormalColor ());
driver.SetAttribute (new Attribute (BorderBrush, Background));
if (view.HasFocus) {
driver.SetAttribute (view.ColorScheme.HotNormal);
driver.SetAttribute (new Attribute (view.ColorScheme.HotNormal.Foreground, Background));
}
var padding = Parent.Border.GetSumThickness ();
var scrRect = Parent.ViewToScreen (new Rect (0, 0, rect.Width, rect.Height));

View File

@@ -268,12 +268,8 @@ namespace Terminal.Gui {
///<inheritdoc/>
public override void Redraw (Rect bounds)
{
var padding = Border.GetSumThickness ();
var scrRect = ViewToScreen (new Rect (0, 0, Frame.Width, Frame.Height));
if (!NeedDisplay.IsEmpty) {
Driver.SetAttribute (GetNormalColor ());
//Driver.DrawWindowFrame (scrRect, padding + 1, padding + 1, padding + 1, padding + 1, border: true, fill: true);
Clear ();
}
@@ -281,6 +277,7 @@ namespace Terminal.Gui {
contentView.Redraw (!NeedDisplay.IsEmpty ? contentView.Bounds : bounds);
Driver.Clip = savedClip;
ClearLayoutNeeded ();
ClearNeedsDisplay ();
if (!IgnoreBorderPropertyOnRedraw) {

View File

@@ -195,9 +195,9 @@ namespace UICatalog {
// Run UI Catalog UI. When it exits, if _selectedScenario is != null then
// a Scenario was selected. Otherwise, the user wants to exit UI Catalog.
Application.Init ();
//Application.EnableConsoleScrolling = _enableConsoleScrolling;
Application.EnableConsoleScrolling = _enableConsoleScrolling;
Application.Run<UICatalogTopLevel> ();
Application.Shutdown ();

View File

@@ -230,7 +230,7 @@ namespace Terminal.Gui.CoreTests {
var rune = (Rune)driver.Contents [r, c, 0];
if (r == frame.Y - drawMarginFrame || r == frame.Bottom + drawMarginFrame - 1
|| c == frame.X - drawMarginFrame || c == frame.Right + drawMarginFrame - 1) {
Assert.Equal (Color.Black, color.Background); // because of #2345 - Border: can't change border color in window by Border.BorderBrush.
Assert.Equal (Color.BrightGreen, color.Background);
} else {
Assert.Equal (Color.Black, color.Background);
}
@@ -464,7 +464,7 @@ namespace Terminal.Gui.CoreTests {
var rune = (Rune)driver.Contents [r, c, 0];
if (r == frame.Y + sumThickness.Top || r == frame.Bottom - sumThickness.Bottom - 1
|| c == frame.X + sumThickness.Left || c == frame.Right - sumThickness.Right - 1) {
Assert.Equal (Color.Black, color.Background); // because of #2345 - Border: can't change border color in window by Border.BorderBrush.
Assert.Equal (Color.BrightGreen, color.Background);
} else {
Assert.Equal (Color.Black, color.Background);
}