Skip to content

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

refactor(bar,domain): rename 'custom_display_name' -> 'display_name' in workspace config

Lars Bergerff4d372ae0ad
diff --git a/GlazeWM.Bar/Components/WorkspacesComponent.xaml b/GlazeWM.Bar/Components/WorkspacesComponent.xaml
index 287b6e60..b6c0394a 100644
--- a/GlazeWM.Bar/Components/WorkspacesComponent.xaml
+++ b/GlazeWM.Bar/Components/WorkspacesComponent.xaml
@@ -18,7 +18,7 @@
<DataTemplate>
<Button
x:Name="WorkspaceButton"
- Content="{Binding CustomDisplayName}"
+ Content="{Binding DisplayName}"
Command="{Binding DataContext.FocusWorkspaceCommand, ElementName=_workspacesComponent}"
CommandParameter="{Binding Name}"
Background="{Binding DataContext.DefaultWorkspaceBackground, ElementName=_workspacesComponent}"
diff --git a/GlazeWM.Domain/UserConfigs/WorkspaceConfig.cs b/GlazeWM.Domain/UserConfigs/WorkspaceConfig.cs
index af1e7858..89922499 100644
--- a/GlazeWM.Domain/UserConfigs/WorkspaceConfig.cs
+++ b/GlazeWM.Domain/UserConfigs/WorkspaceConfig.cs
@@ -7,7 +7,7 @@ namespace GlazeWM.Domain.UserConfigs
[Required]
public string Name { get; set; }
public string BindToMonitor { get; set; } = null;
- public string CustomDisplayName { get; set; } = null;
+ public string DisplayName { get; set; } = null;
public bool KeepAlive { get; set; } = false;
}
}
diff --git a/GlazeWM.Domain/Workspaces/Workspace.cs b/GlazeWM.Domain/Workspaces/Workspace.cs
index 8840ff8c..9faf4123 100644
--- a/GlazeWM.Domain/Workspaces/Workspace.cs
+++ b/GlazeWM.Domain/Workspaces/Workspace.cs
@@ -1,5 +1,4 @@
using System;
-using System.Linq;
using GlazeWM.Domain.Containers;
using GlazeWM.Domain.Monitors;
using GlazeWM.Domain.UserConfigs;
@@ -12,15 +11,15 @@ namespace GlazeWM.Domain.Workspaces
{
public string Name { get; set; }
- public string CustomDisplayName =>
- _userConfigService.UserConfig.Workspaces.First(w => w.Name == Name).CustomDisplayName ?? Name;
-
private UserConfigService _userConfigService =
ServiceLocator.Provider.GetRequiredService<UserConfigService>();
private WorkspaceService _workspaceService =
ServiceLocator.Provider.GetRequiredService<WorkspaceService>();
+ public string DisplayName =>
+ _userConfigService.GetWorkspaceConfigByName(Name).DisplayName ?? Name;
+
private int OuterGap => _userConfigService.UserConfig.Gaps.OuterGap;
/// <summary>