Skip to content

Commit

Permalink
#178 - displayed the sprint members as icons
Browse files Browse the repository at this point in the history
  • Loading branch information
lastunicorn committed Feb 9, 2024
1 parent facac62 commit 0ad214f
Show file tree
Hide file tree
Showing 16 changed files with 447 additions and 133 deletions.
5 changes: 5 additions & 0 deletions doc/changelog.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
Velo City
====================================================================================================

v1.18.0
----------------------------------------------------------------------------------------------------
- [feature] Display sprint memers as icons in the "Sprint Members" tab.


v1.17.0
----------------------------------------------------------------------------------------------------
- [feature] [wpf] Reduces the size of the navigator buttons and some spaces.
Expand Down
2 changes: 1 addition & 1 deletion doc/readme.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
VeloCity 1.17.0
VeloCity 1.18.0
====================================================================================================

This is a tool that calculates the velocity of a scrum team and helps planning the sprints.
Expand Down
2 changes: 1 addition & 1 deletion release/VeloCity.proj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<PropertyGroup>
<OutputPath>output\</OutputPath>
<TempPath>temp\</TempPath>
<Version>1.17.0</Version>
<Version>1.18.0</Version>
<OutputFileName>VeloCity-$(Version).zip</OutputFileName>
<RepositoryRoot>..\</RepositoryRoot>
</PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion sources/Directory.build.props
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<Project>

<PropertyGroup>
<Version>1.17.0.0</Version>
<Version>1.18.0.0</Version>
<Product>VeloCity</Product>
<Company>Dust in the Wind</Company>
<Copyright>Copyright © Dust in the Wind 2022-2023</Copyright>
Expand Down
20 changes: 20 additions & 0 deletions sources/VeloCity.Wpf.Presentation.CustomControls/ChartBar.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ namespace DustInTheWind.VeloCity.Wpf.Presentation.CustomControls;

public class ChartBar : Control
{
#region Value

public static readonly DependencyProperty ValueProperty = DependencyProperty.Register(
nameof(Value),
typeof(IChartBarValue),
Expand All @@ -34,6 +36,24 @@ public IChartBarValue Value
set => SetValue(ValueProperty, value);
}

#endregion

#region Orientation

public static readonly DependencyProperty OrientationProperty = DependencyProperty.Register(
nameof(Orientation),
typeof(Orientation),
typeof(ChartBar)
);

public Orientation Orientation
{
get => (Orientation)GetValue(OrientationProperty);
set => SetValue(OrientationProperty, value);
}

#endregion

static ChartBar()
{
DefaultStyleKeyProperty.OverrideMetadata(typeof(ChartBar), new FrameworkPropertyMetadata(typeof(ChartBar)));
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
// VeloCity
// Copyright (C) 2022-2023 Dust in the Wind
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.

using System.Windows;
using System.Windows.Controls;
using DustInTheWind.VeloCity.ChartTools;
using DustInTheWind.VeloCity.Domain;

namespace DustInTheWind.VeloCity.Wpf.Presentation.CustomControls;

public class SprintMemberBox : Control
{
#region MemberName

public static readonly DependencyProperty MemberNameProperty = DependencyProperty.Register(
nameof(MemberName),
typeof(string),
typeof(SprintMemberBox)
);

public string MemberName
{
get => (string)GetValue(MemberNameProperty);
set => SetValue(MemberNameProperty, value);
}

#endregion

#region ChartBarValue

public static readonly DependencyProperty ChartBarValueProperty = DependencyProperty.Register(
nameof(ChartBarValue),
typeof(IChartBarValue),
typeof(SprintMemberBox)
);

public IChartBarValue ChartBarValue
{
get => (IChartBarValue)GetValue(ChartBarValueProperty);
set => SetValue(ChartBarValueProperty, value);
}

#endregion

#region WorkHours

public static readonly DependencyProperty WorkHoursProperty = DependencyProperty.Register(
nameof(WorkHours),
typeof(HoursValue),
typeof(SprintMemberBox)
);

public HoursValue WorkHours
{
get => (HoursValue)GetValue(WorkHoursProperty);
set => SetValue(WorkHoursProperty, value);
}

#endregion

#region AbsenceHours

public static readonly DependencyProperty AbsenceHoursProperty = DependencyProperty.Register(
nameof(AbsenceHours),
typeof(HoursValue),
typeof(SprintMemberBox)
);

public HoursValue AbsenceHours
{
get => (HoursValue)GetValue(AbsenceHoursProperty);
set => SetValue(AbsenceHoursProperty, value);
}

#endregion

static SprintMemberBox()
{
DefaultStyleKeyProperty.OverrideMetadata(typeof(SprintMemberBox), new FrameworkPropertyMetadata(typeof(SprintMemberBox)));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.

<ItemGroup>
<ProjectReference Include="..\VeloCity.ChartTools\VeloCity.ChartTools.csproj" PrivateAssets="All" />
<ProjectReference Include="..\VeloCity.Domain\VeloCity.Domain.csproj" PrivateAssets="All" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -31,39 +31,98 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.

<Style TargetType="{x:Type customControls:ChartBar}">

<Setter Property="Orientation" Value="Horizontal" />

<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type customControls:ChartBar}">

<Grid
Visibility="{Binding Value, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource NullToVisibilityConverter}}"
HorizontalAlignment="Stretch">
<Grid>

<ContentControl x:Name="_Horizontal">

<Grid
Visibility="{Binding Value, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource NullToVisibilityConverter}}"
HorizontalAlignment="Stretch">

<Grid.ColumnDefinitions>
<ColumnDefinition Width="{Binding Value.ActualFillValue, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource IntToGridLengthConverter}}" />
<ColumnDefinition Width="{Binding Value.ActualEmptyValue, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource IntToGridLengthConverter}}" />
<ColumnDefinition Width="{Binding Value.ActualEmptySpace, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource IntToGridLengthConverter}}" />
</Grid.ColumnDefinitions>

<Border
Grid.Column="0"
Background="LimeGreen"
Height="3" />

<Border
Grid.Column="1"
Height="1"
Background="#40F9F1A5" />

<Border
Grid.Column="2" />

<Grid.ColumnDefinitions>
<ColumnDefinition Width="{Binding Value.ActualFillValue, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource IntToGridLengthConverter}}" />
<ColumnDefinition Width="{Binding Value.ActualEmptyValue, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource IntToGridLengthConverter}}" />
<ColumnDefinition Width="{Binding Value.ActualEmptySpace, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource IntToGridLengthConverter}}" />
</Grid.ColumnDefinitions>
</Grid>
</ContentControl>

<Border
Grid.Column="0"
Background="LimeGreen"
Height="3" />
<ContentControl x:Name="_Vertical">

<Border
Grid.Column="1"
Height="1"
Background="#40F9F1A5" />
<Grid
Visibility="{Binding Value, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource NullToVisibilityConverter}}"
VerticalAlignment="Stretch">

<Border
Grid.Column="2" />
<Grid.RowDefinitions>
<RowDefinition Height="{Binding Value.ActualEmptySpace, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource IntToGridLengthConverter}}" />
<RowDefinition Height="{Binding Value.ActualEmptyValue, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource IntToGridLengthConverter}}" />
<RowDefinition Height="{Binding Value.ActualFillValue, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource IntToGridLengthConverter}}" />
</Grid.RowDefinitions>

<Border
Grid.Row="0" />

<Border
Grid.Row="1"
Width="1"
Background="#40F9F1A5" />

<Border
Grid.Row="2"
Background="LimeGreen"
Width="3" />

</Grid>
</ContentControl>

</Grid>

<ControlTemplate.Triggers>
<Trigger Property="Orientation" Value="Horizontal">
<Setter TargetName="_Horizontal" Property="Visibility" Value="Visible" />
<Setter TargetName="_Vertical" Property="Visibility" Value="Collapsed" />
</Trigger>
<Trigger Property="Orientation" Value="Vertical">
<Setter TargetName="_Horizontal" Property="Visibility" Value="Collapsed" />
<Setter TargetName="_Vertical" Property="Visibility" Value="Visible" />
</Trigger>
</ControlTemplate.Triggers>

</ControlTemplate>
</Setter.Value>
</Setter>

<!--<Style.Triggers>
<DataTrigger Binding="{TemplateBinding Orientation}" Value="Horizontal">
<Setter TargetName="_Horizontal" Property="Visibility" Value="Visible" />
<Setter TargetName="_Vertical" Property="Visibility" Value="Collapsed" />
</DataTrigger>
<DataTrigger Binding="{TemplateBinding Orientation}" Value="Vertical">
<Setter TargetName="_Horizontal" Property="Visibility" Value="Collapsed" />
<Setter TargetName="_Vertical" Property="Visibility" Value="Visible" />
</DataTrigger>
</Style.Triggers>-->

</Style>

</ResourceDictionary>
Loading

0 comments on commit 0ad214f

Please sign in to comment.