Skip to content

GlazeWM is a tiling window manager for macOS and Windows inspired by i3wm.

feat(domain): remove `CommonBarAttributes`; set default value to `null` for fallback properties

Lars Berger52195cca532d
diff --git a/GlazeWM.Domain/UserConfigs/BarComponentConfig.cs b/GlazeWM.Domain/UserConfigs/BarComponentConfig.cs
index 53dbf61c..5fb798c4 100644
--- a/GlazeWM.Domain/UserConfigs/BarComponentConfig.cs
+++ b/GlazeWM.Domain/UserConfigs/BarComponentConfig.cs
@@ -2,11 +2,45 @@ using System.ComponentModel.DataAnnotations;
namespace GlazeWM.Domain.UserConfigs
{
- public class BarComponentConfig : CommonBarAttributes
+ public class BarComponentConfig
{
[Required]
public string Type { get; set; }
public string Margin { get; set; } = "0 10 0 0";
+
+ /// <summary>
+ /// Fallback to bar background config if unset.
+ /// </summary>
+ public string Background { get; set; } = null;
+
+ /// <summary>
+ /// Fallback to bar foreground config if unset.
+ /// </summary>
+ public string Foreground { get; set; } = null;
+
+ /// <summary>
+ /// Fallback to bar font family config if unset.
+ /// </summary>
+ public string FontFamily { get; set; } = null;
+
+ /// <summary>
+ /// Fallback to bar font size config if unset.
+ /// </summary>
+ public string FontSize { get; set; } = null;
+
+ public string BorderColor { get; set; } = "blue";
+
+ /// <summary>
+ /// Width of the border in pixels. To set a different border width for each side, specify four
+ /// values (eg. "5 0 5 0"). The borders widths apply to the top, right, bottom, and left in that
+ /// order.
+ /// </summary>
+ public string BorderWidth { get; set; } = "0";
+
+ /// <summary>
+ /// Padding in pixels.
+ /// </summary>
+ public string Padding { get; set; } = "0";
}
}
diff --git a/GlazeWM.Domain/UserConfigs/BarConfig.cs b/GlazeWM.Domain/UserConfigs/BarConfig.cs
index b7a850d1..0c1ba675 100644
--- a/GlazeWM.Domain/UserConfigs/BarConfig.cs
+++ b/GlazeWM.Domain/UserConfigs/BarConfig.cs
@@ -3,12 +3,34 @@ using Newtonsoft.Json;
namespace GlazeWM.Domain.UserConfigs
{
- public class BarConfig : CommonBarAttributes
+ public class BarConfig
{
public uint Height { get; set; } = 25;
public double Opacity { get; set; } = 0.9;
+ public string Background { get; set; } = "#101010";
+
+ public string Foreground { get; set; } = "white";
+
+ public string FontFamily { get; set; } = "Segoe UI";
+
+ public string FontSize { get; set; } = "12";
+
+ public string BorderColor { get; set; } = "blue";
+
+ /// <summary>
+ /// Width of the border in pixels. To set a different border width for each side, specify four
+ /// values (eg. "5 0 5 0"). The borders widths apply to the top, right, bottom, and left in that
+ /// order.
+ /// </summary>
+ public string BorderWidth { get; set; } = "0";
+
+ /// <summary>
+ /// Padding in pixels.
+ /// </summary>
+ public string Padding { get; set; } = "1 6 1 6";
+
[JsonProperty(ItemConverterType = typeof(BarComponentConfigConverter))]
public List<BarComponentConfig> ComponentsLeft { get; set; } = new List<BarComponentConfig>();
diff --git a/GlazeWM.Domain/UserConfigs/CommonBarAttributes.cs b/GlazeWM.Domain/UserConfigs/CommonBarAttributes.cs
deleted file mode 100644
index faf23923..00000000
--- a/GlazeWM.Domain/UserConfigs/CommonBarAttributes.cs
+++ /dev/null
@@ -1,23 +0,0 @@
-namespace GlazeWM.Domain.UserConfigs
-{
- // TODO: Consider renaming to `SharedBarStyles`/`BarComponentConfig`.
- public class CommonBarAttributes
- {
- public string Background { get; set; } = "#101010";
- public string FontFamily { get; set; } = "Segoe UI";
- public string FontSize { get; set; } = "12";
- public string BorderColor { get; set; } = "#8192B3";
-
- /// <summary>
- /// Width of the border in pixels. To set a different border width for each side, specify four
- /// values (eg. "5 0 5 0"). The borders widths apply to the top, right, bottom, and left in that
- /// order.
- /// </summary>
- public string BorderWidth { get; set; } = "0 0 0 0";
-
- /// <summary>
- /// Padding in pixels.
- /// </summary>
- public string Padding { get; set; } = "1 6 1 6";
- }
-}
diff --git a/GlazeWM.Domain/UserConfigs/WorkspacesComponentConfig.cs b/GlazeWM.Domain/UserConfigs/WorkspacesComponentConfig.cs
index 4838ca3a..cd04ab95 100644
--- a/GlazeWM.Domain/UserConfigs/WorkspacesComponentConfig.cs
+++ b/GlazeWM.Domain/UserConfigs/WorkspacesComponentConfig.cs
@@ -5,16 +5,32 @@ namespace GlazeWM.Domain.UserConfigs
public string FocusedWorkspaceBorderWidth { get; set; } = "0";
public string FocusedWorkspaceBorderColor { get; set; } = "blue";
public string FocusedWorkspaceBackground { get; set; } = "#8192B3";
- public string FocusedWorkspaceForeground { get; set; } = "white";
+
+ /// <summary>
+ /// Fallback to component foreground config if unset.
+ /// </summary>
+ public string FocusedWorkspaceForeground { get; set; } = null;
public string DisplayedWorkspaceBorderWidth { get; set; } = "0";
public string DisplayedWorkspaceBorderColor { get; set; } = "blue";
public string DisplayedWorkspaceBackground { get; set; } = "#42403e";
- public string DisplayedWorkspaceForeground { get; set; } = "white";
+
+ /// <summary>
+ /// Fallback to component foreground config if unset.
+ /// </summary>
+ public string DisplayedWorkspaceForeground { get; set; } = null;
public string DefaultWorkspaceBorderWidth { get; set; } = "0";
public string DefaultWorkspaceBorderColor { get; set; } = "blue";
- public string DefaultWorkspaceBackground { get; set; } = "transparent";
- public string DefaultWorkspaceForeground { get; set; } = "white";
+
+ /// <summary>
+ /// Fallback to component background config if unset.
+ /// </summary>
+ public string DefaultWorkspaceBackground { get; set; } = null;
+
+ /// <summary>
+ /// Fallback to component foreground config if unset.
+ /// </summary>
+ public string DefaultWorkspaceForeground { get; set; } = null;
}
}