Skip to content

Commit

Permalink
Convert a bunch more properties to fields
Browse files Browse the repository at this point in the history
  • Loading branch information
FenPhoenix committed Jun 20, 2022
1 parent f69730b commit 6fa266b
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 47 deletions.
16 changes: 4 additions & 12 deletions AngelLoader/Forms/CustomControls/DarkButton.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,7 @@ private enum DarkButtonStyle
/// If this control represents a game in some way, you can set its <see cref="GameSupport.GameIndex"/> here.
/// </summary>
[PublicAPI]
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public GameSupport.GameIndex GameIndex { get; set; } = GameSupport.GameIndex.Thief1;
public GameSupport.GameIndex GameIndex = GameSupport.GameIndex.Thief1;

#if DEBUG

Expand All @@ -65,19 +63,13 @@ private enum DarkButtonStyle
#endif

[PublicAPI]
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public Color? DarkModeBackColor { get; set; }
public Color? DarkModeBackColor;

[PublicAPI]
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public Color? DarkModeHoverColor { get; set; }
public Color? DarkModeHoverColor;

[PublicAPI]
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public Color? DarkModePressedColor { get; set; }
public Color? DarkModePressedColor;

[PublicAPI]
public new string Text
Expand Down
8 changes: 2 additions & 6 deletions AngelLoader/Forms/CustomControls/DarkCheckBox.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,10 @@ public sealed class DarkCheckBox : CheckBox, IDarkable
#endregion

[PublicAPI]
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public Color? DarkModeBackColor { get; set; }
public Color? DarkModeBackColor;

[PublicAPI]
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public Color? DarkModeForeColor { get; set; }
public Color? DarkModeForeColor;

#if DEBUG

Expand Down
16 changes: 4 additions & 12 deletions AngelLoader/Forms/CustomControls/DarkCheckList.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,24 +70,16 @@ public DarkCheckListEventArgs(int index, bool @checked, string text)
public CheckItem[] CheckItems = Array.Empty<CheckItem>();

[PublicAPI]
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public new Color BackColor { get; set; } = SystemColors.Window;
public new Color BackColor = SystemColors.Window;

[PublicAPI]
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public new Color ForeColor { get; set; } = SystemColors.ControlText;
public new Color ForeColor = SystemColors.ControlText;

[PublicAPI]
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public Color DarkModeBackColor { get; set; } = DarkColors.Fen_ControlBackground;
public Color DarkModeBackColor = DarkColors.Fen_ControlBackground;

[PublicAPI]
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public Color DarkModeForeColor { get; set; } = DarkColors.LightText;
public Color DarkModeForeColor = DarkColors.LightText;

private bool _darkModeEnabled;
[PublicAPI]
Expand Down
8 changes: 2 additions & 6 deletions AngelLoader/Forms/CustomControls/DarkLabel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,10 @@ public sealed class DarkLabel : Label, IDarkable
public bool DarkModeEnabled { get; set; }

[PublicAPI]
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public Color? DarkModeForeColor { get; set; }
public Color? DarkModeForeColor;

[PublicAPI]
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public Color? DarkModeBackColor { get; set; }
public Color? DarkModeBackColor;

protected override void OnPaint(PaintEventArgs e)
{
Expand Down
4 changes: 2 additions & 2 deletions AngelLoader/Forms/CustomControls/DarkSplitContainerCustom.cs
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ public bool DarkModeEnabled
internal bool FullScreen { get; private set; }
internal int CollapsedSize = 0;

internal Color Panel1DarkBackColor { get; set; } = DarkColors.Fen_ControlBackground;
internal Color Panel2DarkBackColor { get; set; } = DarkColors.Fen_ControlBackground;
internal Color Panel1DarkBackColor = DarkColors.Fen_ControlBackground;
internal Color Panel2DarkBackColor = DarkColors.Fen_ControlBackground;

#endregion

Expand Down
9 changes: 3 additions & 6 deletions AngelLoader/Forms/CustomControls/DrawnPanel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,10 @@ namespace AngelLoader.Forms.CustomControls
public sealed class DrawnPanel : Panel, IDarkable
{
[PublicAPI]
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public Color DrawnBackColor { get; set; } = SystemColors.Control;

public Color DrawnBackColor = SystemColors.Control;
[PublicAPI]
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public Color DarkModeDrawnBackColor { get; set; } = DarkColors.Fen_ControlBackground;
public Color DarkModeDrawnBackColor = DarkColors.Fen_ControlBackground;

[PublicAPI]
[Browsable(false)]
Expand Down
4 changes: 1 addition & 3 deletions AngelLoader/Forms/CustomControls/ToolStripCustomControls.cs
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,7 @@ public class ToolStripMenuItemCustom : ToolStripMenuItem
/// If this component represents a game in some way, you can set its <see cref="GameSupport.GameIndex"/> here.
/// </summary>
[PublicAPI]
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public GameSupport.GameIndex GameIndex { get; set; } = GameSupport.GameIndex.Thief1;
public GameSupport.GameIndex GameIndex = GameSupport.GameIndex.Thief1;

public ToolStripMenuItemCustom() { }

Expand Down

0 comments on commit 6fa266b

Please sign in to comment.