mirror of
https://github.com/gui-cs/Terminal.Gui.git
synced 2025-12-29 09:18:01 +01:00
More Prototype scrollbuttons in Padding for CharMap
This commit is contained in:
@@ -524,12 +524,12 @@ public partial class View
|
||||
_needsDisplayRect = new (x, y, w, h);
|
||||
}
|
||||
|
||||
SuperView?.SetSubViewNeedsDisplay ();
|
||||
|
||||
Margin?.SetNeedsDisplay ();
|
||||
Border?.SetNeedsDisplay ();
|
||||
Padding?.SetNeedsDisplay ();
|
||||
|
||||
SuperView?.SetSubViewNeedsDisplay ();
|
||||
|
||||
foreach (View subview in Subviews)
|
||||
{
|
||||
if (subview.Frame.IntersectsWith (region))
|
||||
@@ -550,6 +550,13 @@ public partial class View
|
||||
if (SuperView is { SubViewNeedsDisplay: false })
|
||||
{
|
||||
SuperView.SetSubViewNeedsDisplay ();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (this is Adornment adornment)
|
||||
{
|
||||
adornment.Parent?.SetSubViewNeedsDisplay ();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -62,7 +62,8 @@ public class Button : View
|
||||
//MouseClick += Button_MouseClick;
|
||||
}
|
||||
|
||||
private Attribute _originalNormal;
|
||||
[CanBeNull]
|
||||
private ColorScheme _savedColorScheme;
|
||||
|
||||
private void Button_MouseEvent (object sender, MouseEventEventArgs e)
|
||||
{
|
||||
@@ -71,31 +72,29 @@ public class Button : View
|
||||
if (Application.MouseGrabView == this)
|
||||
{
|
||||
e.Handled = InvokeCommand (Command.HotKey) == true;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
SetFocus();
|
||||
Application.GrabMouse(this);
|
||||
|
||||
_originalNormal = ColorScheme.Normal;
|
||||
var cs = new ColorScheme (ColorScheme)
|
||||
{
|
||||
Normal = ColorScheme.HotFocus
|
||||
};
|
||||
_savedColorScheme = ColorScheme;
|
||||
var cs = new ColorScheme (new Attribute (ColorScheme.Normal.Background, ColorScheme.Normal.Foreground));
|
||||
ColorScheme = cs;
|
||||
}
|
||||
|
||||
if (e.MouseEvent.Flags == MouseFlags.Button1Released)
|
||||
if (e.MouseEvent.Flags.HasFlag(MouseFlags.Button1Released))
|
||||
{
|
||||
Application.UngrabMouse ();
|
||||
var cs = new ColorScheme (ColorScheme)
|
||||
{
|
||||
Normal = _originalNormal
|
||||
};
|
||||
ColorScheme = cs;
|
||||
|
||||
e.Handled = InvokeCommand (Command.HotKey) == true;
|
||||
|
||||
return;
|
||||
if (_savedColorScheme is { })
|
||||
{
|
||||
ColorScheme = _savedColorScheme;
|
||||
}
|
||||
|
||||
_savedColorScheme = null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -301,7 +301,7 @@ public class Buttons : Scenario
|
||||
Width = 1,
|
||||
NoPadding = true,
|
||||
NoDecorations = true,
|
||||
Title = CM.Glyphs.UpArrow.ToString(),
|
||||
Title = $"{CM.Glyphs.UpArrow}",
|
||||
};
|
||||
Win.Add (label, oneByOne);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user