Skip to content

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

feat(bar): create `UserControl`s for clock and workspaces component types (unimplemented)

Lars Bergera389b6a3dc3b
diff --git a/GlazeWM.Bar/Components/ClockComponent.xaml b/GlazeWM.Bar/Components/ClockComponent.xaml
new file mode 100644
index 00000000..84e508b3
--- /dev/null
+++ b/GlazeWM.Bar/Components/ClockComponent.xaml
@@ -0,0 +1,13 @@
+<UserControl
+ x:Class="GlazeWM.Bar.Components.ClockComponent"
+ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+ xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+ xmlns:local="clr-namespace:GlazeWM.Bar.Components"
+ mc:Ignorable="d">
+ <Button
+ Name="Fill"
+ Width="50"
+ Background="Red" />
+</UserControl>
diff --git a/GlazeWM.Bar/Components/ClockComponent.xaml.cs b/GlazeWM.Bar/Components/ClockComponent.xaml.cs
new file mode 100644
index 00000000..b76ce8dd
--- /dev/null
+++ b/GlazeWM.Bar/Components/ClockComponent.xaml.cs
@@ -0,0 +1,28 @@
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Text;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Navigation;
+using System.Windows.Shapes;
+
+namespace GlazeWM.Bar.Components
+{
+ /// <summary>
+ /// Interaction logic for ClockComponent.xaml
+ /// </summary>
+ public partial class ClockComponent : UserControl
+ {
+ public ClockComponent()
+ {
+ InitializeComponent();
+ }
+ }
+}
+
diff --git a/GlazeWM.Bar/Components/WorkspacesComponent.xaml b/GlazeWM.Bar/Components/WorkspacesComponent.xaml
new file mode 100644
index 00000000..e053ab12
--- /dev/null
+++ b/GlazeWM.Bar/Components/WorkspacesComponent.xaml
@@ -0,0 +1,13 @@
+<UserControl
+ x:Class="GlazeWM.Bar.Components.WorkspacesComponent"
+ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+ xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+ xmlns:local="clr-namespace:GlazeWM.Bar.Components"
+ mc:Ignorable="d">
+ <Button
+ Name="Fill"
+ Width="50"
+ Background="Blue" />
+</UserControl>
diff --git a/GlazeWM.Bar/Components/WorkspacesComponent.xaml.cs b/GlazeWM.Bar/Components/WorkspacesComponent.xaml.cs
new file mode 100644
index 00000000..b0b1d2e2
--- /dev/null
+++ b/GlazeWM.Bar/Components/WorkspacesComponent.xaml.cs
@@ -0,0 +1,28 @@
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Text;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Navigation;
+using System.Windows.Shapes;
+
+namespace GlazeWM.Bar.Components
+{
+ /// <summary>
+ /// Interaction logic for WorkspacesComponent.xaml
+ /// </summary>
+ public partial class WorkspacesComponent : UserControl
+ {
+ public WorkspacesComponent()
+ {
+ InitializeComponent();
+ }
+ }
+}
+
diff --git a/GlazeWM.Bar/MainWindow.xaml b/GlazeWM.Bar/MainWindow.xaml
index a500a942..84d5edbe 100644
--- a/GlazeWM.Bar/MainWindow.xaml
+++ b/GlazeWM.Bar/MainWindow.xaml
@@ -5,6 +5,7 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:GlazeWM.Bar"
+ xmlns:components="clr-namespace:GlazeWM.Bar.Components"
xmlns:domain="clr-namespace:GlazeWM.Domain.UserConfigs;assembly=GlazeWM.Domain"
mc:Ignorable="d"
WindowStyle="None"
@@ -35,16 +36,10 @@
<ItemsControl.Resources>
<DataTemplate DataType="{x:Type domain:WorkspacesComponentConfig}">
- <Rectangle
- Width="50"
- Height="50"
- Fill="Red" />
+ <components:WorkspacesComponent />
</DataTemplate>
<DataTemplate DataType="{x:Type domain:ClockComponentConfig}">
- <Rectangle
- Width="50"
- Height="50"
- Fill="Blue" />
+ <components:ClockComponent />
</DataTemplate>
</ItemsControl.Resources>
</ItemsControl>