Skip to content

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

feat(bar,domain): add ability to set the font weight (#83)

Albert Gouws622a7f9b4684
diff --git a/GlazeWM.Bar/BarViewModel.cs b/GlazeWM.Bar/BarViewModel.cs
index 94233da0..32e3b6ab 100644
--- a/GlazeWM.Bar/BarViewModel.cs
+++ b/GlazeWM.Bar/BarViewModel.cs
@@ -22,6 +22,7 @@ namespace GlazeWM.Bar
public string Background => _barConfig.Background;
public string Foreground => _barConfig.Foreground;
public string FontFamily => _barConfig.FontFamily;
+ public string FontWeight => _barConfig.FontWeight;
public string FontSize => _barConfig.FontSize;
public string BorderColor => _barConfig.BorderColor;
public string BorderWidth => BarService.ShorthandToXamlProperty(_barConfig.BorderWidth);
diff --git a/GlazeWM.Bar/Components/ClockComponent.xaml b/GlazeWM.Bar/Components/ClockComponent.xaml
index 4c2d09d7..3f7a7f63 100644
--- a/GlazeWM.Bar/Components/ClockComponent.xaml
+++ b/GlazeWM.Bar/Components/ClockComponent.xaml
@@ -10,6 +10,7 @@
VerticalAlignment="Center"
Foreground="{Binding Foreground}"
FontFamily="{Binding FontFamily}"
+ FontWeight="{Binding FontWeight}"
FontSize="{Binding FontSize}"
Text="{Binding FormattedTime}" />
</UserControl>
diff --git a/GlazeWM.Bar/Components/ComponentViewModel.cs b/GlazeWM.Bar/Components/ComponentViewModel.cs
index 0e5173c2..490757a4 100644
--- a/GlazeWM.Bar/Components/ComponentViewModel.cs
+++ b/GlazeWM.Bar/Components/ComponentViewModel.cs
@@ -14,6 +14,7 @@ namespace GlazeWM.Bar.Components
public string Background => _componentConfig.Background ?? _parentViewModel.Background;
public string Foreground => _componentConfig.Foreground ?? _parentViewModel.Foreground;
public string FontFamily => _componentConfig.FontFamily ?? _parentViewModel.FontFamily;
+ public string FontWeight => _componentConfig.FontWeight ?? _parentViewModel.FontWeight;
public string FontSize => _componentConfig.FontSize ?? _parentViewModel.FontSize;
public string BorderColor => _componentConfig.BorderColor;
public string BorderWidth => BarService.ShorthandToXamlProperty(_componentConfig.BorderWidth);
diff --git a/GlazeWM.Bar/Components/WorkspacesComponent.xaml b/GlazeWM.Bar/Components/WorkspacesComponent.xaml
index b6c0394a..059fb608 100644
--- a/GlazeWM.Bar/Components/WorkspacesComponent.xaml
+++ b/GlazeWM.Bar/Components/WorkspacesComponent.xaml
@@ -25,6 +25,7 @@
Foreground="{Binding DataContext.DefaultWorkspaceForeground, ElementName=_workspacesComponent}"
BorderBrush="{Binding DataContext.DefaultWorkspaceBorderColor, ElementName=_workspacesComponent}"
FontFamily="{Binding DataContext.FontFamily, ElementName=_workspacesComponent}"
+ FontWeight="{Binding DataContext.FontWeight, ElementName=_workspacesComponent}"
FontSize="{Binding DataContext.FontSize, ElementName=_workspacesComponent}"
BorderThickness="{Binding DataContext.DefaultWorkspaceBorderWidth, ElementName=_workspacesComponent}"
MinWidth="{Binding ActualHeight, RelativeSource={RelativeSource Self}}"
diff --git a/GlazeWM.Bar/MainWindow.xaml b/GlazeWM.Bar/MainWindow.xaml
index 4bf2b6c9..e477c416 100644
--- a/GlazeWM.Bar/MainWindow.xaml
+++ b/GlazeWM.Bar/MainWindow.xaml
@@ -15,6 +15,7 @@
Height="50"
Background="{Binding Background}"
FontFamily="{Binding FontFamily}"
+ FontWeight="{Binding FontWeight}"
FontSize="{Binding FontSize}"
Opacity="{Binding Opacity}"
AllowsTransparency="True"
diff --git a/GlazeWM.Domain/UserConfigs/BarComponentConfig.cs b/GlazeWM.Domain/UserConfigs/BarComponentConfig.cs
index 4d1626f8..92ade8a0 100644
--- a/GlazeWM.Domain/UserConfigs/BarComponentConfig.cs
+++ b/GlazeWM.Domain/UserConfigs/BarComponentConfig.cs
@@ -24,6 +24,11 @@ namespace GlazeWM.Domain.UserConfigs
/// </summary>
public string FontFamily { get; set; }
+ /// <summary>
+ /// Fallback to bar font weight config if unset.
+ /// </summary>
+ public string FontWeight { get; set; }
+
/// <summary>
/// Fallback to bar font size config if unset.
/// </summary>
diff --git a/GlazeWM.Domain/UserConfigs/BarConfig.cs b/GlazeWM.Domain/UserConfigs/BarConfig.cs
index 83c508ef..a1afd862 100644
--- a/GlazeWM.Domain/UserConfigs/BarConfig.cs
+++ b/GlazeWM.Domain/UserConfigs/BarConfig.cs
@@ -17,6 +17,8 @@ namespace GlazeWM.Domain.UserConfigs
public string FontFamily { get; set; } = "Segoe UI";
+ public string FontWeight { get; set; } = "Normal";
+
public string FontSize { get; set; } = "13";
public string BorderColor { get; set; } = "blue";