Skip to content

Commit

Permalink
Merge pull request #870 from WildernessLabs/microlayout-is-visible
Browse files Browse the repository at this point in the history
Rename Visible to IsVisible
  • Loading branch information
ctacke authored Dec 26, 2023
2 parents 7dff4a3 + bad6922 commit 0e54d96
Show file tree
Hide file tree
Showing 9 changed files with 20 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,4 @@ public static LineChartSeries ToLineChartSeries(this double[,] xyData)

return series;
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,12 @@ public class LineChart : ThemedControl
/// The default color for axis lines
/// </summary>
public static Color DefaultAxisColor = Color.Gray;

/// <summary>
/// The default color for axis labels
/// </summary>
public static Color DefaultAxisLabelColor = Color.White;

/// <summary>
/// The default chart background color
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public bool Pressed
get => _pressed;
set
{
if (!Visible) return;
if (!IsVisible) return;

if (_pressed == value) return;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public class Box : ThemedControl
/// <summary>
/// Gets or sets a value indicating whether the display box is filled with the foreground color.
/// </summary>
public bool Filled { get; set; } = true;
public bool IsFilled { get; set; } = true;

/// <summary>
/// Initializes a new instance of the <see cref="Box"/> class with the specified dimensions.
Expand Down Expand Up @@ -53,7 +53,7 @@ protected override void OnDraw(MicroGraphics graphics)
{
if (ForeColor != Color.Transparent)
{
graphics.DrawRectangle(Left + (Parent?.Left ?? 0), Top + (Parent?.Top ?? 0), Width, Height, ForeColor, Filled);
graphics.DrawRectangle(Left + (Parent?.Left ?? 0), Top + (Parent?.Top ?? 0), Width, Height, ForeColor, IsFilled);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public abstract class Control : IControl
private int _top;
private int _width;
private int _height;
private bool _visible = true;
private bool _isVisible = true;

/// <summary>
/// Gets or sets a value indicating whether the control needs to be redrawn.
Expand Down Expand Up @@ -70,10 +70,10 @@ public virtual void Invalidate()
/// <summary>
/// Gets or sets a value indicating whether the control is visible.
/// </summary>
public virtual bool Visible
public virtual bool IsVisible
{
get => _visible;
set => SetInvalidatingProperty(ref _visible, value);
get => _isVisible;
set => SetInvalidatingProperty(ref _isVisible, value);
}

/// <summary>
Expand Down Expand Up @@ -130,7 +130,7 @@ public void Refresh(MicroGraphics graphics)
{
if (IsInvalid)
{
if (Visible)
if (IsVisible)
{
OnDraw(graphics);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public interface IControl
/// <summary>
/// Gets or sets whether the control is visible.
/// </summary>
bool Visible { get; set; }
bool IsVisible { get; set; }

/// <summary>
/// Gets or sets the width of the display control.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public AbsoluteLayout(DisplayScreen screen, int left, int top, int width, int he
/// <inheritdoc/>
protected override void OnDraw(MicroGraphics graphics)
{
if (Visible && BackgroundColor != null)
if (IsVisible && BackgroundColor != null)
{
graphics.DrawRectangle(
Left + (Parent?.Left ?? 0),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,16 +48,16 @@ public override void ApplyTheme(DisplayTheme theme)
}

/// <inheritdoc/>
public override bool Visible
public override bool IsVisible
{
get => base.Visible;
get => base.IsVisible;
set
{
foreach (var control in Controls)
{
control.Visible = value;
control.IsVisible = value;
}
base.Visible = value;
base.IsVisible = value;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,13 @@ public override Task Run()

_screen.Controls.Add(splashLayout, chartLayout);

chartLayout.Visible = false;
chartLayout.IsVisible = false;

Task.Run(async () =>
{
await Task.Delay(5000);
splashLayout.Visible = false;
chartLayout.Visible = true;
splashLayout.IsVisible = false;
chartLayout.IsVisible = true;
});
Application.Run(display);

Expand Down

0 comments on commit 0e54d96

Please sign in to comment.